diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-26 09:29:45 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-26 11:19:58 -0300 |
| commit | 6b2b63f654561ba9d64c134e6ccc6c0784e15220 (patch) | |
| tree | 4d3c140f7c26714bb47cae6c2d811928f7170e57 /core/Trail.zig | |
| parent | 8959b031dc330b4da21c0e89e0831d6fadbcd757 (diff) | |
| download | pardes-6b2b63f654561ba9d64c134e6ccc6c0784e15220.tar.gz pardes-6b2b63f654561ba9d64c134e6ccc6c0784e15220.zip | |
draw, colors, gui: the tags, grips, window and column rows and the notice row drawn from the chrome (the themes programme's L2a, DESIGN.md part F's L2a row, G1' and H): a tag's ground says focus only, two grounds (`chrome.on(.plain/.focus)`), a reading pane's on its focus's as a held one's, its mode on its grip; in a pane tag the trail, path, `Keep` and the user's text in the full ink (`text`, 7:1 where the gamut allows), its computed words (UX K'1, K'3) in the words' ink (`word`, 4.5:1), the basename in `name[g]`, its forward steps, fold and head hints `dim`, the walked word and the head's keys `key`, the head's error `severity[0]`, its own selection and a pointer sweep the ground's selection, window mode's outline the plain tag's selection whichever pane it is on (one outline walked from pane to pane), a hovered word its half selection (B5: `Selection.secondary`, new, the ground halfway to its selection, worked out with the ground's inks); the window row and the column tags on the page, no band and no focus, every word in `page.word` (a terminal's own page where the theme leaves it to the host: dark), their hovered word the page's half selection, a server's progress the page's dim ink; a column's grip `grip.column_rest` (2:1) at rest, `grip.column` (3:1) grabbed, never focus; the notice row on `status` (its ground, ink, dim and its lead's severity per ground); a pane's notice chips on the plain tag; the grid's grip (R5', R6): focused `grip.focus` with its glyph in `grip.ink`, or in `grip.mode_glyph` reading; at rest its ring `grip.ring` as the cell (the theme's own where it rings its grips, acme's #8888cc, lapis's #9aa6d9, where the cell was half that and the box's fill) with the tag's ink; reading unfocused the mode's mark `grip.mode` filled, glyph `grip.ink`; unsaved a bold `*` in `grip.ink` on `grip.dirty`; a message's mark in its kind's ink held on its fill (`Grip.marks`, new: each severity and the dim ink held at a theme change on the four fills a grid gives a grip, at rest and reading on the plain tag too, where a window draws them hollow), so the gui draws the cell's ink and its per-frame pushAway goes; both copies of `inkOn` deleted (draw.zig's, and the gui's use of pushAway); the rail's ticks the hit's and the current hit's (R8), the body's pan arrow the page's key ink, the debug box the rail and the tag's ink; the surface's chrome from the chrome alone (`tag_reading_bg` deleted, `tagline_bg` the page and `tagline_rows` over the column row too, so a window's underlay there is the page); the gui: no reading underlay, the column bar's focus cover and the reading cover gone (nothing reads them now), a column grip's band the page; Messages.ink deleted (`inkOn` takes a ground's inks or a fill's marks); THE BAND is untouched here (its inks are the next change's); RUN (TEST FIRST): draw.zig "a grip in the grid is the chrome's in every theme ..." (every theme in the ring, not the natives: focus, rest, mode, dirty, focused reading; the four each its own), "a reading pane's tag is on the plain or the focused ground, as a held one's; its grip carries the mode's mark ..." (acme, orchard, dark, neonotte84; held and reading, focused and not), "a pane tag's trail, path, Keep and the user's text are in its full ink, its computed words in the words' ink; the window row and the column tags on the page ... the notice row on its own ground" (dark: the host's page), each failing on the base (the old grip mix, the reading tint, the tag's own unheld ink on `Del`, the tagline ground); re-pinned: Trail.zig's reading-tint tests (the reader on the focused ground and its grip region reading, the held one plain), the name tint test (against the full ink, not ` Del`'s), Core.zig's window-row hover and empty column, replica's themed dump, test/column_drag.zig, test/panes.zig's tint tests (the name in `name[g]`, the words in `word`, the rest in `text`), the gui's mark test (the cell's ink, held by the core), look.zig's tag hover (the focused ground's half selection), behaviour's column-tag sweep (the swept cells the selection, the hovered word its half) and tags' tint (the directory in the full ink, the computed words in the words'); GOLDENS (36 of 103, orchard unless said), each moved cell read by goldsum.py/rowpairs.py against the base: (1) the window and column rows to the page: tagline #b2c3b8 on #1d2824 to page.word #788079 on #0d1410 (3932 cells in 33) and their blanks (1834), the active column's #becfc4 on #314738 too (1268); (2) a pane tag's computed words in `word`: plain #819188 (1607), focused #a1b1a8 on the focus ground #394440 (1088); (3) the focused tag's ground #314738 (the old focus tint) to the chrome's #394440 and its full ink #becfc4 to #cadbd0 (991), the name tint on it (701); (4) a reading pane's tint #2c2c0f gone: focused to #394440 (746 + 647 words + 101 names), unfocused to the plain tag (234 + 219 words + 50 names), the head's dim on it to the focused dim #8e9d94 (165), its key #bada9d to #add38a (28 + 6); (5) grips: a reading unfocused one's ring #465a43 to the mode's sky #3096c0 (10 + 2), a focused reading one's glyph black to `mode_glyph` #06779d (6); (6) the rail's current tick, the text #e5eee5, to the current hit #917a53 (8 + 1); (7) a server's progress on the window row, hint #b7cb98, to the page's dim #666f68 (135, callstack, lsprelpath); (8) a hovered header word, the full selection, to the page's half #24382c in page.word (9 + 2, load, windowops); the tag's selection's ink #f5f7ee to the focused ink held on it #cadbd0 (65 + 1, tagpath); (9) blanks only: the dump's runs carry a blank cell's ink from the cell before it, so blanks after `Del`, on a grip's second cell and the column grips show the new ink with no glyph (271 + 253 + 22 + 18 + 6 + 4 + 4 + 4); theme.golden and themesel.golden (24 themes each), the same classes per theme: the window and column rows on each page (dark's the host's: `d`), dark_plus's blue status bar now the notice row's alone (H), acme's cyan header rows on its page #ffffea in #74746a, the focused tag on R4's step (acme #d1e6e6, dark_plus #565656, light #d1cfdb), the notice row's ink `status.text` (the tag's held), paper's and solarium's on the lifted plain tag (H's 1.1), acme's and lapis's resting grip their own ring as the cell; mini, collapse, ninep carry the same in their 9P captures' style rows; GATES (tui): core-test 1155/1329 (174 skipped), pane-test 184/185 (1 skipped), process-test 0 of 103 failed with --update (36 re-recorded, read above); THE END GATE's finds, fixed here: shell-test's look.zig tag hover and behaviour's column-tag sweep and tags' tint asked the old looks (re-pinned above), and behaviour's window mode lost its outline walking from the focused pane to another (each tag's own selection differs by ground: the outline is the plain tag's selection on every pane now); the whole stack's gates are in its last change's description; load 2.5 to 9.5; OUTSIDE draw.zig/Messages.zig: core/colors.zig (Selection.secondary, Grip.marks/Fill/Marks, three hunks), core/surface.zig (Chrome's reading underlay gone, two docs), dev/gui/gui.zig (underlay, gripFill, mark ink, gripDecor's band, coverFrame, two tests), core/Trail.zig, core/Core.zig, core/replica.zig, core/look.zig, test/column_drag.zig, test/panes.zig, test/behaviour/columns_and_tags.zig, test/behaviour/tags.zig (tests), test/snapshots (36)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/Trail.zig')
| -rw-r--r-- | core/Trail.zig | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/core/Trail.zig b/core/Trail.zig index e42ab1e2..cd115018 100644 --- a/core/Trail.zig +++ b/core/Trail.zig @@ -701,7 +701,7 @@ fn tagGroundOf(p: *Pardes, arena: *std.heap.ArenaAllocator, id: usize) !pardes.C return s.at(r.x + pardes.TAG_TEXT_INSET, p.tagTop(p.panes[id].?, r)).style.bg; } -test "a file's pane is reading, its tag in the reading tint with Keep after its path; typed into, it is held, and Jumps new-pane reads none" { +test "a file's pane is reading, Keep after its path and its grip in the mode's mark, its tag on its focus's ground (DESIGN.md G1'); typed into, it is held, and Jumps new-pane reads none" { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 }); defer p.deinit(); var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); @@ -710,12 +710,14 @@ test "a file's pane is reading, its tag in the reading tint with Keep after its const pane = try p.setTestFile("alpha\nbeta\n"); try std.testing.expect(reading(p, pane)); try std.testing.expect(std.mem.startsWith(u8, try tagOf(p, pane), "/test.txt Keep ")); - try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().tag_reading_bg }, try tagGroundOf(p, &arena, 0)); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().on(.focus).ground }, try tagGroundOf(p, &arena, 0)); + try std.testing.expect(p.surface.region(.grip, 0).?.reading); // Under Jumps new-pane nothing reads: the tag as it always was. p.settings.jumps = .@"new-pane"; try std.testing.expect(!reading(p, pane)); try std.testing.expectEqualStrings("/test.txt Del ", try tagOf(p, pane)); - try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().tag_active_bg }, try tagGroundOf(p, &arena, 0)); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().on(.focus).ground }, try tagGroundOf(p, &arena, 0)); + try std.testing.expect(!p.surface.region(.grip, 0).?.reading); p.settings.jumps = .walk; // Typed into: held from now on, though Undo takes the text back. typeKeys(p, "ix"); @@ -724,7 +726,8 @@ test "a file's pane is reading, its tag in the reading tint with Keep after its try std.testing.expectEqualStrings("alpha\nbeta\n", pane.file.?.content); try std.testing.expect(!reading(p, pane)); try std.testing.expect(std.mem.indexOf(u8, try tagOf(p, pane), "Keep") == null); - try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().tag_active_bg }, try tagGroundOf(p, &arena, 0)); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().on(.focus).ground }, try tagGroundOf(p, &arena, 0)); + try std.testing.expect(!p.surface.region(.grip, 0).?.reading); } test "Keep holds a reading pane; a scratch and a listing are never reading" { @@ -927,9 +930,9 @@ test "the session of pick-ui §6.7: four jumps across three files, back by a cli var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); defer arena.deinit(); const s = try p.render(arena.allocator()); - // In the dim ink of the reading tag's ground (UX D4: 3:1 at least). + // In the dim ink of the focused tag's ground (UX D4: 3:1 at least). const dim = try tagCell(p, r, "place.zig:40"); - try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().roles.on(.reading_focused).dim }, s.at(dim[0], dim[1]).style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().on(.focus).dim }, s.at(dim[0], dim[1]).style.fg); // A click on a forward step goes forward to it. try clickTag(p, r, "place.zig:9", .left); r = p.view().active; @@ -982,11 +985,13 @@ test "the walk drawn with a picker's list and the notice row (walk UI G 2e, SPEC try std.testing.expect(std.mem.startsWith(u8, try tagOf(p, p.panes[rd].?), try std.fmt.bufPrint(&want, "‹@p{d} › rank.zig:12 › Refs 1/2 › {s}/place.zig Keep ", .{ owner, f.dir }))); var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); defer arena.deinit(); - // The reader's tag in the reading tint, the held one's not; the notice - // row says what Ctrl-o goes back to (UX L'1), and with nothing said, - // where the reader's caret is. - try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().tag_reading_bg }, try tagGroundOf(p, &arena, rd)); - try std.testing.expect(!std.meta.eql(pardes.Color{ .rgb = p.chromeTheme().tag_reading_bg }, try tagGroundOf(p, &arena, f.held))); + // The reader's tag on the focused ground, the held one's on the plain + // (G1': the mode is on the reader's grip); the notice row says what + // Ctrl-o goes back to (UX L'1), and with nothing said, where the + // reader's caret is. + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().on(.focus).ground }, try tagGroundOf(p, &arena, rd)); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().on(.plain).ground }, try tagGroundOf(p, &arena, f.held)); + try std.testing.expect(p.surface.region(.grip, rd).?.reading and !p.surface.region(.grip, f.held).?.reading); for ([_][]const u8{ "C-o back to Refs 1/2", try std.fmt.bufPrint(&want, "{s}/place.zig:8", .{f.dir}) }) |said| { const s = try p.render(arena.allocator()); const foot = s.region(.notice_row, pardes.Region.none).?.rect; @@ -1020,8 +1025,8 @@ test "a trail keeps its newest three back steps whole, older ones fold into one defer arena.deinit(); const s = try p.render(arena.allocator()); const fold = try tagCell(p, r, "+2"); - // In the dim ink of the reading tag's ground (UX D4). - try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().roles.on(.reading_focused).dim }, s.at(fold[0], fold[1]).style.fg); + // In the dim ink of the focused tag's ground (UX D4). + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().on(.focus).dim }, s.at(fold[0], fold[1]).style.fg); try clickTag(p, r, "+2", .right); try std.testing.expectEqualStrings("rank.zig:20", f.at(&at)); // Back at the first: five forward steps, the two nearest whole. @@ -1111,7 +1116,7 @@ test "a step whose tag would take a row its column cannot give folds to its newe defer arena.deinit(); const s = try p.render(arena.allocator()); const base = try tagCell(p, r, "long.zig"); - try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().tag_active_name_fg }, s.at(base[0], base[1]).style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().name[1] }, s.at(base[0], base[1]).style.fg); // A click on the path drafts a name: the whole path, its caret where // the click was (on the first byte shown after the `…`). const after = v.rects[r]; @@ -1206,7 +1211,7 @@ test "two steps whose files have the same name are told apart by the shortest pa const word = try tagCell(p, r, "Find x 1/2"); try std.testing.expect(s.at(word[0], word[1]).style.ul == .single); // In the key ink (UX D8, D4). - try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().roles.key }, s.at(word[0], word[1]).style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().on(.focus).key }, s.at(word[0], word[1]).style.fg); const other = try tagCell(p, r, "place.zig"); try std.testing.expect(s.at(other[0], other[1]).style.ul != .single); } |
