Skip to content

perf(web): stop rendering hidden terminals - #246

Merged
leoisadev1 merged 2 commits into
mainfrom
perf/web-hidden-terminals
Sep 11, 2026
Merged

perf(web): stop rendering hidden terminals#246
leoisadev1 merged 2 commits into
mainfrom
perf/web-hidden-terminals

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

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 lint on 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.

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.
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
akeru-bot-landing Skipped Skipped Sep 10, 2026 6:23pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 10, 2026
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile Summary

This 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/5

Safe 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

@leoisadev1
leoisadev1 merged commit 9797224 into main Sep 11, 2026
11 checks passed
@leoisadev1
leoisadev1 deleted the perf/web-hidden-terminals branch September 11, 2026 07:56
@github-actions github-actions Bot mentioned this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant