Commit Graph
10 Commits
Author SHA1 Message Date
yetone 45303db0e3 gui tests: click-scroll's late wheel is looked at once the page has heard it and the reader's moment is over, not after a fixed 400ms (#1660)
"a wheel the page hears of after its scroll is still the reader's" failed
once in Chromium on a loaded machine.

Cause: the subtest delays the app's wheel listener by 60ms (the busy page
of the subtest), then waited a fixed 400ms before looking at the view,
and 100ms after a scroll by code. The listener opens a 250ms moment in
which scrolls are the reader's (readerScrolls(250)). That moment starts
when the page hears the wheel, not when the wheel happens. When the
machine ran the 60ms timer more than ~150ms late, the code's scroll that
followed fell inside that moment and stood ("code's scroll is put
back"). Later still, the view was looked at before the wheel was heard
("the late-heard wheel must scroll the view").

Fix: the wrapper counts the wheels the page has heard. Each wheel is
looked at once the page has heard it and performance.now() has passed
purposeUntil, the end of the reader's moment. The code's scroll is
looked at three frames on, since it is put back at the frame it is told
of. The wait of 100ms before the last wheel stays as a minimum gap: what
was put back from 50ms before a wheel counts as that wheel's own
(givesBack). The page is unchanged.

Run (injected: the late wheel's delay raised from 60ms, the test copied
to the scratchpad with only that number changed):
- Before, Chromium:
  - 200ms: 4 of 22 cases red, "code's scroll is put back".
  - 500ms: 4 of 22 red, "the late-heard wheel must scroll the view".
  - 60ms: green.
- After:
  - 200ms Chromium: 22 of 22.
  - 500ms Chromium: 22 of 22.
  - 500ms WebKit: 22 of 22.
- Broken by hand: with givesBack left out of the wheel listener, the
  test is red on "the late-heard wheel must scroll the view".
- A first try with no gap before the last wheel went red: the code's
  scroll was handed to the wheel. That is why the 100ms stays.
- click-scroll.test.cjs, both engines, 20 runs: 440 of 440 cases passed, with a load average of 12 to 17.
2026-10-12 03:25:47 +08:00
yetone 9bb68615b0 gui: a scroll not the reader's made just before a click is put back, not kept as where the reader was (#1554)
skill-install-agents-all.test.cjs was red on main in Chromium at 420px
(en, ja, de): the install picker's All chip, clicked, left the Library
view 5px down.

Cause: the browser tells the page of a scroll at the next frame. The test
clicks while the Library view is still sliding in (view-in, translateY
5px), and Playwright's click scrolls the chip into view first; with the
view 5px taller than it is high at 420px, that scroll takes the view to
its 5px foot. The click came in before that scroll's event, so the click
guard took its snapshot (held.chain, held.top) at 5px and every hold()
after kept it there, the scroll event included. A real click can do the
same: WebKit scrolls a field focused on the press, or code scrolls just
before the click, and the scroll was adopted as the reader's.

Fix (app.js, the click guard): before taking a click's snapshot, a view
not scrolled by the reader (no purposeUntil window, no scrollbar drag)
is put back where the reader left it (backToReader), as the scroll
listener would have done a frame later. A click in quick turn after
another still holds that one first, as before.

The guard is shared by every view, so every picker and button is covered;
the library picker needs no change of its own (the MCP editor's picker is
in #modal, outside any view).

Tests:
- click-scroll.test.cjs: new "a scroll the page hears of after the click
  is still put back" (scrollTop += 40 and a click in one task). Red on the
  old app.js in Chromium and WebKit (expected 2020, actual 2060), green
  with the fix.
- sessions-manage-paging.test.cjs scrolled with Playwright's
  scrollIntoViewIfNeeded and clicked Show more before the next frame, so
  it passed in Chromium only through this bug (the guard puts that scroll
  back a frame later; it was red in WebKit on main). It now scrolls with
  the reader's wheel; green in both engines.
- docs/subsystems/gui-shell.md says a click is taken where the reader
  left the view.

Run: skill-install-agents-all.test.cjs red before (en/ja/de 420px,
"view:5,0"), green after in Chromium and WebKit, every language;
click-scroll.test.cjs green in both engines; 306 GUI test files that
assert on scrolling or touch the library/skills/MCP, then the other 253,
both engines. Failures seen there were rerun alone: purpose-filter (WebKit,
1px, #1291) and search-api (WebKit zh, #1442) fail the same on the old
app.js; the rest pass alone. No Go changed.
2026-10-11 12:14:35 +08:00
yetone d9d59435f4 gui: a wheel or touch scroll the page is told of only after the view scrolled stays the reader's, not put back as code's (a busy Mac lost the wheel step; panel-arrange's wheel to the foot went back to 0 in WebKit under load)
WebKit scrolls off the main thread, and under load the view's scroll event
fires before the wheel that caused it (probe: scroll at 518ms, wheel
dispatched at 521ms with timeStamp 517ms). The scroll guard took the scroll
as no one's and put it back. Each put-back is now kept for a second, and a
trusted wheel or touchmove made before it was put back, going the same way,
gives it back. A scroll by code put back before the input was made stays put
back.

click-scroll.test.cjs "a wheel the page hears of after its scroll is still
the reader's" delays the app's own wheel listener by 60ms (the trusted
event kept), with nothing clicked and with a click held, and checks a
code scroll before the wheel stays put back. Without the fix it fails in
Chromium and WebKit: "the late-heard wheel must scroll the view".

Run: click-scroll, context-scroll-end, tray-cell-click, panel-arrange in
Chromium and WebKit, all green. panel-arrange 28 parallel WebKit runs
(load avg ~150-200): origin/main 20/28 runs failed (:89 wheel undone x4,
:147 Done x25); old app.js plus the test fix, 5/28 runs failed (:89 x6);
both fixes, 27/28 and 28/28 (the one failure a page.goto load timeout),
Chromium 28/28. Full GUI suite, both engines: the remaining failures are
login-import, routing-sessions and plugin-market, which fail or pass the
same way alone on origin/main. go test -tags nogui ./internal/gui ok.
2026-10-08 19:14:10 +08:00
yetone 82a36a35c7 click-scroll test: Live and a day, and the room kept for a click, are checked where the accounts sit beside the requests (1440px) — red on main since 5d871723 (#860)
5d871723 moved the Routing page's two columns from an 860px to a 1150px
Routing area. At the test's 1100px window the accounts now go below the
requests, so scrolling the view to its end takes the date bar out of sight
first, and "Live and a day, picked in turn, stay under the pointer" and
"the room kept for a click goes as the reader scrolls back" failed in
Chromium and WebKit on every run ("what's clicked must be in sight").
b2345078 and 76d82528 shipped saying they fail the same on origin/main.
Those two subtests open the page at 1440px, the layout they were written
for; the rest stay at 1100, one column, as before.

Verified: git bisect (69665a69 good) names 5d871723; the file fails 2 of 9
per engine on origin/main and passes 18 of 18 three runs in a row with
this change (Playwright 1.63, Chromium and WebKit).
2026-10-07 04:30:26 +08:00
tsuixl 189a4b95ac 修正滚动测试的日期按钮定位与触底判断 (#807) 2026-10-05 07:44:06 +08:00
XYenon 6582aa75a5 gui: connection instructions and editor help are readable, model ids can be selected without picking their row, and keyboard focus comes into sight — the connection labels read at 3.66:1 in light mode and their help was fainter still; they, editor labels and help, settings descriptions and model descriptions use the existing fg-2 rather than changing the muted or faint palette. Gateway model descriptions, the ids in Names & levels and error or warning messages allow text selection, with a selection in a model row leaving it intact and an ordinary click still picking it. Enter and Space can focus another field while the click guard puts the page back, leaving that field out of sight; after the guard settles, a trusted keyboard action that moved focus to a different element reveals it only when needed, through scrollOnPurpose, with Tab and pointer scrolling kept as before. readable-focus tests the contrast in light and dark, mouse selection, ordinary model picks, Tab and Shift+Tab, Enter and Space, and pointer clicks staying put; its three cases fail on the old assets in Chromium and WebKit. click-scroll's date buttons are scoped to .rt-days .rt-day, retaining every scroll assertion. The new tests, click-scroll, settings-groups, gateway-model-info, phone-web and settings-shortcut pass in both engines; go test -tags nogui ./internal/gui, go vet -tags nogui ./..., go build -tags nogui, JavaScript syntax checks and git diff --check pass. (#826) 2026-10-05 04:35:28 +08:00
yetone dbe2f01e7c routing: the requests sit right under the stage, sized to stay in sight with it (Image #23: 这一块离那个路由动画距离太远了,用户点击了这里都不知道发生了什么) — the groups and the providers with several accounts or keys came between them, so a request picked in the list played on a stage scrolled out of sight above. They now come after the requests, and the list is as tall as leaves the stage in view above it (216–420px), scrolling on its own rather than the page. Picking a request no longer sends the list back to its top in WebKit (it was emptied and refilled, which reset its scroll). click-scroll.test.cjs brings a row into the list before picking it, as a reader would; Chromium and WebKit pass 2026-09-29 18:11:10 +08:00
yetone 2ed6dd0520 routing: a request clicked in the Requests list leaves the page where it is (点击这里的任何一个空间都会自动滚动到页面的最顶部,这是重大bug) — picking a request scrolled the view up to the stage on purpose (scrollIntoView with the reader's click in hand, the one scroll the click hold lets through), and the stage is at the top of the Routing page, so every row clicked threw the reader to the top. It no longer scrolls: the row stays under the pointer and the stage and its story change above it; the 'errors your agent saw' count does the same. Live, a day and Replay them all were already held. Tested: a new click-scroll.test.cjs case clicks three rows of a day and Replay them all, each must stay within 1px, in Chromium and WebKit; it fails on main (picking request 3 moved the page 393px) and passes with the change; menu-scroll.test.cjs passes 2026-09-29 16:58:02 +08:00
yetone b95dab91d8 agents: "Show 7 more" unrolls the rows downwards (Image #22: 点击这里为什么是向上展开) — a click holds what was clicked where it is on the screen (v0.1.377), and the button sits under the rows it opens, so as they grew above it the view scrolled to keep it put and the page rode up past them. A control marked data-unrolls is held by the part it is in instead: the rows open down and the button goes down with them. click-scroll.test.cjs checks it in Chromium and WebKit (it fails without the change) 2026-09-29 16:29:33 +08:00
yetone 73af4c282c gui: a click never moves the page, held for every view in one place (为什么点击一个控件总会滚到页面顶部,能否从根上解决) — picking Live after a day emptied the requests' list, the page got shorter than where the reader was, and the browser pulled it up; any code could also call scrollOnPurpose() and scroll on a redraw, a tab switch or a filter. Now what the reader clicks stays where it is on the screen for the next 4s: the element clicked, or once it's drawn again its nearest neighbour or parent, is held in place against content above it changing, and when content below it shrinks, room is kept at the view's foot (a .view-room spacer, gone once the reader scrolls back up) so the page isn't clamped. Code scrolls only with scrollOnPurpose(e) given the reader's own event, and without one the scroll is refused. The wheel, touch, keys and dragging are the reader's and scroll as before. The Routing page's days stay reachable with no live requests, and the library tabs no longer reset to the top. New click-scroll.test.cjs (Live/day switching with the view scrolled to its end, a jump, growth, redraws and helpers with no event, a scroll asked for, the room kept and removed, the wheel) passes 12/12 on Chromium and WebKit; the old code fails it (picking Live moved the page 294px); menu-scroll 22/22 2026-09-29 13:22:00 +08:00