Repository navigation
Conversation
📝 WalkthroughWalkthroughAdded a test that verifies transparent-only clearing appears before 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
Verification evidence (#6491)Unit tests (vitest)Full Live app validation (Electron over CDP, dev build of this branch)Attached to a dev build of
Raw eval output at opacity 0.85: {"opacity":0.85,"canvasCount":1,"canvasInfo":["xterm-decoration-overview-ruler"],"hasRowsDiv":true,"rowDivs":61}(the remaining Before/after reasoning: Before this fix, Screenshot of the terminal rendering cleanly at opacity 0.85 (DOM renderer) saved locally under the gitignored |
|
Follow-up pushed in What changed:
Tradeoff status: the reported user-facing tradeoff is eliminated for the current supported xterm WebGL addon. The remaining honest caveat is implementation-level: xterm has no public transparent-frame clear API, so the WebGL-preserving path is guarded and falls back to DOM if a future xterm version changes the private renderer shape. Validation:
|
96372d3 to
18bf54f
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
config/scripts/xterm-webgl-transparent-frame-patch.test.mjs (2)
7-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated patch representation risks silent drift.
The exact source snippet (lines 7-20) and the exact minified bundle snippet (line 21-22) are both manually maintained copies of the same patch content, independent from the actual patch file (
config/patches/@[email protected]). Any future patch edit requires updating three places in sync (patch file + these two hardcoded strings); missing one silently weakens the containment test rather than failing loudly.Consider deriving the expected snippets from the patch file itself (e.g., parsing added lines from the
.patch) so there is a single source of truth, or at minimum add a comment pointing back to the patch file with a reminder to keep them in sync.
21-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueExact minified-string matching is brittle to bundler/minifier changes.
transparentClearBundle(lines 21-22) must match byte-for-byte against generated bundle output. Any change in the minifier's formatting (spacing, semicolon insertion, argument ordering) across a toolchain version bump would break this test even though the patch's actual behavior is unchanged, producing noise unrelated to the real invariant being protected.Also applies to: 41-46
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 74ec957d-c7ea-4bac-8fb0-1112e29e1b00
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
config/patches/@[email protected]config/reliability-gates.jsoncconfig/scripts/xterm-webgl-transparent-frame-patch.test.mjs
|
Moving this PR to draft because it has been untouched for more than 80 days (latest recorded PR activity or commit timestamp: 2026-07-11T09:43:57Z; checked on 2026-10-27). This keeps the review queue focused on active work while preserving the proposal. Please mark it ready for review when work resumes. |
|
Closing as superseded by #36580, which adds Opaque, Translucent and Blurred window materials on macOS, Windows and Linux (plus Reduce Visual Effects) and fixes the transparent-terminal flicker. Thank you for this PR, it shaped the design. |
Description
Fixes #6491.
Transparent WebGL terminals were blending each semi-transparent redraw over the previous framebuffer, so ordinary output made the background step toward opaque and visibly flicker. This PR patches
@xterm/[email protected]at its renderer boundary:allowTransparencyis enabled, set separate alpha blending, clear the framebuffer to transparent, then draw backgrounds, glyphs, and the cursor;ONEfor source alpha, so configured opacityaremainsainstead of becominga²;xterm-addon.boundary-containmentreliability gate.Evidence
Reproduction and fix proof
A live Electron pixel/count harness exercised the real Orca WebGL path at 50% opacity:
[192,192,192,192] → [224,224,224,224] → [240,240,240,240] → [248,248,248,248] → [252,252,252,252] → [254,254,254,254];[128,128,128,128];255;128;128after context recreation;[770,771,1,771], i.e.SRC_ALPHA,ONE_MINUS_SRC_ALPHA,ONE,ONE_MINUS_SRC_ALPHA.Lifecycle coverage also passed five repeated WebGL context-loss cycles on split panes, floating-workspace reopen/atlas recovery, and document-visibility resume.
Post-rebase checks on pushed SHA
18bf54ffcc28f9f5e285ac7f33d97610096364cbpnpm typecheck:webpassed;pnpm check:reliability-gatespassed for 34 gates;pnpm check:max-lines-ratchetpassed;git diff --checkpassed;ELI5
Imagine drawing on a half-transparent sheet of glass. Previously, Orca kept laying the new sheet over the old one, so it became darker every time the terminal redrew. Now Orca wipes the glass clear before drawing the latest frame, so 50% transparent stays 50% transparent.
Trade-offs
No end-user regression was observed in the tested paths. Opaque terminals pay only one false
allowTransparencybranch and make no additional GL calls. Transparent terminals add one blend-state update and one framebuffer clear per rendered frame, which is the work required to prevent stale-frame accumulation.The inherent blast radius is high because this is a version-pinned patch in xterm's render hot path. Residual risk is moderate after deterministic tests, live Electron evidence, performance sampling, and two clean independent reviews. The patch must be maintained or removed deliberately when xterm is upgraded.
Reliability proof
xterm-addon.boundary-containment.partial; this PR adds source/CJS/ESM patch-parity coverage without claiming cross-platform live-GPU completeness.Performance risk inventory and no-regression evidence
Touched surface: the xterm WebGL
renderRowshot path. This PR does not add polling, scheduling, listeners, timers, caches, scans, allocations, startup awaits, provider fanout, IPC/RPC, subprocesses, telemetry, output buffering, or a new lifecycle owner.Exact-patch macOS samples were approximately
241–278 µs/framewith the fix enabled and237–263 µs/framewith only the clear suppressed. Medians were247 µsenabled versus254.7 µssuppressed; the ranges overlap, so the run did not isolate a performance regression. This evidence is intentionally narrower than a claim of universal zero cost.Provider and platform coverage
@xterm/addon-webglbeta and does not enable terminal transparency.Residual gaps
Promotion status and rollback / demotion rule
Keep
xterm-addon.boundary-containmentatpartial. Do not promote based on this PR alone; promotion requires stable CI history and representative Linux/Windows GPU evidence.Revert or demote this slice if monitoring or follow-up testing shows blank frames, context-loss loops, incorrect alpha after opacity toggles, a platform-specific WebGL regression, or a repeatable frame-time regression outside the measured overlap. An xterm upgrade must either carry forward an equivalent verified invariant or remove the patch because upstream now provides it.
Made with Orca