Skip to content

fix: restore full masked refresh on every panel activation#314

Merged
parsakhaz merged 2 commits into
mainfrom
restore-activation-refresh
Jul 7, 2026
Merged

fix: restore full masked refresh on every panel activation#314
parsakhaz merged 2 commits into
mainfrom
restore-activation-refresh

Conversation

@parsakhaz

Copy link
Copy Markdown
Member

Summary

Reverts the two attempts to lighten the activation refresh (v2.4.11 light repaint, v2.4.14 WebGL keep-alive + atlas clear) and restores the proven v2.4.10 (#308) painting policy: full masked reset+replay on every panel activation, light silent repaint only on pure window refocus. Both lightweight approaches shipped rendering regressions in production; the full refresh is load-bearing for paint correctness.

What each attempt broke

  • v2.4.11 (light repaint on activation): stale frames from the hide→show renderer swap survived as ghosted/overdrawn rows persisting through live output.
  • v2.4.14 (keep-alive contexts + clearTextureAtlas on attach): xterm terminals with the same font/theme share one texture atlas — clearing it from one terminal poisoned every other live terminal's glyph cache. Symptom: garbage glyphs that self-repair only where text is selected (selection re-rasterizes those cells with new colors → fresh atlas entries).

What is kept from the perf work

  • Single replay per activation (not the old ×2 with the 300ms duplicate)
  • 512KiB getState cap and no 8MB serialized-snapshot tag-along — bounds each replay
  • Baked light palette (no per-frame GPU invert filter), contrast floor
  • Serialize-on-hide throttle, blur-gated animations, hidden-container fit guards

Code changes

Pre-Merge Testing

  • Switch tabs/panes with streaming Claude/Codex TUIs — no ghosted rows, no garbage glyphs, no manual Refresh needed (brief refresh mask on each switch is expected and intended)
  • Select text in a busy terminal — renders correctly before and after
  • Blur 15s → refocus — clean repaint
  • Battery saver re-sync unchanged

Build Verification

  • pnpm typecheck passes
  • pnpm lint passes (0 errors)

parsakhaz added 2 commits July 7, 2026 11:29
The full reset+replay on panel activation is load-bearing for paint
correctness, not just a buffer re-sync. Two shipped attempts to lighten
it both regressed rendering:

- v2.4.11 replaced it with a light fit+repaint: stale frames from the
  hide->show renderer swap survived as ghosted/overdrawn rows
- v2.4.14 kept WebGL contexts across hides and cleared the texture
  atlas on attach: xterm terminals sharing a font/theme share ONE
  texture atlas, so the clear poisoned other live terminals' glyph
  cache — garbage glyphs that only repaired where text was selected
  (selection re-rasterizes those cells)

Restore the v2.4.10 (#308) activation policy: full masked refresh on
every panel activation and always in battery saver; the light silent
repaint remains only for pure performance-mode window refocus, where no
renderer swap occurred. Replay cost stays bounded by the v2.4.11 wins
that remain (single replay, 512KiB getState cap, no 8MB serialized
snapshot tag-along).

Also documents the shared-atlas hazard and marks the activation refresh
as do-not-remove without an offline renderer-swap repro.
@parsakhaz parsakhaz merged commit 416ce68 into main Jul 7, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant