Files
magpie/docs
yetone f92db4cdd0 gui: a page wheeled right after a click that redraws scrolls on macOS 13's WebKit (issennknight on Discord)
issennknight (macOS 13) tried v0.1.1621 (a6d7e02c7): the page still stood
still and shook back under the wheel right after switching the Usage
page's tabs (Overview/Requests/Sessions/Context), and after an agent's row
on the Agents page was opened and then closed.

Cause, the same class a6d7e02c7 left open: under a click's 4s hold, a
scroll put back counts toward the reader's run only when the page was not
redrawn since the hold last held it (redrawn(h), against h.lay). h.lay
measured the first three held parts with NaN for one gone from the page,
and NaN never equals NaN, so a click that draws what it clicked again (the
Usage tabs are rebuilt by renderUsageTab, the agents' list by
renderAgents) read as "redrawn" at every scroll for the whole hold. A held
part stuck to the view's edge (Settings' tabs, sticky below SIDE_AT) read
the same: its place in the page changes with every scroll. Every scroll
in those 4s was put back, as the old gate did.

Fix, at the one choke point (laid/redrawn): h.lay keeps the first three
held parts still in the page that scroll with it (no sticky or fixed
ancestor inside the view), with the nodes themselves. A part gone since is
a redraw once; hold() then lays the page again and the next scroll counts
as at rest. The view's height is checked as before. Every click on every
page goes through the same hold, so this covers every tab bar, list or
card drawn again under a click, not only the two reported.

Tests:
- New view-wheel-after-redraw.test.cjs, a wheel the page never hears
  (capture listener stopping it, as view-wheel-unheard): each Usage tab
  clicked in turn, an agent's row opened and then closed, and a Settings
  tab clicked with the page scrolled under the sticky tabs; after each
  click ten wheels down and ten up must move the page. en, zh, zh-TW, ja,
  de, 420 and 1000 wide (Settings at 420 only, where its tabs are sticky).
  On origin/main's assets (MAGPIE_AFTER_REDRAW_ASSETS): 25 of 25 red in
  Chromium and in WebKit, "ten wheels of 30px right after the click
  scroll the page: from 0 to 0". With the change: 25 of 25 green in both.
- Same tree, both engines: click-scroll 11/11, i18n-keys 4/4,
  view-wheel-after-click 13/13, view-wheel-unheard 3/3,
  view-trackpad-coast 3/3, agent-expand-steady 2/2, held-animations 2/2,
  routing-days-fit 6/6, routing-failed-open 4/4, stays-strict 15/15,
  update-auto 5/5. Box at load 40-140.
- go test -tags nogui -run 'Budget|Builtin' ./internal/gui ok
  (TestCoreScriptBudget; budget not raised).

At the pushed head (rebased on 6e9820a3a..d56c14e95, 31da93ccd touched
app.js): view-wheel-after-redraw 25/25, click-scroll 11/11, i18n-keys
4/4, view-wheel-after-click 13/13 in both engines; the Go budget tests
ok (app.js 1,317,342 bytes, budget not raised). The other files above
ran at the base e1709ab42.

Broken by hand: origin/main's laid/redrawn (above, all red); the sticky
check alone removed (scrolls() returning true): the five Settings
subtests go red in Chromium, the Usage and agent ones stay green.

Not tried: real macOS 13 / WebKit 16.6 and a real trackpad; the whole GUI
suite and the Go suite were not run.
2026-10-27 02:51:04 +08:00
..