Files
magpie/internal/gui
yetone 876d477d73 sidebar: a sub-list's row under the pointer is lit as by a torch
The owner asked for the sidebar's sub-lists (Settings' General, Allowances,
Network and sharing…) to light the way a torch does, not a whole row at
once, and picked this version from a mock-up of four: only the row under
the pointer lights, brightest where the pointer is and falling off along
the word, the rest of that row a little over the others. The light
follows the pointer with a small lag and fades as it moves to the next
row or off the list.

- navlamp.js (new, 2KB): one pointermove listener on the document eases
  the light's place and each row's --si; a touch lights nothing, the
  selected row is never lit, reduced motion puts it there at once. It is
  imported by app.js when a sub-list is first drawn, as signsheets.js
  and the others are, so it is outside the core's scripts.
- app.css: .nav-s > span.lit paints the word with a radial gradient
  clipped to its text (36px wide, its heart --fg taken to white in dark
  and black in light by relative colour, the rest of the row 15% toward
  --fg). All under @supports color-mix, so Safari 15 keeps the plain
  hover; while the lamp is on that plain hover stands down so the row
  doesn't flash to full ink first.
- app.js: the one import line (+46 bytes), with a clause of the sub-row
  click comment cut that said again what the line above says, so app.js
  and the core stay in their budgets with no raise (app.js 1,313,980,
  core 1,537,347).
- old-webkit.test.cjs lists navlamp.js among the scripts loaded later.

Tests: nav-lamp.test.cjs, both engines, light and dark, en and zh. It
reads the word's pixels: with the pointer at a word's start the start's
ink stands off the ground more than the end's, and the other way round
once the pointer is at its end; one row lit at a time, the next row
taking it and the first going out, all out off the list, the selection
and a touch never lit, lit in one frame with reduced motion.

Run at this head:
- the whole GUI suite on xiaomi-gpu (Windows), at 03d21ab8e plus this:
  16131 tests, 15613 pass, 486 fail in 91 files, nav-lamp ok. Those 91
  files again at concurrency 2, at 11fc687c0 with this (6d6715370 before
  this message): 416 fail; at origin/main 11fc687c0 alone: 499 fail. The
  reds are the same tests on both sides (#4124, numbers there).
- nav-lamp.test.cjs + old-webkit.test.cjs: chromium on mote 4/4; webkit
  on xiaomi-gpu (Windows) 4/4 and old-webkit 7/7. On mote webkit timed out
  at launch (load 21, another session's full GUI suite), so it ran on
  Windows instead.
- go test -tags nogui -run Budget ./internal/gui on mote: ok.

Broken by hand, each red, then put back:
- the gradient flattened to one colour: "brightest where the pointer is"
  red in every case;
- touch let through: "a touch lights no row" red;
- every row kept lit: the first row never goes out, timed out red.

Not tried: the real app on Linux (WebKitGTK) and Windows (WebView2), and
macOS 13's WebKit, where relative colour is missing and the heart is
--fg itself.
2026-10-31 09:55:32 +08:00
..
…
…
…