ac4af582301a4e8a29245dbba767eba31334ddf9
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c3a9574de4 |
gui: a key's row keeps its controls shown and stays put under the pointer
tenacious_eagle_96548 (Discord, #general): in a provider's editor a key's row showed its controls only under the pointer, so it kept growing and shrinking, and moving away to fill in something else collapsed it. Cause: app.css (#841) gave a key's unset controls (No limit at once, No spend cap, Set balance, Switch off, Remove) no room off the pointer. A hover made the row wrap from 38px to 59px and pushed the rows below down. With Set balance open and typed into, moving the pointer to the Name field collapsed the other pills, and the field moved 158px right and 25px up under the caret (real magpie web, sandbox HOME on mote). Fix: the list is drawn only in the provider's editor, where every key is there to be set, so a key's row now shows every control, laid out the same under the pointer as off it, as a phone's already did. The name and the masked key stay whole; what doesn't fit beside them goes under the row's first line. The "held" class that kept a clicked row open is gone with what it worked around. Subscription accounts' rows (opacity only, no shift), grips and the ⋯ menu are unchanged. New key-row-steady.test.cjs: chromium and webkit, en/zh/zh-TW/ja/de, app 560/1000px and tab 420/1000px. Every control is shown off the pointer, nothing in any row moves with the pointer over any row, and a balance being typed keeps its place, caret and "100" when the pointer goes to the Name field. key-row-chips-fit's "one line when not hovered" became "laid out the same hovered or not"; stale hover comments updated in key-own-balance, key-spend-cap, key-switch, key-gemini and key-plan. Run (mote, through mote-run, at this head on origin/main |
||
|
|
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). |
||
|
|
00e0fd11b7 |
gui: a key switches off and on again by name, beside Remove (wei_VC on X)
wei_VC on X: "我希望可以 disabled 某些 key,现在只有移除,后面我想使用只能
再次新增". magpie could already keep a key off (KeyAccount.Off, the
caller key's Off), but the only switch was the tick dot at the row's
start, drawn with cursor: default and no word, so no one read it as
one. Remove was the only thing with a name.
- A provider's keys: each row has Switch off (on hover, beside Remove,
as Remove is) or, when the key is off, Switch on, always shown. The
first key too, while another key is on: keys/off gives its place to
the next one on (provider.SetKeyOn's promote, unchanged). The last
key on has none, as it has no Remove; the provider's own switch is
for that.
- Gateway keys (the caller keys on the Gateway page): Disable key /
Enable key is the first item of the key's … menu, above Rotate key
and Remove.
- Words reused, already in all five languages ("Switch off"/"Switch
on", "Disable key"/"Enable key"). No new i18n keys, no Go change.
The gateway already skips an off key on every route: providers'
keys go out only through Provider.KeysOn (fallback, key_models, video,
groups, remote key limits) and the first key is always on; an off
caller key is refused in access. Not changed.
Run:
- New internal/gui/tests/key-switch.test.cjs: Chromium + WebKit, en,
zh, zh-TW, ja, de, 420 and 900px: 20/20 ok on mote. It switches the
first key off, the off key on, the first back on, checks the posts
are keys/off and keys/on (never keys/remove), no scroll, the button
inside the row, and no Switch off on the last key on.
- gateway-card.test.cjs (now checks Disable key, Enable key, Rotate
key, Remove and the off-key/on-key posts) and api-key-theme: 46/46
ok with key-switch on mote.
- Broken by hand: key-switch on origin/main's app.js 0/10 (Chromium);
gateway-card on origin/main's keys.js 0/10 (Chromium).
- gofmt -l clean; go vet ./... darwin and GOOS=windows ok;
GOOS=linux go vet -tags nogui ./internal/{gui,provider,gateway}/...
ok (GOOS=linux ./... without nogui stops in Wails' cgo files on a
cross build, as before).
- go test -timeout 45m ./internal/provider/... ./internal/gateway/...
./internal/gui/... on mote at
|