diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 18:52:44 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 19:00:51 -0300 |
| commit | f26cf0be705280ff28ca69aaef6cc64e1466ed4e (patch) | |
| tree | 73fa0cb9bb356644c516c38fd6e72724c4c5e234 /core/builtins.zig | |
| parent | e9f3712ce17f9813ecb15dbf76d46778a49c747d (diff) | |
| download | pardes-f26cf0be705280ff28ca69aaef6cc64e1466ed4e.tar.gz pardes-f26cf0be705280ff28ca69aaef6cc64e1466ed4e.zip | |
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
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/builtins.zig')
| -rw-r--r-- | core/builtins.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/builtins.zig b/core/builtins.zig index a236b0d6..0c643a18 100644 --- a/core/builtins.zig +++ b/core/builtins.zig @@ -1248,7 +1248,7 @@ pub const Del = struct { var rec: [32]u8 = undefined; pardes.ctlfs.events.notePath(c.p, "ask", std.fmt.bufPrint(&rec, "{d} del k j", .{c.pane.serial}) catch unreachable); // a u32 fits 32 // The question says Del already. - if (c.pane.msg_announcement) c.pane.msg_len = 0; + _ = c.p.messages.retire(&.{.echo}); return; } c.p.removePane(c.id, to) catch |err| return c.p.reportError(.at(c.id), "close", err); @@ -2363,7 +2363,7 @@ test "Exit over a ctl write or a click names every pane it asks about, a second try std.testing.expect(std.mem.endsWith(u8, unsavedList(p), "\nExit again to discard\n")); var noticed = false; for (p.panes) |slot| if (slot) |pane| { - noticed = noticed or std.mem.eql(u8, pane.msg[0..pane.msg_len], "2 unsaved panes \u{2014} Exit again to discard"); + noticed = noticed or std.mem.eql(u8, p.messages.saidBy(pane), "2 unsaved panes \u{2014} Exit again to discard"); }; try std.testing.expect(noticed); // Edited since: only that one is named again (acme's rule). @@ -2463,7 +2463,7 @@ test "Kill stops the commands pardes typed, bare all and by name those that matc p.host = .{ .vtable = &killed.vtable }; // Nothing running: nothing to stop, and never the shell; said. try std.testing.expectEqual(@as(usize, 0), killed.count(p, "Kill")); - try std.testing.expectEqualStrings("Kill: nothing running", p.panes[term].?.msg[0..p.panes[term].?.msg_len]); + try std.testing.expectEqualStrings("Kill: nothing running", p.messages.saidBy(p.panes[term].?)); _ = exec.execute(p, term, "make -j8"); while (p.nextEffect()) |_| {} // Typed but not started yet (no C mark): not running. |
