Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Merge branch 'fix/tui-chrome-width' into ui/tui-hover-affordance

Rach Pradhan0477c42a86bc
diff --cc TUI/chrome.zig
index 777dd153,2229b790..47a40b4e
--- a/TUI/chrome.zig
+++ b/TUI/chrome.zig
@@@ -162,11 -167,8 +167,11 @@@ pub fn slashMenu(self: *const Model, a
var i: usize = first;
while (i < first + show) : (i += 1) {
const it = catalog.items[idx[i]];
- const mark: []const u8 = if (i == sel) "› " else " ";
+ const mark = glyphs.frame(&glyphs.row_mark, @intFromBool(i != sel));
- const line = try std.fmt.allocPrint(a, "{s}{s} {s}", .{ mark, it.name, it.desc });
+ // One menu entry is one ROW: a click maps a screen row straight back to
+ // an item, so a long description is CUT, never wrapped — wrapping
+ // would slide every entry below it off its own row.
+ const line = theme_mod.takeCols(try std.fmt.allocPrint(a, "{s}{s} {s}", .{ mark, it.name, it.desc }), width);
try out.appendSlice(if (i == sel) try theme_mod.paint(a, th.accent, line) else try theme_mod.paint(a, th.muted, line));
try out.append('\n');
}
@@@ -189,9 -192,8 +194,9 @@@ fn listOverlay(self: *const Model, a: s
var i: usize = 0;
while (i < show) : (i += 1) {
const it = catalog.items[idx[i]];
- const mark: []const u8 = if (i == sel) "› " else " ";
+ const mark = glyphs.frame(&glyphs.row_mark, @intFromBool(i != sel));
- const line = try std.fmt.allocPrint(a, "{s}{s} {s}", .{ mark, it.name, it.desc });
+ // Same rule as the inline menu: one entry, one row, cut to fit.
+ const line = theme_mod.takeCols(try std.fmt.allocPrint(a, "{s}{s} {s}", .{ mark, it.name, it.desc }), width);
try out.appendSlice(if (i == sel) try theme_mod.paint(a, th.accent, line) else try theme_mod.paint(a, th.muted, line));
try out.append('\n');
}
diff --cc TUI/root.zig
index 8df2ad7f,9ba63518..55a10d8f
--- a/TUI/root.zig
+++ b/TUI/root.zig
@@@ -59,9 -59,9 +59,10 @@@ test
_ = @import("turn.zig");
_ = @import("bgop.zig");
_ = @import("welcome.zig");
+ _ = @import("glyphs.zig");
_ = @import("scrollback.zig");
_ = @import("selection.zig");
+ _ = @import("selection_tests.zig");
_ = @import("chrome.zig");
_ = @import("models.zig");
_ = @import("markdown.zig");
diff --cc scripts/eval-tier1.sh
index b6dbbc8d,884777f5..d7cb2301
--- a/scripts/eval-tier1.sh
+++ b/scripts/eval-tier1.sh
@@@ -243,27 -242,13 +243,34 @@@ if wanted tuiguard; the
if python3 scripts/test-tui-typed-events.py zig-out/bin/graff; then :; else
record_fail tuiguard
fi
+ # The frame painter may never show anything but the current frame. Storms
+ # the window size, fills the screen with glyphs terminals measure
+ # differently from us, then reads the SCREEN back and compares it cell for
+ # cell against a forced full repaint of the same frame.
+ if python3 scripts/test-tui-painter.py zig-out/bin/graff; then :; else
+ record_fail tuiguard
+ fi
+ # Same invariants, read off a VIRTUAL SCREEN instead of raw bytes
+ # (scripts/ptyharness.py): the VT interpreter's own selftest, the ported
+ # mode-balance check, and out-of-band screen corruption fed straight to the
+ # tty.
+ if python3 scripts/test-tui-screenstate.py zig-out/bin/graff; then :; else
+ record_fail tuiguard
+ fi
+ # The viewport must not jump when the terminal changes width: drives
+ # TIOCSWINSZ across five widths mid-scroll and reads the screen back. With
+ # the logical scroll anchor removed the marker leaves the screen on the
+ # FIRST width change, so this is a real gate, not a smoke test.
+ if python3 scripts/test-tui-resize-anchor.py zig-out/bin/graff; then :; else
+ record_fail tuiguard
+ fi
+ # grok-build's one-column rule for ANIMATED chrome: watches the live blink
+ # on a background op's pending row and fails if the label beside it moves a
+ # column, or if a frame is not East-Asian-Narrow. TUI/glyphs.zig holds the
+ # same law for the frame sets; this is the pixels.
+ if python3 scripts/test-tui-chrome-width.py zig-out/bin/graff; then :; else
+ record_fail tuiguard
+ fi
fi
fi