ac4af582301a4e8a29245dbba767eba31334ddf9
7
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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). |
||
|
|
d4699c00a6 |
gui tests: usage-card-refresh reads the refresh button's own path, not the card's first
|
||
|
|
f5b1d36ffa |
usage: a card's refresh opens after its "Refreshed just now", so the text never moves
The owner: on hovering a usage card, the refresh icon appearing pushed "刚刚刷新" right each time. The icon opened from width 0 in front of the text, so the text moved by the icon's width on every hover. The refresh button now comes after the text in every place quotaRefresh is put (the read-when line, a panel row's name, the panel's error line, both panel sub lines, and a failed window's line after its fix button), and opens rightward into the card's padding: open, it is 14px with a -2px right margin, so the text before it stays where it was. A panel row's name ellipsizes rather than being pushed. Run (darwin, chromium and webkit, logs kept whole): - usage-card-refresh, panel-quota-refresh, quota-curve, quota-balance-error, usage-remote-key-limits, usage-remote-cards: 144/144 ok - quota-refresh-order, usage-refresh, i18n-keys: 17/17 ok usage-card-refresh's hover check now asserts the text's rects don't move when the icon opens and that the icon sits after the last of them; on the old code it fails at the text moving. Not tried: the real Wails app; the Windows and Linux webviews. |
||
|
|
85eef5d87a |
gui: quota refreshes stay centered and finish each turn without jumping (#2397)
chiperman's patch (df288db, #2397), landed here since external PRs are collaborators only. The card redraw replaced its refresh button on a background reading and again when the click finished, restarting its rotation and hover reveal and moving the Updated text; a fast reply also stopped the spin partway through a turn. Each account's control and its animation are kept through redraws, the reply is shown at once and the current 800ms turn finishes (at least one), Reduce Motion skips it, and the glyph sits on the text baseline in an inline grid instead of a pixel offset. Changed in landing: main had since given the tray panel's Allowances the same quotaRefresh (#panelQuota, #840). A kept button is reused only when its redraw took it out of the page, so a refresh started on the Usage page is never moved out of the panel (or back); the other place's copy of a turning control gets busy+spun and turns by itself until done() clears it. The panel's hover rule (.pq-card:hover) reveals it as the Usage card's does. quota-refresh-order's vm harness gets a document stub for that. app.js's budget goes from 1,250,000 to 1,269,000: with four comments shortened it is 1,250,904 here, the core's own code since the tray panel draws the same control, plus 1.5% as the budget's comment asks. Every core script together is still under coreScriptBudget, which is unchanged. Run, sandbox HOME, pinned GOMODCACHE/GOCACHE, load ~110-360 from other sessions' suites: - Full suite on |
||
|
|
2a99e7a429 |
gui: keep refreshed cards when their account identity changes (#1630)
The |
||
|
|
86cc7ac56d |
usage, gui: keep refreshed cards and distinguish deferred readings (#1630)
A card refresh and a whole-page quota read could replace each other's entire snapshots. An older GET arriving after a successful refresh put the old number back on screen; two card refreshes could undo each other. Apply each POST's requested card alone and retain completed card readings against whole-page requests that began before them. Later reads can still update or remove cards. Failed refreshes do not block background results. A saved Claude account not asked for, or allowances held by When I ask, could also show "couldn't be read just now" without making a request. Carry readDeferred through the cached card and CLI/gateway report, and give that state a separate translated notice. Keep original read times, network-failure notices and authentication errors. Automatic saved-account reads and the existing 30-second floor are unchanged. Verification (macOS arm64, Go 1.27.2, Bun 1.4.3; isolated homes/API fixtures): - On base |
||
|
|
37f2a2851f | gui: a Usage card has a refresh of its own, left of its "Updated" time, that reads that card alone (Hu9956, #840: 在更新时间左侧加一个刷新按钮,鼠标悬停在套餐卡片上时显示,可以单独刷新某个套餐的用量,不用刷新全部) — only the page's Refresh read the allowances again, every card at once. Each card now has a ↻ that opens left of "Updated 3 min ago" (or of a failed reading's reason, or under a balance) as the card is hovered; at rest the line starts where the card's others do. A click POSTs /api/usage/quotas/refresh?provider=&user=: provider.RefreshUsage reads that subscription account, plan key or balance key again (a Claude account by running Claude Code's own /usage, as the page's Refresh does) and puts it in place in the caches, the other cards not asked and kept as they were read; the button turns while it reads. zh, ja, de strings. TestRefreshOneCard (two keys of one relay and another provider: a refresh asks that key alone, the others keep their figures) and the plugin case in TestPluginUsage (one account of three read) fail on the old code; usage-card-refresh.test.cjs (WebKit, en and zh: aligned at rest, left of the time when hovered, a click reads that card alone, turns meanwhile, doesn't scroll; a failed card's own button) fails on the old code. usage-quota-head, usage-checkin, click-scroll, quota-read-at, balance-parts, claude-usage-asked, gui-ja and gui-de pass on WebKit. go vet, builds (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. |