Files
magpie/internal/gui
yetone 5a44051eb5 gui: Discover's long-list hook moves into plugingrid.js, and the core budget carries the rest
TestCoreScriptBudget has been red on main since 5a0e0378c (06:00): the
core's scripts were 1,265,848 bytes against 1,265,544. 5a0e0378c added
344 bytes of code to plugins.js, and its body says the budget passed at
7583ed65c, but at 7583ed65c the core had only 40 bytes of room. CI's
first full run after it (e9e63c6d7, run 43323956017) went red on ubuntu
and macOS with those numbers.

The redraw that followed the import, and the threshold, now live in
plugingrid.js: pmVirtualGrids(page, card, body, draw) draws Discover's
body again from a microtask, once plugins.js holds what it returned, when
a list of VMIN cards or more was drawn whole before the import came. It
returns min, so plugins.js reads the threshold from it. plugins.js keeps
only the import, cardGrid and the three now() calls: 136 bytes out. The
budget carries the other 168, with why in its comment. The comment also
had ee1553913's "+1,112 for Codex's Open button" twice; the budget was
raised by 1,112 once (1,264,432 to 1,265,544), so one copy goes.

Run on mote at this tree (origin/main 390dd407b plus this), mote-run:
- go vet ./internal/gui; go test -run 'TestCoreScriptBudget|TestAppScript'
  ./internal/gui: ok. gofmt -l: nothing. node --check on both files.
- plugin-discover-virtual 22 of 22, plugin-market 6, plugin-kinds-discover
  22, plugins-more-discover 6, plugin-progressive 6, i18n-keys 4: all pass.
- old-webkit: 2 reds, the known ones (headerpresets.js #6030, :has()
  #5919), as 5a0e0378c recorded.
- Recomputed the budget's measure at 7583ed65c, 5a0e0378c and this tree
  with a copy of codeBytes: 1,265,504, 1,265,848, 1,265,712.

Broken by hand: with the microtask redraw taken out,
plugin-discover-virtual still passes 22 of 22, so the "drawn whole before
the import" redraw has no test, before this change and after it.

Not tried: the real app; a long list drawn before plugingrid.js arrives.
2026-11-13 08:18:10 +08:00
..
…
…