Skip to content

Revert terminal rendering changes from #10692, #10794, #10871, and #10907 - #11338

Merged
nwparker merged 5 commits into
stablyai:mainfrom
nwparker:nwparker/revert-terminal-render-flash
Jul 29, 2026
Merged

nwparker merged 5 commits into
stablyai:mainfrom
nwparker:nwparker/revert-terminal-render-flash

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

Validation

  • pnpm typecheck
  • 43 focused terminal tests
  • changed-code quality gate
  • React Doctor changed-files gate
  • max-lines ratchet

nwparker and others added 5 commits July 28, 2026 19:58
…tablyai#10871)"

This reverts commit 5a6a9e0.

Reverted for terminal rendering regressions (flashing, lost content).
Conflict resolution preserves the forwardRef signature from stablyai#10433 and
drops the parked-presentation gating stablyai#11016 fed with its effective set.

Co-authored-by: Orca <[email protected]>
…i#10794)" and "fix(terminal): stop switch bold flash and Windows lag (stablyai#10692)"

This reverts commits 4681edb and
8f5a454.

stablyai#10794 was itself a partial revert of stablyai#10692, so both are reverted
together: the Windows retained-WebGL LRU and the macOS pre-paint
(layout-phase) visibility transition that survived it. Terminal
visibility resume returns to passive disposal and recreation on every
platform, and the WebGL context ceiling returns to a flat 128.

Co-authored-by: Orca <[email protected]>
…nal-render-flash

# Conflicts:
#	src/renderer/src/components/Terminal.tsx
#	src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.tsx
@nwparker
nwparker merged commit 3a80fbe into stablyai:main Jul 29, 2026
28 checks passed
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a7447106-1f13-4282-99ed-d209520d5f49

📥 Commits

Reviewing files that changed from the base of the PR and between 238d3a1 and a11fb78.

📒 Files selected for processing (36)
  • docs/reference/plans/2026-07-27-sta-2694-alt-screen-reveal-artifacts-handoff.md
  • src/renderer/src/components/Terminal.tsx
  • src/renderer/src/components/terminal-pane/TerminalOverlaySlot.tsx
  • src/renderer/src/components/terminal-pane/TerminalPane.tsx
  • src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.react185.test.tsx
  • src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.tsx
  • src/renderer/src/components/terminal-pane/apply-terminal-visibility-transition.ts
  • src/renderer/src/components/terminal-pane/terminal-initial-render-settle.test.ts
  • src/renderer/src/components/terminal-pane/terminal-initial-render-settle.ts
  • src/renderer/src/components/terminal-pane/terminal-overlay-assignments.ts
  • src/renderer/src/components/terminal-pane/terminal-overlay-positioning.ts
  • src/renderer/src/components/terminal-pane/terminal-visibility-effect-phase.test.ts
  • src/renderer/src/components/terminal-pane/terminal-visibility-effect-phase.ts
  • src/renderer/src/components/terminal-pane/terminal-visibility-resume.test.ts
  • src/renderer/src/components/terminal-pane/terminal-visibility-resume.ts
  • src/renderer/src/components/terminal-pane/use-cold-parked-terminal-presentation.test.ts
  • src/renderer/src/components/terminal-pane/use-cold-parked-terminal-presentation.ts
  • src/renderer/src/components/terminal-pane/use-terminal-overlay-presentation.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-global-effects.test.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-global-effects.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/components/terminal-pane/use-terminal-tab-cold-parking.test.ts
  • src/renderer/src/components/terminal-pane/use-terminal-tab-cold-parking.ts
  • src/renderer/src/lib/pane-manager/pane-reveal-repaint.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-refresh-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-renderer.ts
  • src/renderer/src/lib/pane-manager/reveal-repaint-synchronized-output.test.ts
  • src/renderer/src/lib/pane-manager/terminal-synchronized-output-release.test.ts
  • src/renderer/src/lib/pane-manager/terminal-synchronized-output-release.ts
  • src/shared/worktree-card-properties.test.ts
  • tests/e2e/fixtures/opencode-altscreen-live-fixture.cjs
  • tests/e2e/terminal-hidden-view-parking.spec.ts
  • tests/e2e/terminal-opencode-altscreen-reveal-artifacts.spec.ts
  • tests/e2e/terminal-reveal-draw-command-probe.spec.ts
  • tests/e2e/terminal-reveal-latch-visual-evidence.spec.ts
  • tests/e2e/terminal-synchronized-output-release-perf.spec.ts

📝 Walkthrough

Walkthrough

