Files
magpie/docs
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
..