Skip to content

fix(ui): terminal renderer escape hatch + unified WebGL degradation#305

Merged
luokerenx4 merged 1 commit into
masterfrom
fix/terminal-renderer-fallback
Jun 10, 2026
Merged

fix(ui): terminal renderer escape hatch + unified WebGL degradation#305
luokerenx4 merged 1 commit into
masterfrom
fix/terminal-renderer-fallback

Conversation

@luokerenx4

Copy link
Copy Markdown
Contributor

Summary

  • Adds a renderer escape hatch for the workspace terminal: localStorage.setItem('openalice.terminal.renderer', 'dom') + reload forces the DOM renderer; unset keeps the WebGL default.
  • Factors a shared attachWebglRenderer loader used by both the workspace terminal and the demo replay: addon-construction failure and WebGL context loss now both degrade to the DOM renderer (the demo replay previously had no context-loss handling).
  • Background: external PR fix(ui): render workspace terminal with Canvas + CJK fonts #253 reported solid black boxes over styled CJK in the WebGL terminal. The black-box family of bugs lives in the GPU pipeline (texture upload / driver compositing — same xterm atlas as VS Code's terminal, cf. Broken CJK characters in integrated terminal with GPU acceleration microsoft/vscode#137047, #163936, #288682), is environment-specific, and never throws — so it can't be auto-detected, only escaped. We could not reproduce on macOS nor on Linux+Noto CJK with identical config, hence an escape hatch instead of fix(ui): render workspace terminal with Canvas + CJK fonts #253's blanket WebGL→Canvas swap.

Test plan

  • cd ui && npx tsc -b clean
  • Full suite from root: 97 files / 1732 tests pass, plus new renderer.spec.ts (flag short-circuits before addon construction; default constructs+loads; load-throw disposes and degrades)

Boundary touch

None — UI rendering only.

🤖 Generated with Claude Code

The WebGL renderer's glyph rasterization is plain Canvas2D (shared with
the DOM renderer), but the rasterized glyphs then ride a GPU pipeline
with a known family of environment-specific corruption bugs (black
boxes over CJK, garbled cells — same xterm atlas as VS Code's terminal,
see microsoft/vscode#137047/#163936/#288682). None of them throw, so
they can't be auto-detected; VS Code's answer is the gpuAcceleration
setting. Ours:

- `localStorage['openalice.terminal.renderer'] = 'dom'` forces the DOM
  renderer (unset/anything else keeps WebGL).
- Shared `attachWebglRenderer` loader: addon-throw and context-loss
  both degrade to the DOM renderer; the demo replay previously had no
  context-loss handling at all.

Investigated from external PR #253's black-box report — not
reproducible on macOS nor Linux+Noto CJK with identical config, so the
fix is an escape hatch rather than a blanket renderer swap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
openalice-demo Ready Ready Preview, Comment Jun 10, 2026 3:35am

Request Review

@luokerenx4 luokerenx4 merged commit 8bcda1d into master Jun 10, 2026
5 checks passed
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