summaryrefslogtreecommitdiff
path: root/test/behaviour
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-26 02:19:41 -0300
committerGabriel Schneider <[email protected]>2026-11-26 03:56:56 -0300
commitac39b5e4f80e1903abccd1e003850e9691e61022 (patch)
tree508ead9677839dd67dd82930099388e6dc0b421a /test/behaviour
parent13d234f431a98bf97fcc1caec812f59eff711aa0 (diff)
downloadpardes-ac39b5e4f80e1903abccd1e003850e9691e61022.tar.gz
pardes-ac39b5e4f80e1903abccd1e003850e9691e61022.zip
tagline, layout, draw, mouse, edit, dump: one column, one row: the window row holds the lone column's words at its left (`New Term`) and the window's at its right end (`Find Grep Newcol Help Exit`, then `Restore <dump>`, then the user's text), and the column-tag row comes only with a second column (`New Term Joincol Delcol` over each), or a column tag holding the user's text (UX DESIGN K'2, binding; the user: "I liked C and D for the tagline like we could show the column tagline only when we have multiple columns"); THE OLD WAY: the window's and every column's tag were a row each whatever the window held, 2 of 20 rows at the demo's 84x20 before a line of text, their words their own text (`global_tag.own`, `col_tags[c].own`, or until edited the defaults `Newcol Joincol Find Grep Help Changelog Tutor Dump Themes [Fonts] Config History Debug Exit` and `New Term Find Grep Joincol Delcol`), and Restore's word swapped inside the window's own text (Core.pointRestoreAt); THE CHANGE: a header reads as a pane tag does since K'1, computed words, a blank, then the user's text (tagline.headerWords, headerText; config.window_words_str, column_words_str, columns_words_str; the old lists kept for the dumps and for /tagexec's refusal of pane words, ninep/cols.zig paneWord), the words read-only (edit.setEditTextSpan refuses an edit that changes them and their blank, editText edits the text as shown, flatSurface shows it), the keyboard starting on the user's text (enterHeader, as enterTag), Restore computed (pointRestoreAt keeps only the path); layout.columnBarHeight is 0 with one column and no column tag holding text (and with a window row to take the lone column's words: a native shell's window with none keeps the column row), layout.columnInWindowRow says the lone column's tag is in the window row; tagline.windowRow is the one rule for the window row's two sides, in cells (the column's text and its caret's cell from the inset; the window's text right-aligned, its caret's cell at the right edge, a server's progress after its text while one runs, tagline.sessionProgress; cells from glyphs by layout.tagCapacity's inverse), read by draw.zig (addRegions: a `.column_tag` region for column 0 in the window row, no grip; paintHeaders: the window row on the tagline's ground end to end, column 0's layer at its left in the row's inks, the window's layer from its words), mouse.zig (headerPoint and the press: the column's side, the window's, the blank between no one's), workspaceBlank (the inset and the blank between are the pixel shell's drag area) and root.zig's pixel grid (taglineOriginCol, gridColAt, the macOS fallback); Core.sync lets a column tag keep the keyboard in the window row; revealHeader scrolls each by its own side's width; flattenHeaders keeps the caret on its character in the text as shown; a 9P header write appends to the user's text and a truncation clears it, the words staying (ninep/cols.zig); Help's `topbar` annotation names the window row's words (root.zig shortcuts; docs/typ/builtins-tui.json from `zig build builtins-json`, builtins-gui.json the same 9 lines by hand); RESTORE: dump.dropOldTags also drops a window tag's own text equal to the old row (either build's, with or without its `Restore <path>`) and a column's equal to the old column tag, any other kept as the user's text; A FAULT THE ROW FOUND (core-test, ninep/tree.zig "random placements ... leave no pane under its tag and two rows", seed 30, 8 rows: Newcol with two panes at their minimum left `pane 2 h 2 min 3`): layout.keepColumn's trial shares a column's rows out again for the new layout and, refused, dropped the column but kept the trial's shares, so the column's panes came back on the old height with the trial's weights, one under its minimum; a column row that comes with a second column now makes every refused Newcol in a full column take that path; THE FIX: keepColumn puts every pane's weight back when it refuses (a user could hit it before this change too, where a narrower column wrapped tags); TESTS (FIRST): layout.zig "the column row comes with a second column and goes with it, the panes giving it and taking it back; a column tag with the user's text keeps it (UX K'2)" (one column: no row, the pane at row 1; Newcol: the row, both columns' panes at row 2; Delcol of the second: the pane's rect back as it was; the user's text keeps the row alone, emptied it goes), mouse.zig "one column's words at the window row's left and the window's at its right each run their own; the blank between is no one's (UX K'2)" (windowRow's sides at 100 columns; B2 on New makes a pane in the column; B2 and B1 on the blank nothing; B1 on Term gives the column's tag the keyboard there, its caret on the cell; B2 on Newcol at the right a second column), tagline.zig "a header reads its computed words, then the user's text: typed there, kept through a change of its words (UX K'1, K'2)" (typed at the start, a Backspace into the words refused, Restore coming in before the user's text, Joincol Delcol into both columns' words with a second, Newcol's tag typed into), "a dump of a build before UX K' restores a header's old default own text as none, any other as the user's (UX K'1)" and "the window row is blank at its inset and between its two sides, and nowhere else (UX K'2)"; TESTS CHANGED, each for the row or a word that moved: Core.zig the Restore word (computed, the user's text after it, across a Restore), editable headers (a sweep over the window's words, `a` into them refused, typed after them; the column's tag typed into at the window row's left brings the column row, emptied it goes, the keyboard staying), topbar hover (each side's first word), the short screen (sync before presenting the user's text); tagline.zig flattening (the caret on `a` of Snarf in the text as shown); keys.zig (W4's file, the test only: `s` in the window tag finds `i` twice, Find and Exit); Handover.zig (a column carried by its grip: a second column first, the grip is in the column row); replica.zig (the kind's pane under one row of body: 4 rows, not 5); ninep/cols.zig (the column's and the window's tag read, cleared and appended to after their words); root.zig (the window row's blank on the body's grid, its words compact from their origin); dev/gui/gui.zig (L2cde's file, the test only: the window's text starts at windowRow's words); test/panes.zig (a header's click past its words), test/column_drag.zig (the tags compared by their own text: columnTag now builds in the step's scratch), test/hxdiff.zig (25 rows give helix's 22: one row of chrome less); BEHAVIOUR: columns_and_tags (the window's words at the row's right end; a lone column's tag `New Term `; a click past it on its caret's cell types the user's text and brings the column row, the pane's tag under it, and a wider run of 界 to scroll it; Help, not Tutor, for Tab from the window's tag; a column tag typed into after its words), keys (zz at 80x24 for a view of 21 rows), modes (`b` from the column tag's user text onto its words), tags (the user's text in a column tag brings the column row: the pane one row lower); addons/{fake,life,pdf,snake}.out re-recorded (each kind's window one row taller); PROCESS: 27 waits on `Newcol Joincol` now `Newcol Help Exit`; Dump (dump, load, restore, headersweep-restored), Debug (topbarexec, windowops) and Tutor (tutor), which left the window row, typed into its own text after its words (B1 on Find, A, the word, Esc) and run there by B2; headersweep types after the window's words with A (a click at a column now inside them) and sweeps the second column's `New Term`; tagnav enters the column tag on its user's text (`b`, not `w`) and types Dump into the window's own text, its five B from `$` having run Themes in the old golden, not the Dump its comment says, now one B and Dump, and three B onto Restore; and every click on a row under the column row of a one-column session one row up (the window row's own clicks unchanged), each checked against its old golden's screen, the lower pane's rows staying where the extra row went above them (diffview's last look); GOLDENS: 101 re-recorded (ttyhelp left as it was: the change after this re-records it), every snap checked by a script against its old screen (each text row the same or one row up, the caret the same or one row up), every move one of: the window row's new words (the lone column's `New Term` at the left, the window's at the right end), the column row gone with one column (every row under it up one, one more text row at a foot), the column tags' words, Help's `topbar` annotations gone from the words that left, a header's caret on its user's text (emptycol, layout-close, tagnav), a nested session two rows (nested-optout), the typed Dump, Debug and Tutor in the window row; GATES: core-test 1130/1303 (173 skipped: +4, ssonuoyn 1126/1299), shell-test 1351/1354 (3 skipped: +1), pane-test 183/184 (1 skipped), behaviour-test 280/280 and --replay 20 seeds of 70 steps 0 failures, process-test 1 of 147 failed (ttyhelp: this change moves it too; the change after this re-records it; 3 skipped), term-test 17/17, kitty-test 45/45, the gui unit-test 1954/1958 (4 skipped, none failed; ssonuoyn 1949/1954; its one failed step the perf check's known BaselineHarnessMismatch); the two tagline.zig tests on the base (ssonuoyn, the tests alone): both fail, the header's at its first question (`Newcol Joincol Find Grep Help ...` where `Find Grep Newcol Help Exit ` is asked), the dump's at the window's old row restored as its own text (the layout and mouse tests ask for windowRow and columnInWindowRow, which the base has not); the dump fuzz at 40,000 join seeds twice and 1,779 image seeds 11/11 (no field changed; the header rows change the layout); the soak `replicas -- --clients 5 --rtt 30,80,207`: diverged 0, unequal 0, agree/differ 491/0 338/0 522/0, unlisted stops 0, the corpus 22 of 22 scenes the same, no leak; no frame/perf gate (the coordinator's, at the programme's end); load 2.0 to 14.8
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'test/behaviour')
-rw-r--r--test/behaviour/columns_and_tags.zig48
-rw-r--r--test/behaviour/keys.zig7
-rw-r--r--test/behaviour/modes.zig6
-rw-r--r--test/behaviour/tags.zig5
4 files changed, 40 insertions, 26 deletions
diff --git a/test/behaviour/columns_and_tags.zig b/test/behaviour/columns_and_tags.zig
index e1257897..4ca6f7b3 100644
--- a/test/behaviour/columns_and_tags.zig
+++ b/test/behaviour/columns_and_tags.zig
@@ -129,9 +129,12 @@ test "columns-and-tags: Delcol on the last column leaves the window, drawn and t
try s.write(s.at("/col/{d}/ctl", .{try s.column(0)}), "Delcol\n");
try expectEqualStrings("", try s.columns());
try s.expect("/index", "");
- // Drawn, and keys go to the workspace tag.
+ // Drawn, its words at the window row's right end (UX K'2), and keys go
+ // to the workspace tag.
try s.keys("x\n");
- try std.testing.expect(std.mem.startsWith(u8, try s.screen(), " Newcol "));
+ const screen = try s.screen();
+ const first = std.mem.trimEnd(u8, screen[0..std.mem.indexOfScalar(u8, screen, '\n').?], " ");
+ try std.testing.expect(std.mem.endsWith(u8, first, "Find Grep Newcol Help Exit"));
try s.write("/ctl", "Newcol\n");
try s.write(s.at("/col/{d}/ctl", .{try s.column(0)}), "New\n");
try expectEqualStrings(s.at("{d}:{d}", .{ try s.column(0), try s.focused() }), try s.columns());
@@ -162,7 +165,8 @@ test "columns-and-tags: New is a column tag's word, in no pane's tag nor the wor
var words = std.mem.tokenizeScalar(u8, tag, ' ');
while (words.next()) |word| try std.testing.expect(!std.mem.eql(u8, word, "New"));
}
- try expectEqualStrings("New Term Find Grep Joincol Delcol", try s.read(s.at("/col/{d}/tag", .{try s.column(0)})));
+ // A lone column's words (UX K'2), and no text of the user's.
+ try expectEqualStrings("New Term ", try s.read(s.at("/col/{d}/tag", .{try s.column(0)})));
}
test "columns-and-tags: a click past a column tag's text types after it, a newline typed there a space, and a long tag scrolls to its caret" {
@@ -171,18 +175,20 @@ test "columns-and-tags: a click past a column tag's text types after it, a newli
// A held pane (Keep): its tag as it was before the walk, no `Keep` word (SPEC §6.5).
try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Keep\n");
const tag = s.at("/col/{d}/tag", .{try s.column(0)});
- // Its row, then the pane's tag: the column's stays one row.
- const rows = " New Term Find Grep Joincol Delcol";
- try std.testing.expect(std.mem.indexOf(u8, try s.screen(), rows ++ " ") != null);
- try s.click("Delcol", 20, 1);
- // A clicked tag is in normal mode: `i` types where it was clicked.
+ // A lone column's tag is at the window row's left (UX K'2).
+ try std.testing.expect(std.mem.startsWith(u8, try s.screen(), " New Term "));
+ // Past its text, on its caret's cell. A clicked tag is in normal mode:
+ // `i` types where it was clicked, after its computed words.
+ try s.click("Term", 5, 1);
try s.keys("i\nSnarf");
- try expectEqualStrings("New Term Find Grep Joincol Delcol Snarf", try s.read(tag));
- try std.testing.expect(std.mem.indexOf(u8, try s.screen(), rows ++ " Snarf ") != null);
- // The pane's tag on the row right under it: the column's is one row.
+ try expectEqualStrings("New Term Snarf", try s.read(tag));
+ // The user's text brings the column row, one row under the window's,
+ // and the pane's tag on the row right under it.
+ const rows = " New Term Snarf";
+ try std.testing.expectEqual(@as(usize, 1), (try s.where(rows ++ " "))[1]);
try std.testing.expectEqual((try s.where(rows))[1] + 1, (try s.where("/test.txt Del"))[1]);
// Wider than the screen: the tag scrolls to keep its caret drawn.
- try s.keys(" 界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界");
+ try s.keys(" 界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界界");
const col, const row = (try s.cursor()).?;
try std.testing.expectEqual(@as(usize, 1), row);
try std.testing.expect(col < 80);
@@ -204,9 +210,9 @@ test "columns-and-tags: Enter in a tag in normal mode runs the word under its cu
try s.expect("/focus", "");
try s.keys("iMine\x1b");
try std.testing.expect(std.mem.indexOf(u8, try s.read(s.at("/col/{d}/tag", .{try s.column(1)})), "Mine") != null);
- try s.click("Tutor", 1, 1);
+ try s.click("Help", 1, 1);
try s.keys("\t");
- try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/name", .{try s.focused()})), "/+Tutor\n"));
+ try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/name", .{try s.focused()})), "/+Help\n"));
}
test "columns-and-tags: a tag write refuses NUL and the other control characters, the workspace's, a column's and a pane's" {
@@ -279,14 +285,18 @@ test "columns-and-tags: a column tag lights the word under the mouse, is clicked
try s.write("/mousein", s.at("m {d} 1 1\nm {d} 1 0\n", .{ x + 3, x + 3 }));
for (0..4) |k| try expectEqualStrings(lit, try s.bg(x + k, 1));
try std.testing.expect(!std.mem.eql(u8, lit, try s.bg(x + 4, 1)));
- // A clicked tag is in normal mode: `i` types at its caret.
- try s.keys("\u{F00D}iHelp ");
- try std.testing.expect(std.mem.startsWith(u8, try s.read(tag), "Help New Term"));
- try std.testing.expectEqual(x + 5, (try s.cursor()).?[0]);
+ // A clicked tag is in normal mode: `i` types at its caret, after its
+ // computed words (UX K'1).
+ const lead = "New Term Joincol Delcol ".len;
+ try s.keys("\u{F00D}");
+ try s.write("/mousein", s.at("m {d} 1 1\nm {d} 1 0\n", .{ x + lead, x + lead }));
+ try s.keys("iHelp ");
+ try expectEqualStrings("New Term Joincol Delcol Help ", try s.read(tag));
+ try std.testing.expectEqual(x + lead + 5, (try s.cursor()).?[0]);
// A tag one short of its room: its caret at the end is drawn on the
// last cell, and one more letter scrolls the text, never the caret.
const as: [80]u8 = @splat('a');
- const row = as[0 .. width - 1];
+ const row = as[0 .. width - 1 - lead];
try s.replace(tag, row);
try s.keys("\u{F018}");
try std.testing.expectEqual(x + width - 1, (try s.cursor()).?[0]);
diff --git a/test/behaviour/keys.zig b/test/behaviour/keys.zig
index 9eb33ac2..2274e73a 100644
--- a/test/behaviour/keys.zig
+++ b/test/behaviour/keys.zig
@@ -414,11 +414,12 @@ test "keys: zz and zc put the cursor's line in the middle row of an odd view, as
for (&lines, 0..) |*l, i| _ = try std.fmt.bufPrint(l, "l{d:0>2}\n", .{i});
var s = try Session.initFile(std.testing.allocator, std.mem.asBytes(&lines));
defer s.deinit();
- s.resize(80, 25);
+ s.resize(80, 24);
for ([_][]const u8{ "15jzz", "ztzc" }) |keys| {
try s.keys(keys);
- // 80x25 gives the pane 21 rows (the notice row under it): l05 to
- // l25, l15 the eleventh
+ // 80x24 gives the pane 21 rows (the window row and its tag above
+ // them, the notice row under them; one column, no column row):
+ // l05 to l25, l15 the eleventh
const top = (try s.where("l05"))[1];
try std.testing.expectEqual(top + 10, (try s.where("l15"))[1]);
try std.testing.expectEqual(top + 20, (try s.where("l25"))[1]);
diff --git a/test/behaviour/modes.zig b/test/behaviour/modes.zig
index 47f2ccd2..39bb66c8 100644
--- a/test/behaviour/modes.zig
+++ b/test/behaviour/modes.zig
@@ -249,10 +249,12 @@ test "modes: window keys walk from a pane up through its column's tag and the wo
try std.testing.expect(x0 < right);
const tag = s.at("/col/{d}/tag", .{try s.column(0)});
const words = try s.read(tag);
- try s.keys("w");
+ // On its user's text, after its computed words (UX K'1): `b` moves
+ // back onto them.
+ try s.keys("b");
try s.expect(tag, words);
const remembered = (try s.cursor()).?;
- try std.testing.expect(remembered[0] > x0);
+ try std.testing.expect(remembered[0] < x0);
// Across to the right column's tag, and back to where the caret was.
try s.keys("\x17l");
try std.testing.expect((try s.cursor()).?[0] >= right);
diff --git a/test/behaviour/tags.zig b/test/behaviour/tags.zig
index e7779b86..fcef9fd3 100644
--- a/test/behaviour/tags.zig
+++ b/test/behaviour/tags.zig
@@ -255,12 +255,13 @@ test "tags: a tag with more lines than rows scrolls to keep its caret in view" {
try s.keys("\x1bgg");
try std.testing.expectEqual(.{ x, y }, try s.where("/test.txt"));
try std.testing.expectEqual(y, (try s.cursor()).?[1]);
- // A column tag is one row, as acme's: its lines are joined.
+ // A column tag is one row, as acme's: its lines are joined. Its user's
+ // text brings the column row (UX K'2): the pane one row lower, no more.
var layout = std.mem.tokenizeScalar(u8, try s.read("/layout"), ' ');
const col_tag = s.at("/col/{s}/tag", .{layout.next().?});
try s.replace(col_tag, "New\nC1\nC2");
try std.testing.expect(std.mem.indexOfScalar(u8, try s.read(col_tag), '\n') == null);
- try std.testing.expectEqual(y, (try s.where("/test.txt"))[1]);
+ try std.testing.expectEqual(y + 1, (try s.where("/test.txt"))[1]);
}
test "tags: a long pane tag wraps onto rows, and a click on a wrapped row maps to the whole tag's address" {