summaryrefslogtreecommitdiff
path: root/core/Pick.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 04:51:32 -0300
committerGabriel Schneider <[email protected]>2026-11-25 04:57:31 -0300
commit01ce658c7b40997e24ce5045b0e07f7b9ae98e71 (patch)
tree84ae35642444bb5005ca8fa9da169e7f95ef1d49 /core/Pick.zig
parent3c4b2c99b1a969abad0a530fa99b70b2cb564af3 (diff)
downloadpardes-01ce658c7b40997e24ce5045b0e07f7b9ae98e71.tar.gz
pardes-01ce658c7b40997e24ce5045b0e07f7b9ae98e71.zip
colors, draw, Band: the walk UI's colour roles (UX DESIGN.md D4): text, dim, rule on each of a tag's four grounds (plain, focused, reading, reading focused) and on each one's cursor-row selection, key, match, hit, hit current, err/warn/question/hint, worked out once a theme with its chrome (ChromeTheme.roles, Roles.of; never a frame) and each held to its floor where it is drawn (text 4.5:1, dim 3.5 never under 3, rule 2:1, key and match 4.5:1 on every tag ground and selection, selection 1.4:1 off a dark tag and 1.25 off a light one with its text at 4.5, hit 1.25 and current 1.6 off the page with the body's ink at 4.5, a message's ink 4.5 on the tags and the page; where a theme's own colours leave no room, the most they allow: solarized's mid-grey tag, a tag whose text has no contrast to spare); the reading tint derived as D4 says (the theme's own where it stands 0.04 off the tag in OKLab, else the tag toward paper yellow by 0.04 and 0.02 lighter on a dark tag, darker on a light one, less or the other way where its text would drop under 7:1 or its own, further where the bytes cannot show the step): neonotte84's #262737 (0.029 off its tag, invisible) is #29271d now; and every painter of the new UI on them: the band's spines and step rules in the rule ink (they were the box's 11.5:1, the brightest thing in the band), `▶` and `•` in the key ink, a key bold in it, Help's chord (`SPC h t`, Row.chord) in it at the text's weight, a matched letter bold in the match ink on its row's own ground (it was the search ground, the selection's colour on neonotte84: on the cursor row the matches vanished), a dim row and a path's directory in the dim ink of their ground (the cursor row's selection's on it), never the faint attribute (fg 12.5:1 fell to 4.5 and a dimmed register value to 1.58); the head's dim spans in the dim ink, a key bold in the key ink, an error in the err role, the picker's act-row spines in the rule ink (TagState.Style.rule), its other sources' words, its `|` and the themes' hint dim, the levels', describe-key's and Rename's hints dim (they were at full label ink, louder than the content), the head's text in the text role (at rest the tag keeps its own ink: byte for byte); a walk's forward steps and a search word no place lights in the dim ink (they were the line numbers' ink, 1.57:1 on a reading tag); Messages.ink is the roles' (marks, end-of-line ghosts, progress); an LSP leaf in a pane no language server speaks for is dim and its doc step says `needs a language server` (POLISH 3; SPEC §4.2); UX's derived values reproduced (tools/roles.py: neonotte84's text, dim #70768f, rule #4c5063, key, match #f1a271, reading, hit #36282a, current #523831 within 2 a channel; acme's dim, rule, reading, hit, current; acme's key #555583 and match #8f4800 a step darker than UX's #5c5c8d and #974d00, which hold on its tag and #9eeeee: a reading pane's band's selection is pushed off #f3f0cc, 1.12:1, and they read on it too); TEST FIRST: Band.zig "a band is drawn in the theme's roles" (fails on the base painter at its first spine: the box's ink), draw.zig "a tag out of rest draws its keys bold in the key ink and its hint in the dim ink, never faint", colors.zig "every theme's walk UI roles meet their floors" (every bundled theme, dark and light, every floor; 497 floors missed by the first derivation, each class fixed by the rule above) and "neonotte84's and acme's roles are the ones UX derived"; Trail.zig's §6.7 session test now wants the forward step in the dim ink; core-test 1066/1236 (170 skipped)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/Pick.zig')
-rw-r--r--core/Pick.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/Pick.zig b/core/Pick.zig
index 3bab0970..6026f11b 100644
--- a/core/Pick.zig
+++ b/core/Pick.zig
@@ -589,7 +589,9 @@ pub fn head(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) !?TagState.Head {
if (pk.names.busy() or p.stream.busyFor(pk.id)) try text.appendSlice(arena, " ⋯");
// Themes have no acts and no other sources: no second row.
if (pk.source == .themes) {
+ const hint: u32 = @intCast(text.items.len);
try text.appendSlice(arena, " ⏎ wear it · esc");
+ try spans.append(arena, .{ .lo = hint, .hi = @intCast(text.items.len), .style = .dim });
for (cells[0..ncells]) |c| try spans.append(arena, .{ .lo = c[0], .hi = c[1], .style = .key });
return .{ .text = text.items, .spans = spans.items, .cells = @intCast(ncells), .caret = caret };
}
@@ -603,13 +605,15 @@ pub fn head(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) !?TagState.Head {
for (cells[0..ncells]) |c| {
const at = lead + File.displayWidth(p.settings.tab, text.items[0..c[0]]);
while (col < at) : (col += 1) try text.append(arena, ' ');
- try spans.append(arena, .{ .lo = @intCast(text.items.len), .hi = @intCast(text.items.len + "│".len), .style = .key });
+ try spans.append(arena, .{ .lo = @intCast(text.items.len), .hi = @intCast(text.items.len + "│".len), .style = .rule });
try text.appendSlice(arena, "│");
col += 1;
}
const nspines: u8 = @intCast(spans.items.len);
try text.appendSlice(arena, if (ncells == 0) "" else " ");
for (acts) |act| if (offered(pk, act)) try text.print(arena, "{s} ", .{act.word});
+ // The other sources' words, and the `|` before them, dim (UX D4).
+ const sources: u32 = @intCast(text.items.len);
try text.appendSlice(arena, "|");
var first = false;
inline for (comptime std.enums.values(Source)) |src| if (src != .list and src != .messages and src != .themes) {
@@ -619,6 +623,7 @@ pub fn head(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) !?TagState.Head {
try text.appendSlice(arena, words.get(src).word);
}
};
+ try spans.append(arena, .{ .lo = sources, .hi = @intCast(text.items.len), .style = .dim });
for (cells[0..ncells]) |c| try spans.append(arena, .{ .lo = c[0], .hi = c[1], .style = .key });
return .{ .text = text.items, .spans = spans.items, .cells = nspines, .caret = caret };
}