perf(web): stop rendering hidden terminals - #246
Merged
Conversation
Pause Ghostty canvas paint, snapshots, and cursor blinks while a surface is hidden or zero-size. Keep parsing output. Reveal refits and repaints in full.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Greptile SummaryThis change pauses Ghostty canvas rendering, snapshots, cursor timers, fitting, and focus while terminal surfaces are hidden or have no measurable size, while continuing to parse terminal output. When a terminal becomes visible again, it performs a complete fit and repaint. Confidence Score: 5/5Safe to merge. No outstanding issues were identified. Files Needing Attention: None. Reviews (2): Last reviewed commit: "Merge branch 'main' into perf/web-hidden..." | Re-trigger Greptile |
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.
Problem
Hidden Ghostty canvases still snapshot, paint, and blink. Settings font previews and any mounted drawer keep doing that work while display:none.
Changes
Pause canvas paint, snapshots, and cursor timers when a surface is hidden or zero-size. Keep parsing output and answering VT queries. Reveal refits and repaints in full. The dormant drawer now forwards its existing visible flag into the surface.
Adapted from pingdotgg#9718. ChatView was not restored. Upstream WASM headless tests were left out because this Vitest setup cannot load Ghostty WASM.
Scope
This PR is hidden-terminal rendering only.
Covered here:
Still assigned to this handoff, in later PRs:
Verification
vp test run apps/web/src/terminal/ghostty/surface.test.ts apps/web/src/components/ThreadTerminalDrawer.test.ts: 50 passed.vp linton the two files: clean.Native Electron paint while a drawer is hidden was not run on this Linux host.
Implemented and verified by Grok 4.6 High in Grok Build via Orca.