feat: powerline and block character rendering with visual tests#128
feat: powerline and block character rendering with visual tests#128slang25 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47fdaa020e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- Implement renderBlockChar() for U+2580-U+259F block elements as pixel-perfect rectangles - Implement renderPowerlineGlyph() for U+E0B0-U+E0BF glyphs as vector shapes - Update font metrics to use fontBoundingBox for accurate cell height - Add buildFontString() helper for proper font family quoting - Add cursor style support from buffer and cursorAccent color rendering - Add 15 visual regression tests covering text, colors, cursors, wide chars, and special glyphs - Include headless Puppeteer test runner for CI/CD integration - Add baseline PNG images for all tests passing Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Exit non-zero on startup failures in render test runner (P1) - Wait for browser-side runAllTests() completion before reading canvases (P2) - Use || instead of ?? for font metric fallbacks so 0 triggers fallback (P2) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix prettier formatting for render-test.html and correct import order in render-test.ts to satisfy biome lint rules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5c82921 to
4e0a84e
Compare
- Add renderBlockChar() for U+2580-U+259F (block elements) as filled rectangles, eliminating inter-character gaps in ASCII art/progress bars - Add renderPowerlineGlyph() for U+E0B0-U+E0B7 as canvas vector paths, ensuring glyphs span exactly the cell height regardless of font - Switch measureFont() to fontBoundingBox metrics so cell height accommodates the full font cap-height (required by powerline chars) - Merge DPR-aware rounding from PR coder#146 with fontBoundingBox: cells stay pixel-perfect at non-integer device pixel ratios - Pass cursor.style from IRenderable.getCursor() through to renderCursor() so callers can override the cursor shape - buildFontString() helper quotes font family names that contain spaces - Add demo/bin/render-test.ts and demo/render-test.html for visual regression testing (puppeteer auto-installed on demand) - Fix pre-existing biome lint issues in viewport/iris test files Co-authored-by: Stuart Lang <stuart.b.lang@gmail.com> Inspired-by: coder#128
- Add renderBlockChar() for U+2580-U+259F (block elements) as filled rectangles, eliminating inter-character gaps in ASCII art/progress bars - Add renderPowerlineGlyph() for U+E0B0-U+E0B7 as canvas vector paths, ensuring glyphs span exactly the cell height regardless of font - Switch measureFont() to fontBoundingBox metrics so cell height accommodates the full font cap-height (required by powerline chars) - Merge DPR-aware rounding from PR coder#146 with fontBoundingBox: cells stay pixel-perfect at non-integer device pixel ratios - Pass cursor.style from IRenderable.getCursor() through to renderCursor() so callers can override the cursor shape - buildFontString() helper quotes font family names that contain spaces - Add demo/bin/render-test.ts and demo/render-test.html for visual regression testing (puppeteer auto-installed on demand) - Fix pre-existing biome lint issues in viewport/iris test files Inspired-by: coder#128 Co-authored-by: Stuart Lang <stuart.b.lang@gmail.com>
|
Hi @slang25! 👋 Your work on this PR inspired a commit in my fork diegosouzapw/ghostty-web. I'm working on OmniRoute, a project that provides free access to LLM models, and I'm planning to use ghostty-web as the terminal component there. Your work is part of what makes that possible. 🙏 Feel free to check it out — contributions and feedback are very welcome! |
Summary
Port of powerline and block character rendering from fork, with a complete visual regression test suite.
All visual tests pass and baseline images are included for regression testing.