Skip to content

fix: matrix background gaps and bleed on landing page#25

Open
cjroth wants to merge 1 commit intomainfrom
fix/matrix-background-clearrects
Open

fix: matrix background gaps and bleed on landing page#25
cjroth wants to merge 1 commit intomainfrom
fix/matrix-background-clearrects

Conversation

@cjroth
Copy link
Copy Markdown
Member

@cjroth cjroth commented Mar 18, 2026

Summary

  • Unified clearRects for matrix background on both CLI and web — no platform-specific branching
  • Fixed logoHeight calculations to match actual component heights (was off by 2 on CLI)
  • Per-box interior-only clearRects so matrix shows in gaps between/around bordered boxes
  • Added shouldFill={false} to CLI Logo outer box and "Press o" elements
  • Added demo/demo:dev scripts to root package.json

Context

On CLI, the Zig renderer's fillRect with transparent bg preserves existing characters (alpha-blending path), so matrix chars bleed through bordered boxes. On web, transparent fills overwrite chars with spaces. The clearRect system prevents matrix from rendering behind boxes on both platforms without requiring platform checks.

Test plan

  • bun demo:dev landing — verify matrix shows in gaps between boxes and doesn't bleed into them (CLI)
  • bun dev — verify same on web, including when boxes wrap on narrow viewports
  • Verify "Press o" mode shows matrix behind the prompt text
  • Verify chat area has no matrix bleed when inline

- Replace platform-branched clearRect/clearRects with unified per-box
  clearRects that work on both CLI and web (no isBrowser checks)
- Fix logoHeight calculations (4/15/9) to match actual Logo component
  heights on both platforms
- Use interior-only clearRects for bordered boxes so matrix shows
  through border cells (border chars overwrite matrix directly)
- Add chat area clearRect only when chat fits inline
- Simplify MatrixBackground to single clearRects prop
- Add shouldFill={false} to CLI Logo outer box and "Press o" elements
- Add demo/demo:dev scripts to root package.json
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