MoChou (#3450): changing a routing group's strategy took opening the
editor, finding the routing control, picking and saving. The routing
tag on each group row is now a pop-up button: it opens the app's own
menu (openProtoMenu, no native select) with the routings the editor
offers (GROUP_ROUTE_OPTS plus JS plugin routings), the current one
checked. Picking one saves the group through /api/groups/save with
every other field as it was, as the editor's Save would. Manual keeps
the pick the group had; with none the gateway takes the first member
(provider.cleanGroup), as with the editor. "Rate limited to the back"
is dropped when the new routing can't sink, as the editor does.
Re-picking the checked routing saves nothing; an editor with unsaved
changes asks first (confirmDiscard). The row's Edit button and switch
are unchanged; clicking the tag doesn't open the editor and doesn't
scroll. Keyboard: Enter/Space opens, arrows move, Escape closes back to
the tag, and focus returns to the same group's tag after the save
redraws the list. At <=560px in the window the row keeps only its
routing tag (the other tags stay hidden as before). New string "How
{name} routes: click to change it" in zh, zh-TW, ja, de.
Run (worktree; the new test, i18n-keys and internal/gui budget/i18n tests again at this head after rebasing on e698a688f, 22/22 ok):
- internal/gui/tests/routing-group-strategy.test.cjs (new): 18/18 ok,
chromium + webkit; en/zh x light/dark, 520px window and 390px web,
zh-TW/ja/de strings.
- Not the whole GUI suite: the machine sat at load 130-540 behind
other sessions' suites for 2.5h. Ran every routing-*, i18n-*,
plugin-* and gui-* file, both engines (1031 cases before I stopped
it at load 500): reds only in routing-groups-jump (1 case, filed
#3478; 3/3 alone), routing-intent-entry, routing-keys-fold,
routing-levels, routing-manual, routing-mode-goes, routing-pause,
routing-rule-effort, routing-rule-remove, all 5s timeouts or
counts read early. routing-manual passed 4/4 rerun alone;
routing-pause and routing-rule-remove fail the same way on an
origin/main c819e00c4 copy at the same load (filed: #3410, #3411,
#3408, #3096, #3094, #1612).
- go test -tags nogui ./internal/gui (core script budget): ok.
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go
vet ./..., gofmt -l, the three builds: clean.
Broken by hand, each red in the new test, then restored:
- origin/main's assets (MAGPIE_ROUTING_ASSETS): 18/18 fail ("the row's
routing is a button", 0).
- keeping sink for Manual; dropping stopPropagation (the editor
opened); dropping the focus restore; hiding every tag at narrow
width.
Screenshots of the row and open menu, light and dark, en and zh, both
engines, checked by eye.
Not tried: the real app (WKWebView/WebKitGTK/WebView2) with real
groups; Windows; a JS plugin routing in the menu (only its code path
through withJS, which the editor shares).