diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-26 09:57:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-26 11:19:58 -0300 |
| commit | 44a04dc0eaa1697cee42219a2aa814352c63fbe6 (patch) | |
| tree | ee9f5269278926655f74429c1687ba1a64f95bac /core/Band.zig | |
| parent | 6b2b63f654561ba9d64c134e6ccc6c0784e15220 (diff) | |
| download | pardes-44a04dc0eaa1697cee42219a2aa814352c63fbe6.tar.gz pardes-44a04dc0eaa1697cee42219a2aa814352c63fbe6.zip | |
draw, colors: the band (a picker's rows, a level, a prompt's list, Help, the registers) drawn from the chrome on its tag's ground, focused or not, whatever its mode (DESIGN.md B6, G1'), and its cursor row on that ground's selection, a ground of its own (B1.3): its text, dim, rule, kind mark and name tint the tag ground's (`chrome.on(g)`, `name[g]`), the cursor row's text and dim the selection's, its keys, `▶` and matched letters the selection's own key and match inks (`Selection.key`, `Selection.match`, new, the accent and the hits' hue held 4.5:1 on that selection at a theme change; the ground's key and match stay held on the ground alone, D4's goldens for neonotte84 and acme unmoved); THE CAUSE where it was wrong: the band read the old view's Roles, whose key and match were pushed toward white or black over all seven tag and selection grounds at once (A5.7's joint floor: one ink for every ground) and whose reading grounds were the reading tint, so after the tag above it moved to the chrome's focus ground the band under a reading pane sat on the old tint; THE FIX: joinBand reads `p.chrome()` alone, and `Roles`, `RoleInks`, `TagGround`, `inksOn`, `toward`, `pushAway`, `matchHue` and `selectionOf` are deleted (nothing reads them: the tags, the grips, the notice row and the message inks moved in the change before), with ChromeTheme's `roles`; the ring test checks each ground's selection key and match (4.5:1 where its ground reaches it) and every grip fill's message marks (4.5:1 where the hue reaches it on the fill and, at rest and reading, the plain tag); its old copy of those checks, "every theme's walk UI roles meet their floors ...", goes with Roles (the ring's per-ground `inks` check holds the same floors on the chrome); RUN (TEST FIRST): Band.zig "a band is drawn in the theme's roles ..." re-pinned (the cursor row's `▶`, chord and matched letters in the selection's key and match, the spines in the focused tag's rule: on the base its reading pane's band was on the reading tint's Roles), Band.zig's register dim, Pick.zig's two band tests and bindings.zig's registers on the focused tag's inks; GOLDENS: none moved (no process golden captures a band's style); GATES (tui): core-test 1154/1328 (174 skipped: the Roles test gone), process-test 0 of 103 failed with --update (0 re-recorded); the ring 245 of 245; load 5.9 to 6.5; OUTSIDE draw.zig: core/colors.zig (Selection.key/match, groundInks, Roles deleted, the ring's two checks), core/Band.zig, core/Pick.zig, core/bindings.zig (tests)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/Band.zig')
| -rw-r--r-- | core/Band.zig | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/core/Band.zig b/core/Band.zig index d60e9831..228dcad0 100644 --- a/core/Band.zig +++ b/core/Band.zig @@ -782,7 +782,7 @@ test "Help's rows say the chord, two blanks and the word; the group is the row's var frame = std.heap.ArenaAllocator.init(std.testing.allocator); defer frame.deinit(); const a = frame.allocator(); - const selected = p.chromeTheme().roles.selectedOn(if (pardes.Trail.reading(p, pane)) .reading_focused else .focused); + const selected = &p.chrome().on(.focus).selection; for ([_]u21{ ' ', '?', 'w', 'r', 'a', 'p' }) |c| p.update(.{ .key = .{ .cp = c } }); const band = (try of(p, a, pane, id)).?; const step = band.steps[0]; @@ -1021,14 +1021,13 @@ test "a band is drawn in the theme's roles (UX D4): spines in the rule ink, a ch }; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 140, .rows = 40 }); defer p.deinit(); - const pane = try p.setTestFile("one\n"); + _ = try p.setTestFile("one\n"); const id = p.view().active; var frame = std.heap.ArenaAllocator.init(std.testing.allocator); defer frame.deinit(); const a = frame.allocator(); - const roles = &p.chromeTheme().roles; - const inks = roles.on(if (pardes.Trail.reading(p, pane)) .reading_focused else .focused); - const selected = roles.selectedOn(if (pardes.Trail.reading(p, pane)) .reading_focused else .focused); + const inks = p.chrome().on(.focus); + const selected = &inks.selection; // Help with `wrap` typed: `▶ SPC t w · Wrap · view` on the cursor row. for ([_]u21{ ' ', '?', 'w', 'r', 'a', 'p' }) |c| p.update(.{ .key = .{ .cp = c } }); _ = try p.render(a); @@ -1043,19 +1042,19 @@ test "a band is drawn in the theme's roles (UX D4): spines in the rule ink, a ch } if (std.mem.eql(u8, cell.grapheme(), "▶")) { cursor_row = row; - // The cursor's `▶` in the key ink on the selection, which - // covers its lead too (UX D4, D5). - try std.testing.expectEqual(pardes.Color{ .rgb = roles.key }, cell.style.fg); + // The cursor's `▶` in the key ink held on the selection, which + // covers its lead too (UX D4, D5; DESIGN.md B1.3). + try std.testing.expectEqual(pardes.Color{ .rgb = selected.key }, cell.style.fg); try std.testing.expectEqual(pardes.Color{ .rgb = selected.ground }, cell.style.bg); } }; try std.testing.expect(spines > 0); const on = layer.cells[cursor_row.? * layer.cols ..][0..layer.cols]; const s_cell = on[Cells.find(on, "SPC t w").?]; - try std.testing.expectEqual(pardes.Color{ .rgb = roles.key }, s_cell.style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = selected.key }, s_cell.style.fg); try std.testing.expect(!s_cell.style.bold); var matched: usize = 0; - for (on) |cell| if (std.meta.eql(cell.style.fg, pardes.Color{ .rgb = roles.match })) { + for (on) |cell| if (std.meta.eql(cell.style.fg, pardes.Color{ .rgb = selected.match })) { try std.testing.expect(cell.style.bold); try std.testing.expectEqual(pardes.Color{ .rgb = selected.ground }, cell.style.bg); matched += 1; |
