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-diff-reflow' into ui/tui-hover-affordance

Rach Pradhand2737e5d3901
diff --cc TUI/scrollback.zig
index 83aa3570,aa926a73..bd94253a
--- a/TUI/scrollback.zig
+++ b/TUI/scrollback.zig
@@@ -4,7 -4,7 +4,8 @@@
const std = @import("std");
const app = @import("app.zig");
+const glyphs = @import("glyphs.zig");
+ const diff_mod = @import("diff.zig");
const theme_mod = @import("theme.zig");
const Model = app.Model;
@@@ -366,11 -366,13 +367,13 @@@ fn toolVisual
}
fn toolCard(a: std.mem.Allocator, th: theme_mod.Theme, call: app.Entry, outcome: app.Entry, selected: bool, width: usize) ![]const u8 {
- const sel: []const u8 = if (selected) "› " else " ";
+ const sel = glyphs.frame(&glyphs.row_mark, @intFromBool(!selected));
const title = try toolTitle(a, call, outcome);
const preview = toolPreview(outcome);
- const head = try std.fmt.allocPrint(a, "{s}{s}◆{s}{s} {s}", .{ sel, if (selected) th.accent else th.muted, theme_mod.reset, th.text, title });
+ const head = try std.fmt.allocPrint(a, "{s}{s}{s}{s}{s} {s}", .{ sel, if (selected) th.accent else th.muted, glyphs.tool, theme_mod.reset, th.text, title });
if (preview == null) return theme_mod.wrapToWidth(a, head, width);
+ // A patch-shaped result is banded, not quoted: diff.zig owns its wrap.
+ if (diff_mod.looksLikeUnified(preview.?)) return std.fmt.allocPrint(a, "{s}\n{s}", .{ try theme_mod.wrapToWidth(a, head, width), try diff_mod.renderThemed(a, preview.?, th, width) });
const body = try std.fmt.allocPrint(a, "{s}{s}│ {s}{s}", .{ sel, th.muted, preview.?, theme_mod.reset });
const joined = try std.fmt.allocPrint(a, "{s}\n{s}", .{ try theme_mod.wrapToWidth(a, head, width), try theme_mod.wrapToWidth(a, body, width) });
return joined;