-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Description
When a diff line contains an emoji character (e.g. 🟢), the SDL_ttf rendering pipeline uses the system emoji font (e.g. Apple Color Emoji on macOS) to shape and render the emoji. That font has significantly larger glyph metrics than the monospace font used for diff text, so the surface produced by TTF_RenderText_Blended is much taller than expected. The segment texture is then drawn at its natural height without being clamped to row_height, causing the emoji to overflow its row and obscure adjacent lines. The same TTF_RenderText_Blended pattern is used in story_overlay.zig, reader_overlay.zig, worktree_overlay.zig, and other overlays that render user-supplied text, so the issue is likely reproducible there as well.
Steps to Reproduce
Starting state: Architect is running with a session open. The diff overlay is accessible (e.g. via keyboard shortcut or agent notification).
- In the terminal session, produce or paste a diff that contains an emoji on one of the added/removed/context lines (e.g. a line like
+ State: 🟢 good progress). - Open the diff overlay.
Reproducibility: Always (any diff containing emoji).
Expected Behavior
Emoji and other wide/tall glyphs are rendered at a size consistent with the diff row height — clipped or scaled to fit within row_height — so surrounding text lines remain readable and unobscured.
Actual Behavior
The emoji glyph is rendered at the emoji font's native size (far larger than the monospace font metrics), overflowing its row and visually obscuring adjacent diff lines.
Suspected Area
src/ui/components/diff_overlay.zig—makeTextTexture/appendSegmentTexture/ the segment rendering block (~line 2033):segment.his the full texture height with no row-height clamping.- Potentially the same issue in
story_overlay.zigandreader_overlay.zigsince they use the sameTTF_RenderText_Blendedpattern with user-supplied text content.
Acceptance Criteria
- Emoji and other oversized glyphs in diff lines are displayed at a height consistent with
row_height(clipped or scaled) - Adjacent diff lines are not obscured by emoji from a neighboring row
- The fix is verified in
story_overlayandreader_overlayfor the same scenario, or separate issues are filed if they are affected - The fix does not break existing tests;
zig build testandjust lintpass