diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-25 08:30:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-25 08:47:11 -0300 |
| commit | 58d7434f56a9fef3098cfc191fbd1cb32ec09cfb (patch) | |
| tree | c69ff77501f3fdc5b308632c38ba29de2d9c968b /core/bindings.zig | |
| parent | 59e1178acaabaa5ef16ed829b854542c21394d6f (diff) | |
| parent | eb8ecb8a451ae32d590c42755614b801f9cc0c09 (diff) | |
| download | pardes-58d7434f56a9fef3098cfc191fbd1cb32ec09cfb.tar.gz pardes-58d7434f56a9fef3098cfc191fbd1cb32ec09cfb.zip | |
walk UI M6: the polish round's P1 (vuzlwsvx eb8ecb8a451a: the tag out of rest D1, no dim D9, the delays D12, the right block D3, wrapping D2, a band over a terminal or a kind's pane drawn over its body, the band's height D6, drawing the band D5 in part, the trail at rest D8 in part, asking D13 in part, a load's band rows made again and the tag's rows held to MAX_TAG_ROWS) merged onto M5 (zqwxonrs 59e1178acaab), both on G3's kytxrnnk, resolved by meaning: P1's `// P2:` markers go to P2's roles: the spines a head's rows hang (TagState.Builder.row) and the spines in the rows a tag keeps from rest (draw.zig paintPaneTag) in the rule ink, where P1 drew them in the box's, and the word n walks in the roles' key ink, underlined (draw.zig, D8), where P1 drew it in the box's; one mechanism for dim text: P1's hints go through Builder.right as dim spans, P2's painter draws every dim span in the dim ink of the tag's ground (never the faint attribute), so P2's own dim hint spans in TagState (run, a sequence, rename, roll up, unroll) are P1's lines, and the forward steps, the fold `+N` and an unlit search word are drawn in that dim ink (where P1 kept the line numbers' ink); the spines still hang from the key cells: Builder.keyCells puts them first in every head (TagState, Pick, Prompt's key cell), right() moves spans without reordering them and row() puts its rule spans after, so M5's span-order fix holds under the right block (D3) and the act row (D2); Pick.head is P1's builder with the actions picker's branch (P3) beside the themes picker's, its hint `⏎ or 1-9 apply it · esc` a dim right-block hint, and P2's `|` and other sources' words dim in P1's one-row act row (the acts in the text ink; `.actions` never offered as a source); Prompt.head is P1's right block with P2's D14: an invalid pattern's reason in the err ink and what is shown meanwhile dim stand in the count's place (D3: the count never drops, so the reason is never dropped as a hint would be) and no hints; TagState's rolled level is P1's row-breaking (D2) over P2's registers (D11): the level's children are the registers holding something before it lays them out, so `+N ↓` counts registers not shown, each child its shown value, `⏎` dim; Band.zig: a list step's width is P1's (52 cells at most) with P2's meta counted in it, a row is P1's cutRow with P2's meta after it, only when the whole text and the meta fit (D5: the meta gives way before the text is cut); draw.zig's band cursor row: P1's tint across the `▶ ` lead (D5) on P2's selection ground, the lead's ground only so `▶` keeps the key ink (D4); P2's D7 with P1's D6: the preview's landing line sits ⌈rows/3⌉ down the body the band leaves (fsearch's ctrln: line 6 at body row 3 of 8 under a 5-row band); TESTS (the merge's choices): TagState "a rolled level breaks between its children only ..." asks its spines in the rule role, Trail "... the word n walks is underlined" asks it in the key ink, Band "a band is drawn in the theme's roles ..." asks the cursor's `▶` in the key ink on the selection ground; P1's Trail fold test asks the fold in the dim ink of the reading ground (it asked the line numbers' ink); goldens: the five that conflicted (find, fsearch, lookrange, lsp, selregex) regenerated and every changed row read against P1's: P2's D7 `▸` on a picker's landing line and its sentence on the notice row (find, fsearch, lsp), the message coming back on the notice row when the picker closes (find promoted and cancel, fsearch landed, lsp), P3's `1 message` for the walked pane's one entry (find), P2's D14 (fsearch: the `▪` marks gone, the hits on the hit ground #5e4923, `▸` in the key ink #bada9d), the third-of-the-body placement (fsearch ctrln), P2's inks (the reading tint #2c2c0f, the key ink #bada9d for key cells and the n word, the dim ink #79836f for the plain word and the hints where the faint attribute was, the notice row's dim #6f7d75: fsearch, lookrange, selregex); no other golden moved; core-test 1083/1254 (171 skipped), process-test 0 of 147 failed (3 skipped, gui-only)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/bindings.zig')
| -rw-r--r-- | core/bindings.zig | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/core/bindings.zig b/core/bindings.zig index 96ce1359..a8b81842 100644 --- a/core/bindings.zig +++ b/core/bindings.zig @@ -45,26 +45,25 @@ pub const Info = struct { /// Its key cell in the head (`␣` for SPC). cell: []const u8, label: []const u8, - /// How long after it the level shows (SPEC §3.3). + /// How long after it the level shows (SPEC §3.3): the tag changes + /// nothing before (UX D12), so `gg` and a fast `SPC f s` never touch it; + /// its keys show on the notice row's right end at once (Messages). delay_ns: u64, - /// Its key cell is written at once (SPC, `"`, `C-w`); the others change - /// nothing until the delay is up, so `gg` never touches the tag. - at_once: bool, node: *const Node, }; const ms = std.time.ns_per_ms; pub const info = std.EnumArray(Root, Info).init(.{ - .leader = .{ .key = .{ .cp = config.leader[0].cp }, .cell = "␣", .label = "SPC", .delay_ns = 250 * ms, .at_once = true, .node = &leader_tree }, - .window = .{ .key = .{ .cp = config.window_prefix[0].cp, .ctrl = true }, .cell = "C-w", .label = "window", .delay_ns = 250 * ms, .at_once = true, .node = &window_tree }, - .goto = .{ .key = .{ .cp = config.goto_prefix }, .cell = "g", .label = "goto", .delay_ns = 500 * ms, .at_once = false, .node = &goto_tree }, - .match = .{ .key = .{ .cp = config.match_prefix }, .cell = "m", .label = "match", .delay_ns = 500 * ms, .at_once = false, .node = &match_tree }, - .view = .{ .key = .{ .cp = config.view_prefix }, .cell = "z", .label = "view", .delay_ns = 500 * ms, .at_once = false, .node = &view_tree }, - .view_sticky = .{ .key = .{ .cp = config.view_prefix_sticky }, .cell = "Z", .label = "view", .delay_ns = 500 * ms, .at_once = false, .node = &view_sticky_tree }, - .prev = .{ .key = .{ .cp = config.prev_prefix }, .cell = "[", .label = "previous", .delay_ns = 500 * ms, .at_once = false, .node = &prev_tree }, - .next = .{ .key = .{ .cp = config.next_prefix }, .cell = "]", .label = "next", .delay_ns = 500 * ms, .at_once = false, .node = &next_tree }, - .register = .{ .key = .{ .cp = config.register_prefix }, .cell = "\"", .label = "registers", .delay_ns = 300 * ms, .at_once = true, .node = ®ister_tree }, + .leader = .{ .key = .{ .cp = config.leader[0].cp }, .cell = "␣", .label = "SPC", .delay_ns = 250 * ms, .node = &leader_tree }, + .window = .{ .key = .{ .cp = config.window_prefix[0].cp, .ctrl = true }, .cell = "C-w", .label = "window", .delay_ns = 250 * ms, .node = &window_tree }, + .goto = .{ .key = .{ .cp = config.goto_prefix }, .cell = "g", .label = "goto", .delay_ns = 500 * ms, .node = &goto_tree }, + .match = .{ .key = .{ .cp = config.match_prefix }, .cell = "m", .label = "match", .delay_ns = 500 * ms, .node = &match_tree }, + .view = .{ .key = .{ .cp = config.view_prefix }, .cell = "z", .label = "view", .delay_ns = 500 * ms, .node = &view_tree }, + .view_sticky = .{ .key = .{ .cp = config.view_prefix_sticky }, .cell = "Z", .label = "view", .delay_ns = 500 * ms, .node = &view_sticky_tree }, + .prev = .{ .key = .{ .cp = config.prev_prefix }, .cell = "[", .label = "previous", .delay_ns = 500 * ms, .node = &prev_tree }, + .next = .{ .key = .{ .cp = config.next_prefix }, .cell = "]", .label = "next", .delay_ns = 500 * ms, .node = &next_tree }, + .register = .{ .key = .{ .cp = config.register_prefix }, .cell = "\"", .label = "registers", .delay_ns = 300 * ms, .node = ®ister_tree }, }); /// SPC's groups by their key, as the spec names them (Appendix A). @@ -590,14 +589,15 @@ test "\" shows the registers rolled, the ones holding something, each its value p.clock.now_ns = 5 * std.time.ns_per_s; p.clock.stepped_ns = p.clock.now_ns; p.sync(); - // Its key cell at once, the level 300 ms on. + // Nothing in the tag until the level shows 300 ms on (UX D12). + const rest = try a.dupe(u8, try tagline.tagText(p, a, pane)); p.update(.{ .key = .{ .cp = '"' } }); - try std.testing.expect(std.mem.endsWith(u8, try tagline.tagText(p, a, pane), " \" …")); + try std.testing.expectEqualStrings(rest, try tagline.tagText(p, a, pane)); p.advance(p.clock.now_ns); try std.testing.expectEqual(p.clock.now_ns + 300 * std.time.ns_per_ms, p.view().tag_state.due_ns); p.clock.now_ns = p.view().tag_state.due_ns; const rolled = try tagline.tagText(p, a, pane); - try std.testing.expect(std.mem.indexOf(u8, rolled, " \" ▸ \" self.dirty = true; a const best = rank(q… n ab⏎ p …proj/core/Query.zig % /test.txt . o # 1 ") != null); + try std.testing.expect(std.mem.indexOf(u8, rolled, "\" ▸ \" self.dirty = true; a const best = rank(q… n ab⏎ p …proj/core/Query.zig % /test.txt . o # 1 ") != null); // Its ⏎ in the dim ink. const h = (try @import("TagState.zig").head(p, a, pane)).?; const nl = std.mem.indexOf(u8, h.text, "ab⏎").? + 2; @@ -654,13 +654,13 @@ test "\" shows the registers rolled, the ones holding something, each its value try std.testing.expect(std.mem.indexOf(u8, band.items, "return best;") != null); // Enter chooses it: its verbs, rolled. p.update(.{ .key = .{ .cp = Key.enter } }); - try std.testing.expect(std.mem.indexOf(u8, try tagline.tagText(p, a, pane), " \" a ▸ p after P before R replace y into") != null); + try std.testing.expect(std.mem.indexOf(u8, try tagline.tagText(p, a, pane), "\" a ▸ p after P before R replace y into") != null); try std.testing.expect(!p.view().tag_state.unrolled); // Backspace: the registers again; a register's own key goes down too. p.update(.{ .key = .{ .cp = Key.backspace } }); - try std.testing.expect(std.mem.indexOf(u8, try tagline.tagText(p, a, pane), " \" ▸ \" self.dirty") != null); + try std.testing.expect(std.mem.indexOf(u8, try tagline.tagText(p, a, pane), "\" ▸ \" self.dirty") != null); p.update(.{ .key = .{ .cp = 'a' } }); - try std.testing.expect(std.mem.indexOf(u8, try tagline.tagText(p, a, pane), " \" a ▸ p after") != null); + try std.testing.expect(std.mem.indexOf(u8, try tagline.tagText(p, a, pane), "\" a ▸ p after") != null); // p pastes it after the selection, and the tag is at rest. p.update(.{ .key = .{ .cp = 'p' } }); try std.testing.expect(std.mem.indexOf(u8, pane.file.?.content, "const best = rank(q, name) orelse continue;") != null); |
