From a310585195484b8420f14cff3e736c604f47c11e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 22:03:11 -0300 Subject: core, docs, test: a pane that answers for another is docked to it, `Pane.docked_to`, and the tag word that lets it go is `Undock`, no longer `attached_to` and `Unattach` (P18 and P28, the user's rulings: *attach* is a client joining a session now; `Undock` confirmed; no alias, so `Unattach` is an unknown word after this change): the field `attached_to` on 24 lines of seven files (core/panes.zig's Pane field and its one use; views.zig's PaneView field and its name in `pane_fields`; dump.zig, Handover.zig, layout.zig, Query.zig, builtins.zig) and docs/next-daemon.md's mention; the builtin `Unattach` (its struct in core/builtins.zig with its help line and its refusal, "Undock: not docked to a pane"; its null key in core/config.zig; the frozen query pane's tag tail in core/tagline.zig with its comment; layout.zig's test that runs it; Query.zig's comment, with its two lines' "attached"/"unattached" where they mean docked); the builtin lists docs/typ/builtins-tui.json and builtins-gui.json (the line `zig build builtins-json` writes, checked byte for byte against the generator for both platforms); the one line in the changelog's Unreleased; docs/search-proto-converge.md's three mentions; the seven goldens that show a frozen query pane's tag (find, fsearch, grep, lookrange, lsp-client, lsprelpath, stepgrain: nine lines, each `Save Unattach Del` -> `Save Undock Del` and nothing else, edited by hand and passing as they are, not regenerated); the other prose "attach"/"attachment" meaning docked and the functions `attachFrom` and `testAttachment` stay (not ruled; listed in the report); a dump written before this change restores its docked panes undocked, with a note (walk.load lets an unknown field go); the semantics word does not move (38b5ae573b965550 before and after: the tape's shape names neither the builtin nor the field); tui core-test 848/991 (143 skipped), shell-test 1027/1030, pane-test 183/184, term-test 15/15, kitty-test 45/45, behaviour-test 275/275 (--replay 20 seeds, 0 failures), process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's; msg's cursor column flaked once and passed again in the run), the soak (--clients 5) diverged 0, unequal 0, deltas wrong 0, quiet checks 618/0, 835/0, 771/0, stops unlisted 0, the corpus through a client 22 scenes each frame the same, no leak; gui unit-test 1625/1629 failing only the perf check's BaselineHarnessMismatch (as the base); the macOS library for Linux and aarch64-macos and the FreeBSD cross-build rc 0; the cheatsheet (one page), the book (77 pages) and the site build, Undock in the glossary; the frame and perf gate PASS (77/77 frames byte-identical in Debug, the alternated window corpus2x +0.041% against a 0.4% threshold, the 97 per-operation counts within 0.1%, the largest +0.0197%); under a load of 4 to 37 Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/Query.zig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'core/Query.zig') diff --git a/core/Query.zig b/core/Query.zig index b76a5aa4..0cecb93e 100644 --- a/core/Query.zig +++ b/core/Query.zig @@ -200,16 +200,16 @@ fn freeSaved(gpa: std.mem.Allocator, s: Saved) void { gpa.free(s.items); } -/// The owner's query pane (attached to it, or left where it was by -/// Unattach): the one a later search from it reuses. +/// The owner's query pane (docked to it, or left where it was by +/// Undock): the one a later search from it reuses. pub fn ofOwner(p: *Pardes, owner_serial: u32) ?usize { var found: ?usize = null; for (p.panes, 0..) |slot, i| { const pane = slot orelse continue; const q = pane.query orelse continue; if (q.owner != owner_serial) continue; - // the attached one first: an unattached one is a kept result - if (pane.attached_to == owner_serial) return i; + // the docked one first: an undocked one is a kept result + if (pane.docked_to == owner_serial) return i; found = found orelse i; } return found; @@ -1754,7 +1754,7 @@ fn promote(p: *Pardes, qid: usize, id: usize) void { // Its text was read from that file to preview it (displayPreview). f.on_disk = filesystem.localPath(f.path) != null; f.syntax_dirty = true; - pane.attached_to = null; + pane.docked_to = null; if (f.on_disk) p.recent.opened(p.recentGpa(), f.path); if (filesystem.localPath(f.path) != null) p.emit(.{ .watch = .{ .pane = .at(id), .on = true } }); pardes.ctlfs.events.noteLog(p, .rename, pane); @@ -1887,7 +1887,7 @@ pub fn cancel(p: *Pardes, id: usize) void { // A preview made for the query Esc took back has no use: its rows // go to the text whose rows they were. if (previewOf(p, id)) |pid| { - p.panes[pid].?.attached_to = null; + p.panes[pid].?.docked_to = null; p.removePane(pid, owner_id) catch |err| p.reportError(.at(id), "query", err); q.preview = 0; } @@ -2354,7 +2354,7 @@ test "Find: names fuzzy per keystroke, the group born with its +Preview, nothing try std.testing.expectEqual(pv, p.view().active); try std.testing.expectEqual(serial, p.panes[pv].?.serial); try std.testing.expect(p.panes[pv].?.file.?.output == null); - try std.testing.expect(p.panes[pv].?.attached_to == null); + try std.testing.expect(p.panes[pv].?.docked_to == null); layout.compute(p); try std.testing.expectEqualDeep(rect, p.view().rects[pv]); try std.testing.expect(q.frozen); -- cgit v1.3