Terminal presentation handoff state and initial-render settlement callbacks were removed. Overlay and terminal visibility now derive from direct visibility, activity portal, and active-group state. Visibility resume operations execute inline, including backlog recovery, WebGL restoration, viewport synchronization, fitting, and repaint scheduling. Cold-parking returns its parked-tab set directly, while synchronized-output release calls and related observation coverage were removed.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment on lines 17 to 20
expect(props).not.toContain('branch')
expect(props).toContain('pr')
expect(props).toContain('automation')
expect(props).toContain('cli')
expect(props).toEqual(DEFAULT_WORKTREE_CARD_PROPERTIES)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Out-of-scope test assertion removal

expect(props).toContain('cli') is removed here, but 'cli' is still present in DEFAULT_WORKTREE_CARD_PROPERTIES and this file has no relation to the terminal rendering changes being reverted. The surviving toEqual(DEFAULT_WORKTREE_CARD_PROPERTIES) check makes the assertion redundant, so coverage isn't weakened — but it's worth confirming this deletion was intentional and not an accidental side-effect of the revert.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Was this assertion removal intentional? It isn't related to the terminal rendering reverts and 'cli' is still in DEFAULT_WORKTREE_CARD_PROPERTIES.

@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown

Greptile Summary

This PR reverts four terminal rendering improvements (#10692, #10794, #10871, #10907) — WebGL visibility transitions, cold-park presentation gating, and synchronized-output release hooks — while preserving hidden-worktree retention and SSH parking from current main. The revert collapses the two-phase useLayoutEffect+useEffect visibility flow back to a single useEffect, removes the isPresented intermediate state that gated what was shown during tab switches, and deletes the DEC 2026 synchronized-output latch release.

  • Terminal visibility: isPresented / presentedWorktreeId removed everywhere; isVisible is now the sole visibility gate for both the split (WorktreeSplitSurface) and non-split worktree render paths, along with all overlay slot style/interaction logic.
  • Synchronized-output release removed: terminal-synchronized-output-release.ts deleted and its call sites in pane-reveal-repaint.ts and pane-webgl-renderer.ts cleaned up; TUIs that open a ?2026h frame exactly when a tab switch fires will again show stale canvas content on reveal (STA-2694 regression is explicitly accepted).
  • Window wake ordering changed: recoverVisibleTerminalWindowWake now drains backlog before sync-intent/resume/fit rather than after, while still keeping sync-intent before resume; enforceTerminalViewportIntents at the end is preserved.

Confidence Score: 4/5

Safe to merge; the revert is mechanically clean and the key visibility-state invariants are preserved across all code paths.

The revert removes a sizable chunk of WebGL transition and synchronized-output logic that was actively causing artifacts. The bookkeeping refs are updated correctly in the inlined single-effect path, and the window-wake ordering still satisfies the pre-sync-before-resume invariant. Two minor items: non-split path missing inert on hidden-measured container, and an out-of-scope test assertion removal.

Files Needing Attention: src/renderer/src/components/Terminal.tsx (missing inert on hidden measurement container in non-split path) and src/shared/worktree-card-properties.test.ts (out-of-scope assertion removal).

Important Files Changed

Filename Overview
src/renderer/src/components/Terminal.tsx Removes isPresented/presentedWorktreeId state from both split and non-split worktree rendering paths; reverts visibility gating back to isVisible alone. Missing inert on non-split hidden-but-measured terminals.
src/renderer/src/components/terminal-pane/TerminalOverlaySlot.tsx Removes isPresented/isWorktreePresented props and associated interaction guards; inlines formerly-extracted CSS anchor-positioning constants; simplifies style/display logic to use only isVisible.
src/renderer/src/components/terminal-pane/use-terminal-pane-global-effects.ts Replaces the two-phase useLayoutEffect+useEffect visibility transition (via applyTerminalVisibilityTransition) with a single useEffect, inlining resume/hide logic. Removes macOS-specific pre-paint effect path.
src/renderer/src/components/terminal-pane/terminal-visibility-resume.ts Removes post-paint recovery return type; moves backlog drain into resumeTerminalVisibilityHeavy; reorders recoverVisibleTerminalWindowWake to drain before sync-intent. Intentional revert of the two-phase reveal approach.
src/renderer/src/lib/pane-manager/terminal-synchronized-output-release.ts File deleted entirely — removes the DEC 2026 synchronized-output latch release that prevented stale canvas renders on reveal. Callers in pane-reveal-repaint.ts and pane-webgl-renderer.ts cleaned up.
src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.tsx Removes useTerminalOverlayPresentation and buildTerminalOverlayAssignments imports; inlines a simpler assignment map; drops coldParkedTerminalTabIds from cold-parking hook return.
src/renderer/src/components/terminal-pane/use-terminal-tab-cold-parking.ts Return type simplified from {parkedTerminalTabIds, coldParkedTerminalTabIds} to just ReadonlySet<string> since coldParkedTerminalTabIds is no longer consumed after the presentation hook was removed.
src/shared/worktree-card-properties.test.ts Removes expect(props).toContain('cli') — an out-of-scope change unrelated to terminal rendering. Coverage is not weakened because the surviving toEqual(DEFAULT_WORKTREE_CARD_PROPERTIES) is stricter.
src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts Removes onInitialRenderSettledRef dep and the scheduleTerminalInitialRenderSettled call that drove worktree presentation settling.
src/renderer/src/lib/pane-manager/pane-reveal-repaint.ts Removes releaseAbandonedSynchronizedOutput call from schedulePaneRevealPresent; the synced-output release is gone with the deleted file.

Sequence Diagram

sequenceDiagram
    participant R as React
    participant GE as useTerminalPaneGlobalEffects
    participant TVR as terminal-visibility-resume
    participant PM as PaneManager

    Note over R,PM: Tab switch (worktree-active path)
    R->>GE: useEffect [isActive, isWorktreeActive, rendererVisible]
    GE->>TVR: "resumeTerminalVisibility({shouldUseLightTabResume})"
    alt Heavy resume (first reveal or surface restore)
        TVR->>PM: drain backlog + flushTerminalOutput
        TVR->>PM: syncTerminalViewportIntents
        TVR->>PM: resumeRendering()
        TVR->>PM: fitAllRevealedPanes()
        TVR->>TVR: resetAndRefreshAllTerminalWebglAtlases
        TVR->>PM: scheduleRevealRepaint()
    else Light tab resume (intra-worktree)
        TVR->>PM: requestLightTabBacklogRecovery
        TVR->>PM: scheduleRevealRepaint()
    end
    GE->>GE: update wasVisible/hasCompleted refs

    Note over R,PM: Window wake recovery
    R->>GE: useTerminalWindowWakeRecovery
    GE->>TVR: recoverVisibleTerminalWindowWake
    TVR->>PM: drain + flushTerminalOutput (per pane)
    TVR->>PM: syncTerminalViewportIntents
    TVR->>PM: resumeRendering()
    TVR->>PM: fitAllRevealedPanes()
    TVR->>PM: enforceTerminalViewportIntents
    TVR->>PM: scheduleRevealRepaint / scheduleRevealPresent
Loading

Comments Outside Diff (1)

  1. src/renderer/src/components/Terminal.tsx, line 2368-2385 (link)

    P2 Missing inert on hidden-but-measured worktree container

    The non-split worktree <div> lost its inert attribute (the old code had inert={!isPresented}), while the split-surface path in WorktreeSplitSurface still sets inert={!isVisible}. When shouldMeasureHiddenWorktree is true, the non-split container renders with opacity-0 pointer-events-none but without inert, allowing keyboard focus (Tab key) to land inside invisible terminal content. The aria-hidden={!isVisible} alone hides it from the accessibility tree but does not block keyboard navigation.

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…stablyai#10871, and stablyai#10907 (stablyai#11338)

* Revert "fix(terminal): avoid flash while restoring parked terminals (stablyai#10871)"

This reverts commit 785158b.

Reverted for terminal rendering regressions (flashing, lost content).
Conflict resolution preserves the forwardRef signature from stablyai#10433 and
drops the parked-presentation gating stablyai#11016 fed with its effective set.

Co-authored-by: Orca <[email protected]>

* Revert "fix(terminal): limit pre-paint WebGL resume to macOS (stablyai#10794)" and "fix(terminal): stop switch bold flash and Windows lag (stablyai#10692)"

This reverts commits 5a5adaa and
0c09b5d.

stablyai#10794 was itself a partial revert of stablyai#10692, so both are reverted
together: the Windows retained-WebGL LRU and the macOS pre-paint
(layout-phase) visibility transition that survived it. Terminal
visibility resume returns to passive disposal and recreation on every
platform, and the WebGL context ceiling returns to a flat 128.

Co-authored-by: Orca <[email protected]>

* Revert "fix(terminal): release an abandoned synchronized-output frame on reveal (STA-2694) (stablyai#10907)"

This reverts commit 0520c27.

---------

Co-authored-by: Orca <[email protected]>
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