From e91261ff4f4602afec14d2fb958fd3e51a4dc62d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 24 Nov 2026 21:01:37 -0300 Subject: messages: a background question waits in its pane's tag and never takes the keyboard; SPC e gives it the keyboard, Esc leaves it waiting (pick-ui SPEC §10.2, §10.4, §3.2 asking, walk UI line C item 4): a file that changes on disk under unsaved text is now a question of its pane (one at a time: File.changed), its answers r Reload, k Keep mine and d Diff (Messages.Ask.answers); while the tag is at rest the question is drawn after the path as computed prefix text, 'changed on disk ▸ r Reload k Keep mine d Diff · SPC e to answer' (Messages.askingText; the tag's own words stay after it until the head of ruling R1 takes their place), its mark ? in the box and the notice row's '1 question · SPC e'; the keys stay the body's: View.answering (a pane's serial, the view's own keyboard state, ruling R4) is set by SPC e (item 5) and makes the answer's key answer it in handleKey's first slot, Esc leaving it waiting; the own-command questions (Del's side, a REPL's choice) keep that slot as they were; B2 on an answer's word in its tag answers it (exec.execute: Messages.answerWord); r reads the file again with the consent Get would ask for, k keeps the text and says so, d reads the disk's text (the host's read, taped) and shows where it parts from the buffer as ghost rows under that line, the disk's + lines first (Messages.diskDiff, Said.open: shown whatever the caret), d again hides them; an answer is logged ('... · answered Reload'); Messages.waitingAnswers is what a : lists first (for agent E); 9P /log says 'msg N changed on disk' (monkey9p's checker reads that); tests: Messages.zig 'a file changed on disk under unsaved text asks in its tag and never takes the keyboard: SPC e's keyboard answers, d shows the disk's lines as ghosts, Esc leaves it waiting, B2 on Reload reads it again', ninep/ctl.zig's disk-change test now finds the question; tui: core-test, shell-test, pane-test, behaviour-test pass; process-test: filewatch's golden takes the question (its tag row and its notice row), Restore's root-ctl case failed once under load and passes alone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- core/File.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/File.zig') diff --git a/core/File.zig b/core/File.zig index 58544b62..f611bbbd 100644 --- a/core/File.zig +++ b/core/File.zig @@ -2439,8 +2439,9 @@ pub fn changed(p: *Pardes, id: u8, bytes: []const u8) void { if (f.disk_newer == disk) return; f.disk_newer = disk; f.disk_newer_warned = false; - var said: pardes.Kind.Buf(limits.host_path_cap + 64) = .{}; - p.setMessage(.at(id), said.print("{s} changed on disk (get reloads it, Save overwrites it)", .{f.path[0..@min(f.path.len, limits.host_path_cap)]})); + // A question in its tag, never the keyboard's (pick-ui SPEC §10.2): + // one waiting already is the one about it. + if (p.messages.waiting(pane) == null) pardes.Messages.say(p, .question, id, "changed on disk").asks = .disk; var rec: [16]u8 = undefined; pardes.ctlfs.events.notePath(p, "changed", std.fmt.bufPrint(&rec, "{d}", .{pane.serial}) catch unreachable); // a u32 fits 16 return; -- cgit v1.3