fix(frontend): stop fit loop committing transient cell-box mis-measurements (#313)#316
Merged
Merged
Conversation
…ements (#313) The onRender convergence loop added in #312 recovered the under-counted rows from #280, but on a HiDPI display it could lock the Codex orchestrator terminal at half size with a ghosted composer (#313). FitAddon derives the grid by dividing the pane box by the renderer's measured css cell box. During the WebGL atlas warm-up that cell box can emit a one-frame transient (a doubled box on a 2x display), which halves the proposed cols/rows. The loop committed that single frame's proposal, resized the grid to half, then detached after a few "stable" frames — so nothing re-fired the PTY resize that makes zellij repaint, leaving the grid stuck at half width and the stale composer un-cleared. Require a differing proposal to repeat identically across two consecutive renders before applying it, so a one-frame transient only updates the pending value and is never committed. Add 600ms/1200ms settle fits as a session-bounded backstop: by then the atlas and font metrics are warm, so even if the loop detached at a briefly-stable wrong measurement, a late re-measure corrects the grid and fires the resize zellij needs to repaint cleanly. fit() is idempotent, so a correct terminal never reflows. Fixes #313 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the badly-clipped Codex orchestrator terminal reported in #313: the grid renders at roughly half width and a fraction of the pane height, with a ghosted/duplicated composer.
Why
#312 added an
onRenderconvergence loop toXtermTerminalthat recovered the under-counted rows from #280. But comparing the screenshots:FitAddon.proposeDimensions()derives the grid by dividing the host box by the renderer's measuredcss.cellbox (verified in the installed addon source). During the WebGL atlas warm-up that cell box can emit a one-frame transient — on a HiDPI display (the report is DPR 2) a briefly-doubled box halves the proposed cols/rows. The convergence loop committed that single frame's proposal, resized the grid to half, then detached after a few "stable" frames. With the loop detached and the grid stuck, nothing re-fired the PTY resize that makes zellij repaint, so the half-size grid froze and the stale composer was never cleared.How
pendingvalue and is never committed.fit()is idempotent, so a correctly-sized terminal never reflows.Testing
npm run typecheck— cleannpm test— 140 passed (15 files)Backend untouched, so the Go gate was skipped.
Fixes #313
🤖 Generated with Claude Code