Commit Graph
5 Commits
Author SHA1 Message Date
yetone 80ae904c23 routing: routing groups get a page of their own, beside Routing
The owner asked for the groups to leave the Routing page (11-06): under
the live stage and every request they were a long scroll down, and New
group with them. The design was reviewed before this was built.

- New page, Routing groups (#view-groups), drawn by the routing plugin's
  same script (routingPage), so the editor, its dirty/discard and every
  group action are unchanged. Toolbar: filter, "N groups · M on",
  Templates, Import, Select, and New group as the filled button. The list
  is right under it, and a Settings section under the list holds Found
  groups (with Exclude providers…) and Names in agents' lists.
- No Export button: each group already has its own Copy to share.
- Routing keeps the live stage and the requests. A request's group opens
  the groups page at its row.
- The sidebar has a Routing groups tab right after Routing (from 1024
  points). The header's row has no room for one: at 860px the extra tab
  pushed the logo out (brand.test). There the tab is hidden, Routing's
  tab is lit for both pages (markNav), and Routing's head has a
  "Routing groups ›" button, hidden beside the sidebar.
- Every way in now goes to the groups page: the guide's Open routing
  groups, the panel's and the provider editor's Make a routing group
  (window/main?view=groups&newgroup=…). mainView still takes
  view=routing&newgroup from an older panel.
- Words: "Routing groups", "Open routing groups", "Once saved, make a
  group of them in Routing groups.", and the editor's names note now says
  the setting is under the list, in zh, zh-TW, ja and de. "Open Routing"
  stays for the Agents page's button.
- Docs: providers-accounts, gateway-routing, plugin-runtime, gui-shell
  and reference say "Routing groups page" where they mean the groups.
- Core budget: the core's scripts are 1,533,774 of 1,533,802, paid for
  by three show()/setGatewayMode comments cut in app.js. No raise.

Tests: routing-groups-page.test.cjs (new) covers the page in Chromium and
WebKit, en/zh/zh-TW/ja/de, at 1280, 640 (window) and 420 (web): no
groups on Routing, the tab or the head's button by width, the lit tab,
toolbar order, New group primary and in sight, list then Settings, no
sideways scroll, no native select, no left-border accent; a request's
group to its row; quotas redrawn with an open editor left alone. The
trace tests (routing-compact, -pause-folder, -rule-models, -folder) open
Routing, then show the groups; routing-editor-foot and
name-suffix-where-named scroll by wheel, as the scroll guard lets a
reader; builtins expects the groups tab beside the sidebar only.
Removed: routing-groups-jump (the head's "Routing groups ↓" that scrolled
down to them, gone with them), routing-pointer-pin and routing-steady
(the groups kept in place under requests streaming in above them: no
request is above them now). Their guarantee that what redraws leaves an
open editor and its typing alone is routing-groups-page's quotas case;
Routing's own lists keep their keepInView.

The groups page's jump: a request's group, or a pool's "Several keys"
chip, opened the groups page and scrolled the row to the centre, and the
next frame show()'s backAfterLoad put the page back where the reader
last left it, then brought the focused segment in by "nearest": in
WebKit the pool sat half under the window's foot (routing-mode-goes, 9
of its 10 WebKit cases). goRouting now jumps at once on a page it opens and
marks it arrived(). The wheel in routing-many-keys turns over the keys:
at the page's foot, now shorter, the mouse rested over the requests list
(.rt-reqs, overscroll-behavior: contain), which took every wheel up, and
the test stopped with 2 keys in sight. That is #4082's cause.
routing-days-fit's fixture has 12 requests, a day that fills the window,
since the day bar held needs room under it.

