fix(terminal): smooth WebGL renderer transitions - #117
Conversation
|
Reviewed head The snapshot approach addresses the blank interval during renderer changes. DOM snapshot styles are preserved: xterm's style elements are inside the cloned screen, and copying the renderer owner class keeps them applicable. Context-loss/error and unmount cleanup paths are also present. P2: The timeout does not bound snapshot cleanupIn Consider minimizing the window after snapshot creation but before those frames run. Animation frames can be suspended while the window is hidden, so the overlay remains despite the intended fallback. On return, an old snapshot can cover output that has already advanced until the queued frames and fade finish. This is a lifecycle/cleanup gap identified from the code, not a locally reproduced UI failure. Please make the fallback cleanup independent of another animation frame, or explicitly cancel the transition when the surface/window becomes hidden. Preserve paint-aligned fading for normal visible transitions. Electron's background throttling defaults to enabled, and animation frames may pause in hidden documents: Electron WebPreferences, requestAnimationFrame. Validation and performanceThe additions in At Integration with current mainAn actual Git merge rehearsal finds a conflict in CI is green for this head, but the branch predates the recent main merges. Please resolve against current main and rerun CI on the resulting head. Review method: source tracing through xterm/WebGL and Git merge checks. No local tests, benchmarks, or UI checks were run. |
|
Update after syncing the branch with the current
Validation completed locally: renderer-transition tests, typecheck, production build, Go vet/tests, native-helper checks, macOS packaging and signature verification, packaged CLI resolution, and hidden-terminal/browser smoke checks passed. The available manual hide/restore and WebGL preserve-drawing-buffer spot checks showed no visible regression; a sustained performance benchmark was not part of this validation. PR #118 separately fixes the resumed OpenCode |
|
Follow-up review of The reported snapshot cleanup issue is addressed. The 250 ms deadline now calls cleanup directly and remains independent of animation frames. Document visibility and non-live surface transitions also cancel the snapshot. The normal reveal, no-render/no-frame deadline, visibility, teardown, and reduced-motion behavioral checks all passed in the Linux and Windows CI logs. The previous merge conflict is resolved, with main's lifecycle and pinned-input state retained. The current Linux verify failure is Please sync again after #118 lands and obtain green CI on the resulting head, as you proposed. The original cleanup and behavioral-test findings are closed. Your explanation for preserveDrawingBuffer is reasonable, and the manual spot checks are useful. Its sustained rendering cost is still unmeasured; that remains a performance validation limitation, not a measured regression. Source/CI-log review only; no local tests, benchmark, or UI checks were run. |
What changed
Terminal switches between the DOM and WebGL renderers no longer hide the entire
.xtermelement withopacity: 0.The transition now keeps a snapshot of the last rendered frame while the new renderer is initialized and fitted. Once the new frame is ready, the snapshot fades out smoothly. The temporary layer is also cleaned up on WebGL errors, context loss, and teardown.
Validation
origin/mainplus this patch: 1296 passed, 0 failed, 2 skipped;npm run typecheck;The PR is based on the current
main, including merged PRs #114 and #115.