Skip to content

Avoid extra terminal drawer render when opening#4158

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/component-performance-optimization-f0ce
Draft

Avoid extra terminal drawer render when opening#4158
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/component-performance-optimization-f0ce

Conversation

@cursor

@cursor cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Removed the visibility effect that incremented terminal resize state when the drawer opened.
  • Made the existing terminal fit effect respond directly to visibility, preserving the open-time fit without a second drawer commit.
  • Removed all temporary React Scan and diagnostic instrumentation.

Why

Opening the terminal drawer updated resizeEpoch after the initial visible render, causing an avoidable second ThreadTerminalDrawer commit. A clean React Scan run now records one drawer commit while the terminal still fits and resizes correctly.

UI Changes

No visual change. The terminal drawer opens and focuses as before, with one committed drawer render instead of two. Diagnostic React Scan recording used a temporary overlay that was removed before submission.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (not applicable; no visual change)
  • I included a video for animation/interaction changes
Open in Web View Automation 

Note

Prevent TerminalViewport from fitting and resizing while the terminal drawer is hidden

Previously, a useEffect in ThreadTerminalDrawer bumped resizeEpoch on visibility changes, triggering resize operations even when the terminal was hidden. Now, TerminalViewport accepts a visible prop and skips fit/scroll/resize operations when false, re-running them when visibility changes to true.

Macroscope summarized 7c87dec. (Automatic summaries will resume when PR exits draft mode or review begins).

cursoragent and others added 2 commits July 19, 2026 16:21
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jul 19, 2026
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). 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