summaryrefslogtreecommitdiff
path: root/core/Messages.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 05:49:06 -0300
committerGabriel Schneider <[email protected]>2026-11-25 05:49:58 -0300
commite563ef0d896fc66c3e88c274b25f09bb75f80fea (patch)
tree06b2ebf3c2879937c41d7a24bb174a0b691a49a4 /core/Messages.zig
parentffb06926121d84228c46734579ff47379b126a7b (diff)
downloadpardes-e563ef0d896fc66c3e88c274b25f09bb75f80fea.tar.gz
pardes-e563ef0d896fc66c3e88c274b25f09bb75f80fea.zip
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)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/Messages.zig')
-rw-r--r--core/Messages.zig12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/Messages.zig b/core/Messages.zig
index 41344d1f..6231e3d1 100644
--- a/core/Messages.zig
+++ b/core/Messages.zig
@@ -679,6 +679,10 @@ pub const Row = struct {
text: []const u8 = "",
/// The message the left says, when it says one.
lead: ?*const Said = null,
+ /// The left in the dim ink (a picker's sentence, UX D7), but for the
+ /// bytes `word` (an address, in the text's).
+ quiet_left: bool = false,
+ word: [2]usize = .{ 0, 0 },
};
/// Room for the notice row's line: the widest window's at the tagline's
@@ -704,8 +708,10 @@ pub fn noticeRow(p: *const Pardes, width: usize, out: *[notice_row_cap]u8) Row {
live += 1;
if (s.kind == .question) questions += 1;
}
- const lead = m.headline();
- if (lead) |s| {
+ // While a picker previews, its sentence (UX D7), before any message.
+ const said = pardes.Pick.sentence(p, &w);
+ const lead = if (said == null) m.headline() else null;
+ if (said != null) {} else if (lead) |s| {
w.print("{s} ", .{s.kind.glyph()}) catch {};
// Its cause first, unless its words name it already.
const words = s.words();
@@ -743,7 +749,7 @@ pub fn noticeRow(p: *const Pardes, width: usize, out: *[notice_row_cap]u8) Row {
for (0..gap) |_| w.writeByte(' ') catch {};
const right_at = w.end;
w.writeAll(tail) catch {};
- return .{ .left = cut, .right = right_at, .text = w.buffered(), .lead = lead };
+ return .{ .left = cut, .right = right_at, .text = w.buffered(), .lead = lead, .quiet_left = said != null, .word = said orelse .{ 0, 0 } };
}
/// What notice band `i` says. The grid pass and the band layers both