Commit Graph
4 Commits
Author SHA1 Message Date
yetone b927e09a10 gui tests: panel-arrange brings Done out from under the sticky tabs with the wheel, as the reader does, not Playwright's own scroll, which the page puts back as code's
Under load in WebKit Playwright's scroll into view left Done under #ptabs
("nav#ptabs intercepts pointer events") and the click timed out at :147
(25 of 28 parallel runs). After this, 28 parallel WebKit runs: 0 at :147.
2026-10-08 19:14:10 +08:00
yetone ceccd0e17f gui tests: panel-arrange records the menu bar cell's flash as it is lit, not by a poll that can miss its one frame under reduced motion
panel-arrange's last part calls panelQuotaFocus("deepseek") and waited for
the card to have the `flash` class. The test emulates reduced motion, and
app.css's reduced-motion rule makes every animation .01ms long, so the
flash's animationend comes within the same frame: logged, the class was on
for one frame (animationend at elapsedTime 0.00001) in every run, passing
or failing. A rAF poll sees it only if it lands in that frame; under load
it often didn't (4 of 12 parallel runs red on origin/main, all at :156).

The app is right: the card is drawn, scrolled to and flashed. The test now
records each card given the class through a MutationObserver installed
before the call, and waits for "deepseek" to be among them.

Run (Chromium and WebKit, en/zh/ja/de):
- 12 parallel copies on origin/main f00ed290: 4/12 red at :156 ("waitForFunction:
  Timeout 5000ms"). With the fix: 12/12 green at load ~110.
- With flashCard's classList.add("flash") commented out the new check
  fails (chromium en), so it still catches a card not flashed.
2026-10-08 17:32:10 +08:00
yetone 52e27881ac gui tests: panel-arrange's Usage window reads the saved order from its fixture, not set into state by hand, where the page's own load could answer after and put the first order back (red on Chromium en, zh, de) 2026-10-08 12:53:27 +08:00
yetone 490d2ea362 gui: the tray panel's Allowances tab hides subscriptions and moves them, from an Arrange at its foot (H20 on Discord: "菜单栏的详情页能不能选择某些不显示,有点额度并不想看到或者可以调整顺序,目前的还不行") — the panel's tab already followed the Usage page's order (usageOrder, byUsageOrder), but it could be set only by dragging a card's logo on the window's Usage page, which nothing in the panel said, and there was no way to leave a subscription out of the panel at all. The tab's foot now has Arrange, and "{n} hidden" beside it when some are: Arrange lists a row a subscription (balances too) in the shared order, its logo the handle (a drag, or Alt+arrows; the grip by it on hover only, as on the Usage page) and a Hide/Show pill, under a note that hiding is the panel's only and the order is the Usage page's too; Done draws the cards again. What's hidden is kept in magpie's settings (settings.PanelUsageHidden, panelUsageHidden), not the browser: routing, caps, the Usage page and the menu bar's cells still have it, and a menu bar cell for a hidden subscription still opens its card (panelPeek) until the panel is put away or the tab left. POST /api/usage/arrange takes order and panelHidden and changes only the one it is sent (both were whole-order before; an order alone still works), and the Settings save keeps panelUsageHidden as it does usageOrder. Saves draw at once and are put back with the error if they fail; no click moves the page (the view's scroll is kept across the redraw); no native select, no left-border stripe. Which allowances the menu bar shows beside its icon stays Settings' pick (trayUsages). New t() strings have zh, ja and de. TestUsageArrangePanelHidden (each field set and cleared on its own, a Settings save between) passes -race -count=20, TestSettingsSaveKeepsWhatItDoesNotSend's fixture names the field. panel-arrange.test.cjs (440px: the hidden card left out and counted, Arrange keeping the reader's scroll, the rows and note, the hover-only grip, no stripe, no sideways overflow, Show/Hide posting panelHidden without a scroll and a failed save put back, Alt+arrow and a drag posting the order, Done's cards in it, a menu bar cell opening a hidden card until the panel hides, the Usage page keeping the hidden card) passes on Chromium and WebKit in en, zh, ja and de; click-scroll, gui-ja, gui-de, i18n-keys, panel-fold, panel-usage, quota-*, routing-quota-left, tray-cell-click, tray-inuse, tray-logos, tray-usages, usage-accounts(-fold), usage-arrange, usage-fold, usage-quota-head, usage-card-refresh, usage-stale-answer, usage-remote-cards, api-key-usage, claude-usage-asked and usage-checkin pass on both. go test -tags nogui ./internal/... under a temp HOME, go vet, gofmt -l, linux (nogui) and windows builds pass. Not tried in the real tray panel on a Mac. docs/reference.md and docs/subsystems/gui-shell.md say it. 2026-10-06 19:18:14 +08:00