Run on mote (macOS 27, load 25 to 65), Playwright 1.62.0:
- Go: go vet, gofmt -l and go test ./... at the rebased head (650bf8412
  base) ok except TestMainWindowCorners (#3949); internal/gui again
  after the last edits: the same, TestCoreScriptBudget ok (1,533,773 of
  1,533,802, no raise).
- GUI, the 262 files a change here can reach, at the head and at the
  base: the reds at the head are the base's, with their issues:
  menu-input-scroll #3402, provider-mask #5109, context-fold and
  order-unknown (webkit) #3479, header-centre #3479, i18n-keys
  #5332/#5426/#5482, account-eye #5052/#4244, call-headers webkit de
  #5045, codex-predictions #2624, codex-auto-reset webkit de #4790,
  routing-* under load #5088, and zero-priced-free, last-page,
  reasoning-speed, routing-row-swap/-tag-whole/-story-shrinks/-steps-cap
  and routing-intent-entry, red at the base the same way.
- After the last edits: the 11 files with a way to the groups page or
  its scroll (group-*, routing-groups-page, routing-mode-goes,
  routing-groups-off, routing-provider-off, routing-many-keys,
  click-scroll), 175 of 176; the one red is routing-many-keys webkit's
  wire at the foot, red at the base in 8 of 12 (#5543). brand,
  gateway-mode-sessions, header-zoom-fit, header-centre,
  inner-scroll-contain and mobile-web: the same 11 reds at the head and
  the base (mobile-web compares with origin/main through git, which a
  mote-run copy hasn't).
- Rebased on ecc26a339, again: gofmt -l, go vet ./internal/gui and
  TestCoreScriptBudget ok; 10 GUI files (i18n-keys, routing-groups-page,
  routing-mode-goes, sidebar, brand, menu-first-second, library-bar-more,
  click-scroll, name-suffix-saved, unlisted-models) 211 of 212, the one
  red i18n-keys' "a plugin's words are its own", red the same at
  ecc26a339 (#5332/#5426/#5482).
- Broken by hand: without the groups page's CSS rule, brand and
  routing-groups-page go red (32 fails); with the old goRouting,
  routing-mode-goes is red in 9 of its 10 WebKit cases.

Not tried: the whole GUI suite on Linux (WSL magpie-desktop) at this
head; a run at an earlier head is under way and has the Linux reds
#4120/#4121 name. Not tried in the real macOS app, only Playwright's
WebKit.
2026-11-06 23:11:43 +08:00
yetone ce8b67de37 gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called
page.goto with no timeout of its own, so Playwright held the first load
of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a
busy box (a whole-suite run at load 130-160) that load took longer and
goto timed out. The same pattern is in 988 GUI test files (1174 pages):
every one of them now also sets setDefaultNavigationTimeout(60000) on
the same page, right after its default, so goto, reload and waitForURL
wait on the load itself with room, while clicks and waits keep their
short bar. group-from-model-add's own 20s navigation bar is raised to the
same minute. claude-switch-only also gives its first provider row (drawn
from the page's first reads) a minute before clicking it.

nav-timeout.test.cjs (no browser) reads every GUI test file and names
each page given a default under a minute without a navigation timeout of
at least a minute, so a new file can't bring the pattern back.

What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from
other sessions):
- node --check on every file in internal/gui/tests: all parse.
- nav-timeout.test.cjs against origin/main's test files: red (names the
  1174 pages); against this tree: its only reds were my own probe copies
  of the old files, since removed.
- By hand: claude-switch-only with app.js served 7s late (a busy box's
  first load), --test-name-pattern "1100 en": origin/main's file 4 of 4
  red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green.
- claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420:
  32 of 32. group-from-model-add, usage-access-key-card and i18n-keys:
  green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red
  on a 5s waitForFunction at line 115 (a wait after load, not the
  navigation), at load ~230.

Not tried: the whole GUI suite (about 1000 files; the change is one
mechanical line per page), Windows or mote (mote's browsers, #4125).
2026-10-31 02:09:18 +08:00
yetone b0b0764210 gui: a routing rule's ⋯ is always shown, and a rule Save refuses for having no condition says so under it, with how to add one or remove it (ppBruce on Discord)
ppBruce (v0.1.1290): in a routing group's editor "once a rule is added
there is no delete button, and a rule with empty conditions can't be
saved". Two causes:

- The rule's ⋯, the only way to Remove rule (and move a rule), was
  opacity 0 unless the row was hovered or focused (538753a7a, chosen "as
  the usage rows'", not an owner call). Nobody found it, and on touch
  there is no hover. It is now always drawn, in the icons' quiet grey.
- A rule whose only condition was toggled off (the reporter's 带图片)
  is refused on Save; provider.cleanRules refuses it too ("it needs a
  condition"), so refusing stays. But the refusal was a footer pill that
  cleared in 3.5s and named no way out. Save now marks every bare rule:
  a line under it (.rt-rneed, until it has a condition again) and the
  status line say "Rule {n} has no condition. Add one with its +, or
  remove the rule from its ⋯ menu", the first bare rule's + takes the
  keyboard (no scroll), and nothing is posted. A pause rule says the same
  for hours, days, agents or folders. zh/zh-TW/ja/de in i18n.js; the
  two old strings are gone, and routing-pause(-folder) expect the new
  wording.

Test: routing-rule-remove.test.cjs, Chromium and WebKit, en zh zh-TW ja
de, 1100 and 390px, with the reporter's group (one "has an image" rule to
Deepseek-V4.1-Flash, WorkBuddy AI): the ⋯ is opaque, visible, inside the
editor and topmost with the pointer elsewhere; mouse and keyboard (Tab,
Option-Tab in WebKit, Enter, ArrowUp, Enter) remove the rule and Save
posts rules: []; the bare rule's line and status, focus on its +, no
post, nothing past the editor, no sideways scroll; its condition back on,
the line goes and Save posts the rule. 20/20, three repeat runs 20/20.
On the old assets (ASSETS=) 0/20: "the rule's ⋯ is there without
hovering", opacity '0'.

Run:
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok;
  builds ok.
- go test -timeout 45m ./...: 63 ok, internal/agent timed out at 45m
  under load (~400, the GUI suite beside it; the running test 5s in);
  alone: ok 1878s.
- GUI suite, both engines: run under load ~400. My change's files
  pass alone: routing-rule-remove 20/20,
  routing-pause 14/14, routing-pause-folder 20/20, routing-rules-line
  20/20, routing-intent-entry 8/8, i18n-keys, gui-zh-tw, gui-ja, gui-de
  3/3 each. The full run: 11064 pass, 111 fail, none in the routing
  editor's files.
  Reds outside routing's editor, each red the same alone on origin/main
  c3b2e6109 and already filed: codex-predictions #2624, lightweight
  #2638, name-suffix-no-names #1937, routing-bodies and
  routing-keys-fold #2658, routing-model-rest #2115, quota-count-wrap and
  quota-name-translated #2228, provider-advanced-fold #2552, segs-glide
  #2683. routing-request-metrics' Cost item
  (#2571) fails the same on main alone. The rest of the 111 were not
  rerun one by one at that load.
2026-10-19 22:23:50 +08:00
yetone 538753a7a6 gui: a routing group's rule reads as one line, its conditions added from its + menu
The rules editor drew every condition of every rule as an empty box to
fill (tokens, images, effort, agents, intent, compact, folders, hours),
then "send to" and the model, with Move up / Remove as words and two
paragraphs of help below. Three intent rules took ~600px and the intent
itself was cut at 24ch. The owner: "现在这个页面太复杂了,用户要输入、
填写这么多东西,太恐怖了。"

Now each rule is one line, read as a sentence:

  1  asks for <intent…>  +   →  [model]   ⋯

- Only the conditions a rule has are drawn, in the rule's own order;
  each has a × (shown on hover or focus, always on touch) that clears it
  back to "not set". The rule's + opens the app menu (openProtoMenu,
  never a native select) with the conditions it doesn't have yet; a
  pause is offered only the conditions a pause can hold by.
- "→ model" sits in its own grid column (subgrid), so it lines up
  across rules whatever the conditions' widths; under 640px it wraps
  under the conditions.
- The intent is a one-row textarea that grows with its words (a hidden
  copy sizes it), so the whole intent shows and wraps; Enter and pasted
  newlines stay one line, as saved before.
- Folder boxes size to their text (canvas-measured with the box's own
  font, +8px so the caret never scrolls the text inside).
- Sending is the default and goes unsaid; a pause says "pause" before
  its model. The ⋯ menu holds Move up, Move down, Send to / Pause the
  model instead, and Remove rule.
- "Add a rule" starts a rule with the intent box ready. The two
  help paragraphs became an ⓘ beside it, and beside Effort and the
  intent model.
- Saved data is unchanged: an unchanged editor saves the same rules
  field for field (routing-rules-line round-trips the old assets too).

Docs: intent.html and start.html (en, zh, ja) say where Add a rule's
intent box and the ⋯ menu's pause now are. The /img/intent-rules-*.png
screenshots still show the old editor; not regenerated here.

Run:
- New routing-rules-line.test.cjs: every condition drawn in order, none
  empty, + menu (app menu, not select), × removes, ⋯ moves, no overflow
  or sideways scroll; Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and
  390px. Broken by hand, it went red.
- Updated routing-intent-entry, routing-compact, routing-pause,
  routing-pause-folder, routing-time; with routing-folder,
  routing-manual, routing-levels, own-requests, i18n-keys, click-scroll
  and every *menu* test: all pass in both engines but
  removed-groups-menu-scroll, red 1-2 of 8 per run on a4d580fa2's
  assets too.
- The full routing-*/group-*/images-* GUI set (1261 tests, both engines,
  concurrency 6): reds outside the editor (routing-days-fit,
  -agent-gone, -agent-hue-not-red, -burst-speed, -failed-open,
  -keys-fold, -model-rest, -side-calls, -wb-restricted, group-found-off)
  fail the same on a4d580fa2's assets run alone here. Of the editor's
  own reds in that run, two were the tests' clicks (now wheeled to, both
  ways). The third was real: in WebKit routing-pause-folder's ⋯ menu shut
  at once, because the folder box's text had scrolled inside it. The box
  now has room for the caret; the next commit fixes the menu itself.
- go test ./internal/gui: ok.
- Shots: zh 1000px before/after, en 390 WebKit, zh 390 Chromium, dark.

Not tried: the real Wails window, the Windows box, a WebKitGTK without
subgrid (falls back to unaligned columns), the docs images.
2026-10-14 22:43:42 +08:00
yetone 0fcf563e61 routing: a pause rule can hold by folder, in some or outside them (#1606, Ti800)
Ti800 keeps a subscription's quota for one long task in one folder and
wants every other request kept off it (their option A). A pause rule
held by hours, days and agents only; it now holds by folder too.

What changed
- provider.Rule gains ExceptFolders (json exceptFolders, CLI
  except-folders=, aliases except-folder/not-in/outside): the folder the
  agent works in is in none of them. An agent that says no folder isn't
  known to be in one, so except-folders holds for it; folders= still
  never matches an unknown folder. Both conditions are allowed on send-to
  and pause rules (Rule.ByFolder, inFolders); cleanRules cleans and
  dedupes both and lets a pause hold by time, days, agents and folders.
- PausedOut takes the request's folder. The gateway reads it (workDir)
  only when a pause by folder is on the way (PausesByFolder); embeddings
  and System One's decision calls pass none. Paused carries Folder and
  ByFolder for the trace. ruleFor reads the folder for except-folders
  rules too.
- Group sharing drops every rule by folder, except-folders included.
- CLI usage, TUI hint, ParseRule/Line round-trip except-folders.
- GUI: the rule editor has a "not in folder" condition beside "in
  folder", both shown on a pause and kept when a rule turns into one; a
  folder that isn't a whole path and a pause with no condition are
  refused; the group's rule and the trace say "not in …", and a paused
  reason says the folder read or that the agent said none. Strings in
  zh, zh-TW, ja, de.
- Docs: gateway-routing.md, site start.html (en, zh, ja).

What was run
- go test -tags nogui ./internal/provider ./internal/gateway (folder,
  pause, share, rule tests); full go test ./... before pushing.
- Broke it by hand: with the gateway's folder read replaced by nothing,
  TestPauseByFolder fails (in-task requests went to the other member).
- GUI: routing-pause-folder.test.cjs (new), routing-pause,
  routing-folder, i18n-keys and 10 other rule-editor tests in Chromium
  and WebKit, en/zh/zh-TW/ja/de, at 1100px and 390px.
- gofmt -l; GOOS=linux and GOOS=windows go vet of the touched packages.

Not tried: a real Claude Code subagent's request against a live group;
by the documented rule a request without a folder is paused off the
kept member, which is what the reporter asked for.
2026-10-11 21:24:10 +08:00