Status: done (2026-11-23) Priority: 2 Size: S Design ref: src/page/chunks.js; docs/testing.md Goal: Squares of the map no longer flicker to the overview at high speed: refreshTrees and refreshPaths mark the level-0 and level-1 chunks near a changed tile stale, which stay on screen until their replacement is painted and swapped in the same frame. Acceptance criteria:
repaintTiles and refreshPaths mark the level-0 and level-1 chunks near a changed tile stale instead of dropping them; wantedList() and schedule() treat a stale chunk as wanted; a finished job drops the old chunk and adds the new one in the same frame.tests/page.js: after a tile is added to st.treeDirty, the chunk covering it stays visible every frame until it is replaced.#ps123, 20 s (the scratch script of the diagnosis): frames that show a coarser level fall from 63 of 109 (9 episodes) towards none. Result: 11 of 107, 1 episode; that episode is the loader’s opening glide (still running when the script starts measuring), passing level 1 before its destination is painted; after it, no frame showed a coarser level.npm test and npm run verify pass.
Notes:staleChunk marks; fresh(k) replaces chunks.has(k) in wantedList and schedule’s skip; the finished job drops the old chunk and adds the new one before display().job.again, also when no chunk is there yet): added and left stale. Not cancelled, so continuous dirtying cannot starve it. The panned-away drop still holds: a stale chunk in view is wanted.pending (Painting detail, N areas left) counts only areas with no chunk: a stale one shows detail while it is repainted, and at speed the label would otherwise never go out.repaintTiles near tiles, page/editor, page/editplace) gets the same swap. Eviction still bounds memory: stale chunks count against the cap and are evicted when not seen; one job’s canvas extra while it paints.#ps123, 20 s at as fast as it goes): 67 of 91 frames showed a coarser level (7 episodes) before, 11 of 107 (1, the opening glide) after.