feat: powerline and block character rendering with visual tests#4
Merged
feat: powerline and block character rendering with visual tests#4
Conversation
- 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>
…path guards - Cache all 4 font string variants (plain/bold/italic/boldItalic) at construction and on font changes instead of recomputing per cell via split/map/join - Add codepoint range guards before renderBlockChar/renderPowerlineGlyph so normal ASCII cells skip both function calls entirely - Extract drawHorizontalLine and strokeWithFillColor helpers to remove 3× and 4× duplicated canvas stroke sequences - Move INVERSE fg color extraction inside the else branch (skip when colorOverride or isSelected is set) - Fix double `|| 32` codepoint fallback (was computed independently for char and codepoint) - Remove dead palette field (written but never read) - Remove dangling orphaned JSDoc comment - Hoist render-test.ts contentTypes map to module scope
- Keep fontStrings cache, remove palette rebuild in constructor and setTheme - Remove _theme/_theme getter (renamed to theme in this branch) - Drop palette field brought back by auto-merge
- Use ?? instead of || for fontBoundingBox fallback (avoids 0-value edge case)
- Remove IIFE wrapper for linkRangeChanged comparison
- Capture fillColor at assignment instead of reading back from ctx.fillStyle
- Extract LINK_HOVER_COLOR constant (was hardcoded '#4A90E2' twice)
- Tighten powerline range guard to <= 0xe0b7 (matches actual handled range)
- Remove ctx param from strokeWithFillColor (always this.ctx)
- Merge hard/soft divider case pairs in renderPowerlineGlyph (shared path, branch on fill vs stroke)
- Remove dead Puppeteer auto-install catch block (puppeteer is in devDependencies)
- Simplify base64 data URL strip to split(',')[1]
- Add early-exit in calculateDiffPercent once threshold exceeded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Port of coder/ghostty-web#128 with additional simplifications:
drawHorizontalLineandstrokeWithFillColorhelpers (removed 3× and 4× duplicated canvas sequences)elsebranch (skip when colorOverride/isSelected)palettefield and dangling orphaned JSDocTest plan
bun test:renderbun test:render:updatebunx tsc --noEmitbunx @biomejs/biome check lib/ demo/