summaryrefslogtreecommitdiff
path: root/core/Messages.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 10:52:34 -0300
committerGabriel Schneider <[email protected]>2026-11-25 10:52:34 -0300
commit1479c4ef253a0a05b1a64e368334ce07f9922244 (patch)
tree564500005b81235b181ec5ad89733f67d9985e78 /core/Messages.zig
parent854f2d4851044dc726f062ea2055c2f946f3a812 (diff)
downloadpardes-1479c4ef253a0a05b1a64e368334ce07f9922244.tar.gz
pardes-1479c4ef253a0a05b1a64e368334ce07f9922244.zip
Band, Messages: a doc step the band has no room for leaves it for the notice row: its first row and the first line of its text (`w Wrap: …`), in place of the path (UX D5's give-way 2, DESIGN.md E5.10; SPEC §3.6 "the doc step moves to the notice row"); TEST FIRST: Band.zig "a doc the band has no room for leaves it for the notice row: its first row and the first line of its text, in place of the path" (Help for SPC l at 44 columns: on the base the doc was dropped from the band and said nowhere; the test did not compile there: Band had no `left`); THE CHANGE: Band.place keeps the doc step it drops (`Band.left`); Band.docLeft works the live view's band out from the state (the host's, as the frame's is, in a room on the stack: `Pane.prefix_room`) and says `first row: first line of the text`; Messages.noticeRow says it where the path would be, after a picker's sentence and before any message (the band is the state the keyboard is in, as the sentence is), cut from the right with `…` like a message (E5.4); noticeRow takes the session mutable for it (Band.of's own signature; its callers, draw and the mouse, have one); at rest (no host) docLeft answers at once, so a frame at rest costs nothing more; READING (where D5 is not exact): "its first line" read as the doc step's first row (`k Label`) and the first line of its text, as TagState.lastUsed says a rolled level's leaf; a group's doc says its first child; no golden moved (none has a band too narrow for its doc); core-test 1090/1261 (171 skipped), process-test 0 of 147 failed (3 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.zig16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/Messages.zig b/core/Messages.zig
index 725f5a99..b89b9676 100644
--- a/core/Messages.zig
+++ b/core/Messages.zig
@@ -689,7 +689,7 @@ pub const Row = struct {
/// pitch (Layer.capacity) is cut to it.
pub const notice_row_cap = 1024;
-pub fn noticeRow(p: *const Pardes, width: usize, out: *[notice_row_cap]u8) Row {
+pub fn noticeRow(p: *Pardes, width: usize, out: *[notice_row_cap]u8) Row {
const m = &p.messages;
const tab = p.settings.tab;
// A rolled level's last leaf, while the level shows: what it does, the
@@ -708,10 +708,16 @@ pub fn noticeRow(p: *const Pardes, width: usize, out: *[notice_row_cap]u8) Row {
live += 1;
if (s.kind == .question) questions += 1;
}
- // While a picker previews, its sentence (UX D7), before any message.
+ // While a picker previews, its sentence (UX D7), before any message;
+ // while a band shows with no room for its doc, the doc's first line
+ // (UX D5's give-way).
const said = pardes.Pick.sentence(p, &w);
- const lead = if (said == null) m.headline() else null;
- if (said != null) {} else if (lead) |s| {
+ var doc_buf: [notice_row_cap]u8 = undefined;
+ const doc = if (said == null) pardes.Band.docLeft(p, &doc_buf) else null;
+ const lead = if (said == null and doc == null) m.headline() else null;
+ if (said != null) {} else if (doc) |line| {
+ w.writeAll(line) catch {};
+ } else if (lead) |s| {
w.print("{s} ", .{s.kind.glyph()}) catch {};
// Its cause first, unless its words name it already.
const words = s.words();
@@ -744,7 +750,7 @@ pub fn noticeRow(p: *const Pardes, width: usize, out: *[notice_row_cap]u8) Row {
const room = width -| (if (tail_w > 0) tail_w + 2 else 0);
var cut = left_end;
if (panes.File.displayWidth(tab, out[0..cut]) > room) {
- if (said == null and lead == null) {
+ if (said == null and doc == null and lead == null) {
var from: usize = 0;
while (from < left_end and panes.File.displayWidth(tab, out[from..left_end]) > room -| 1) {
from += 1;