From f26cf0be705280ff28ca69aaef6cc64e1466ed4e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 24 Nov 2026 18:52:44 -0300 Subject: messages: one session-wide list of live messages replaces each pane's stack of chips (pick-ui SPEC §10.1, walk UI line C item 1): Messages.Said is a kind (echo, notice, warn, error, question, progress), its cause first as a word a Look understands (a file's path, @pN and its command), its text, the places it names and the lines that explain it, the pane it is about, the question it asks, ×n and the core's clock, in a fixed list of 16 (Messages.live); a new message retires every echo and notice, a new error the error before it, the same message right after itself is counted, progress from the same cause runs in place and is never the notice row's; an echo or a notice dims after MessageLinger (now 4000 ms, a warning twice as long: test configs' MessageLinger 0 keep their meaning, nothing dims and nothing wakes), and the core sleeps to that dim (Messages.dimDue in nextWake) instead of a frame-counted linger; no key or click dismisses a message any more: Esc in normal mode takes the warnings and errors first, then goes back as before; every call site says what it said, mapped by its entry: setMessage a notice, setStatus progress, reportError and reportFailure an error, a builtin's announcement an echo (exec.zig), the sent-to-a-REPL arrow an echo; the log ring stays the history and 9P /log (each line now with its kind); gone: Pane.msg, msg_older and their lives, slots, announcement, status and sent flags, dismissMessage, advanceMessages, holdMessages, messageWake, expireUnattended and the detached shells' 100 ms message waits; until the notice row (item 2) a pane's one message chip shows the newest message said of it (Messages.saidBy); an Upgrade's outcome is said once and is every view's; tests: Messages.zig 'an echo or a notice retires those before it, an error the error before it, a repeat counts and progress runs in place', 'Msg says a notice by hand ... and the next message retires it', 'an idle core wants no wake, and a message wakes it once, when it dims', runtime/upgrade.zig 'an upgrade's outcome stays on every view's notice row until something else is said'; core-test 862 pass 162 skip, pane-test and shell-test pass; behaviour-test: the pdf addon's script golden and one PDF Restore test move with the chip over a PDF's body, which item 2 takes away MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- core/exec.zig | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'core/exec.zig') diff --git a/core/exec.zig b/core/exec.zig index 2528805f..dbea2b2f 100644 --- a/core/exec.zig +++ b/core/exec.zig @@ -617,8 +617,7 @@ pub fn sendToRepl(p: *Pardes, from: usize, to: usize, text: []const u8) void { p.setMessage(.at(from), warn.print("Repl: {s} takes no bracketed paste; a blank line in a block ends it", .{id})); } var said: pardes.Kind.Buf(64) = .{}; - p.setMessage(.at(from), said.print("\u{2192} {s}", .{id})); - src.msg_sent = true; + pardes.Messages.say(p, .echo, from, said.print("\u{2192} {s}", .{id})); var rec: [96]u8 = undefined; pardes.ctlfs.events.notePath(p, "send", std.fmt.bufPrint(&rec, "{d} {d} {s}", .{ src.serial, dst.serial, id }) catch return); } @@ -974,15 +973,14 @@ pub fn runBuiltinFrom(p: *Pardes, b: Builtin, id: usize, txt: []const u8, arg: ? // No pane at all (the window Delcol emptied): a word runs all the same, // with a stand-in that is no pane (New, Newcol, Exit are what make sense). const pane = p.panes[id] orelse (if (builtins.registry.scope(b) == .session or panes.anyPane(p) == null) panes.standIn(p) orelse return else return); - // A builtin says its own name before it runs, so a tagline click is - // legible even when what it did is invisible. Whatever the builtin - // then says for itself replaces the announcement. It is the message - // row's only, never /log's: a msg record is something said. + // A builtin says its own name before it runs, an echo, so a tagline + // click is legible even when what it did is invisible. Whatever the + // builtin then says for itself retires it. It is the message row's + // only, never /log's: a msg record is something said. if (p.announce and p.settings.verbose and builtins.registry.announces(b)) { p.fs.unlogged = true; - p.setMessage(.at(id), @tagName(b)); + pardes.Messages.say(p, .echo, id, @tagName(b)); p.fs.unlogged = false; - pane.msg_announcement = true; } // A word for one kind of pane, on another: refused with why, not a // silent nothing (Palette on a file, Filter on a PDF). -- cgit v1.3