From e563ef0d896fc66c3e88c274b25f09bb75f80fea Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 25 Nov 2026 05:49:06 -0300 Subject: Pick, body_layer, look, Messages, draw, colors: a picker's preview legible as one (UX DESIGN.md D7; the user missed it: S's 04 showed a preview from body line 1 with no mark where a hit lands and a tag naming the file as the pane's own): its landing line, the body line the cursor row lands on in the landing pane while that pane shows the row's file (Pick.landingLine), on the hit ground across the body's width with `▸` in the key ink in the gutter's cell after its number (where a prompt's current place has it), the place its row points at (a Grep's match at the row's column) on the current hit's ground over the places lit; placed a third of the way down the body (look.focusPaneLine's `.third`: ⌈rows/3⌉ rows of context above, clamped at the top, a text that fits shown whole), where it was centred; a Find row lands on line 1 and that is marked (its Enter lands there); the notice row's left, while a picker previews, says `⏎ lands in @pN's reader · its text is the preview · S-⏎ a new pane` (`⏎ lands here · …` in the pane itself) in the dim ink with the owner's address in the text's (Pick.sentence, Messages.Row.quiet_left and word), before any message; the notice row's dim words in the dim ink of the tagline's ground (colors.Roles.notice, 3:1 at least; it was the tagline's ink half mixed to its ground); a preview whose next file is not read yet keeps the previous one (the read is synchronous: the body is never blank) and a row with no file leaves the body; TEST FIRST: Pick.zig "a picker's preview is legible as one" (on the parent the landing line has no ground, line 40 sits mid-body and the notice row says the path): line 40 of an 80-line file at ⌈rows/3⌉, its row on the hit ground and the one above not, `▸` in the key ink, the sentence and its address, the row its own again at rest; colors.zig's floors test holds the notice row's inks too (fromTheme's comptime quota raised for them); core-test 1069/1239 (170 skipped) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE --- core/draw.zig | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'core/draw.zig') diff --git a/core/draw.zig b/core/draw.zig index 1e53d1d0..16dfde5e 100644 --- a/core/draw.zig +++ b/core/draw.zig @@ -640,12 +640,21 @@ fn paintNoticeRow(p: *Pardes, s: *Surface) !void { const layer = &s.tag_layers[pardes.NOTICE_ROW_LAYER]; try renderHeaderLayer(p, layer, .notice_row, 0, viewport, row.text, 0, chrome.tagline_bg, chrome.tagline_fg); if (layer.rows == 0) return; - const dim: Color = .{ .rgb = colors.mix(chrome.tagline_fg, chrome.tagline_bg) }; + // The dim ink of the notice row's ground (colors.Roles: 3:1 at least). + const dim: Color = .{ .rgb = chrome.roles.notice.dim }; const ink: Color = .{ .rgb = chrome.tagline_fg }; const cells = layer.cells[0..layer.cols]; const tab = p.settings.tab; const left = @min(cells.len, panes.File.displayWidth(tab, row.text[0..row.left])); const right = @min(cells.len, panes.File.displayWidth(tab, row.text[0..row.right])); + // A picker's sentence: dim, its address in the text's ink. + if (row.quiet_left) { + const lo = panes.File.displayWidth(tab, row.text[0..@min(row.word[0], row.left)]); + const hi = panes.File.displayWidth(tab, row.text[0..@min(row.word[1], row.left)]); + for (cells[0..left], 0..) |*cell, x| if ((x < lo or x >= hi) and std.meta.eql(cell.style.fg, ink)) { + cell.style.fg = dim; + }; + } if (row.lead) |lead| { if (lead.kind == .@"error" or lead.kind == .warn) if (cells.len > 0 and std.meta.eql(cells[0].style.fg, ink)) { cells[0].style.fg = .{ .rgb = if (lead.kind == .@"error") chrome.diagnostic_error else chrome.diagnostic_warning }; -- cgit v1.3