fca9546777e4
color refinements in output.zig + search.zig — bold-white gen in status row, cyan version numbers and cyan attr value in search widget+plain, dim-bracket/pink-letter key hints, dim log timestamps, cyan actionable suggestion lines — build+tests green
- time
- 2026-06-05 02:13 UTC · 4 months ago
- machine
- koh2
- agent
- claude-opus-4-8
- session
- nina finishing brief
- parent
- 85cb9c4a3870
↓ nina-fca95467.tar.gzatlas at this save
files changed2 files
src/output.zig+8 −7src/search.zig+15 −5src/output.zig+8 −7
@@ -110,7 +110,8 @@110110 pub fn printError(message: []const u8, detail: ?[]const u8, suggestion: ?[]const u8) void {111111 p("{s}{s}\n", .{ if (color_enabled) ERR_C else ERR_P, message });112112 if (detail) |d| p(" {s}{s}{s}\n", .{ c(DIM), d, c(RESET) });113- if (suggestion) |s| p(" {s}-> {s}{s}\n", .{ c(DIM), s, c(RESET) });113+ // Actionable suggestion in cyan — the next step should catch the eye.114+ if (suggestion) |s| p(" {s}-> {s}{s}\n", .{ c(CYAN), s, c(RESET) });114115 }115116 116117 // Like printError, but for genuine system failures (network/ssh/search). The sad@@ -119,7 +120,7 @@119120 pub fn printSystemError(message: []const u8, detail: ?[]const u8, suggestion: ?[]const u8) void {120121 p("{s}{s}{s}\n", .{ KAO_SAD, if (color_enabled) ERR_C else ERR_P, message });121122 if (detail) |d| p(" {s}{s}{s}\n", .{ c(DIM), d, c(RESET) });122- if (suggestion) |s| p(" {s}-> {s}{s}\n", .{ c(DIM), s, c(RESET) });123+ if (suggestion) |s| p(" {s}-> {s}{s}\n", .{ c(CYAN), s, c(RESET) });123124 }124125 125126 pub fn printWarning(message: []const u8) void {@@ -254,7 +255,7 @@254255 255256 pub fn statusRow(machine: []const u8, gen: u32, time: []const u8, size: []const u8, ok: bool) void {256257 if (ok) {257- p(" {s}{s} gen {d} {s} {s}{s}\n", .{ c(DIM), machine, gen, time, size, c(RESET) });258+ p(" {s}{s}{s} gen {s}{d}{s} {s}{s} {s}{s}\n", .{ c(DIM), machine, c(RESET), c(BOLD), gen, c(RESET), c(DIM), time, size, c(RESET) });258259 } else {259260 p(" {s}{s} {s}unreachable{s}\n", .{ c(RED), machine, "", c(RESET) });260261 }@@ -331,7 +332,7 @@331332 }332333 333334 pub fn logRow(date: []const u8, time: []const u8, action: []const u8, detail: []const u8) void {334- p(" {s} {s} {s:<12} {s}\n", .{ date, time, action, detail });335+ p(" {s}{s} {s}{s} {s:<12} {s}\n", .{ c(DIM), date, time, c(RESET), action, detail });335336 }336337 337338 // --- Edit ---@@ -437,7 +438,7 @@437438 p("{s}store\n\n", .{hdr()});438439 p(" {s:<16} {s}\n", .{ "total", info.total_size });439440 p(" {s:<16} {d} paths\n", .{ "live", info.live_paths });440- p(" {s:<16} {s}{d} paths{s} run nina clean\n", .{ "reclaimable", c(DIM), info.reclaimable_paths, c(RESET) });441+ p(" {s:<16} {s}{d} paths{s} {s}run nina clean{s}\n", .{ "reclaimable", c(DIM), info.reclaimable_paths, c(RESET), c(CYAN), c(RESET) });441442 }442443 443444 // --- Channel ---@@ -808,9 +809,9 @@808809 809810 pub fn searchPlainPackage(pname: []const u8, pkg_version: []const u8, description: []const u8, unfree: bool) void {810811 if (unfree) {811- p(" {s} {s}{s}{s} {s}unfree{s} {s}\n", .{ pname, c(DIM), pkg_version, c(RESET), c(YELLOW), c(RESET), description });812+ p(" {s} {s}{s}{s} {s}unfree{s} {s}\n", .{ pname, c(CYAN), pkg_version, c(RESET), c(YELLOW), c(RESET), description });812813 } else {813- p(" {s} {s}{s}{s} {s}\n", .{ pname, c(DIM), pkg_version, c(RESET), description });814+ p(" {s} {s}{s}{s} {s}\n", .{ pname, c(CYAN), pkg_version, c(RESET), description });814815 }815816 }816817 src/search.zig+15 −5
@@ -218,6 +218,13 @@218218 return null;219219 }220220 221+// A key hint with dim brackets and a pink letter: dim '[', pink label, dim ']'.222+// Comptime-built so it's a plain string literal — the widget always renders raw223+// ANSI (it only runs on a real tty).224+fn keyHint(comptime label: []const u8) []const u8 {225+ return output.C_DIM ++ "[" ++ output.C_RESET ++ output.C_PINK ++ label ++ output.C_RESET ++ output.C_DIM ++ "]" ++ output.C_RESET;226+}227+221228 fn renderWidget(query: []const u8, packages: []types.NixPackage, opts: []api.NixOption, selection: usize, mode: Mode) void {222229 const count = resultCount(packages, opts, mode);223230 const CLR = output.C_CLEAR_EOL;@@ -225,6 +232,7 @@225232 const PKN = output.C_PINK;226233 const BLD = output.C_BOLD;227234 const DIM = output.C_DIM;235+ const CYN = output.C_CYAN;228236 229237 // Line 1: header230238 output.raw(CLR);@@ -250,7 +258,7 @@250258 const marker = if (selected) PKN ++ "> " ++ RST else " ";251259 const name_pre = if (selected) PKN ++ BLD else "";252260 const name_suf = if (selected) RST else "";253- output.p(" {s}{s}{s}{s} {s}{s}{s} {s}\n", .{ marker, name_pre, pkg.pname, name_suf, DIM, pkg.version, RST, pkg.description });261+ output.p(" {s}{s}{s}{s} {s}{s}{s} {s}\n", .{ marker, name_pre, pkg.pname, name_suf, CYN, pkg.version, RST, pkg.description });254262 },255263 .options => {256264 const opt = opts[idx];@@ -270,12 +278,12 @@270278 if (count > 0 and mode == .packages) {271279 const pkg = packages[selection];272280 output.raw(CLR);273- output.p(" {s}{s}{s}{s} {s}{s}{s}\n", .{ PKN, BLD, pkg.pname, RST, DIM, pkg.version, RST });281+ output.p(" {s}{s}{s}{s} {s}{s}{s}\n", .{ PKN, BLD, pkg.pname, RST, CYN, pkg.version, RST });274282 output.raw(CLR);275283 output.p(" {s}\n", .{pkg.description});276284 output.raw(CLR ++ "\n");277285 output.raw(CLR);278- output.p(" {s}attr {s}{s}\n", .{ DIM, pkg.attr, RST });286+ output.p(" {s}attr{s} {s}{s}{s}\n", .{ DIM, RST, CYN, pkg.attr, RST });279287 } else if (count > 0 and mode == .options) {280288 const opt = opts[selection];281289 output.raw(CLR);@@ -297,9 +305,11 @@297305 // Lines 14-17: controls + padding to reach WIDGET_LINES298306 output.raw(CLR);299307 if (mode == .packages) {300- output.p(" {s}[i] profile [s] system [t] try [c] copy [up/down] nav [esc] exit{s}\n", .{ DIM, RST });308+ output.p(" {s} profile {s} system {s} try {s} copy {s}[up/down]{s} nav {s} exit\n", .{309+ keyHint("i"), keyHint("s"), keyHint("t"), keyHint("c"), DIM, RST, keyHint("esc"),310+ });301311 } else {302- output.p(" {s}[i] insert [up/down] nav [esc] exit{s}\n", .{ DIM, RST });312+ output.p(" {s} insert {s}[up/down]{s} nav {s} exit\n", .{ keyHint("i"), DIM, RST, keyHint("esc") });303313 }304314 // Padding to reach WIDGET_LINES (18)305315 var pad: usize = 14;