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/Messages.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/Messages.zig')
| -rw-r--r-- | core/Messages.zig | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/core/Messages.zig b/core/Messages.zig index 6231e3d1..2cb196f6 100644 --- a/core/Messages.zig +++ b/core/Messages.zig @@ -732,6 +732,10 @@ pub fn noticeRow(p: *const Pardes, width: usize, out: *[notice_row_cap]u8) Row { r.writeAll("SPC e walk") catch {} else if (m.len > 0) r.print("{d} message{s} \u{b7} SPC h m", .{ m.len, if (m.len == 1) "" else "s" }) catch {}; + // The keys of a root whose level waits for its delay, at once (UX D12: + // vim's showcmd; the tag stays at rest until the level shows). + var keys: [64]u8 = undefined; + if (pardes.TagState.pending(p, p.view(), &keys)) |typed| r.print("{s}{s}", .{ if (r.end > 0) " " else "", typed }) catch {}; const tail = r.buffered(); // The left cut to make room for the right, a blank between them. const tail_w = panes.File.displayWidth(tab, tail); @@ -1332,6 +1336,34 @@ test "a burst of the same message is one message, counted, and moves nothing on try std.testing.expect(std.mem.endsWith(u8, row.text[0..row.left], "3 files \u{d7}10")); } +test "a question never adds a row to its tag: at every width the asking tag takes the rows the tag takes at rest, its answers always shown, the question cut before them" { + const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 30 }); + defer p.deinit(); + const pane = try p.setTestFile("one\n"); + const id = p.view().active; + // A short name: the tag's rows have room for it and the answers. + p.gpa.free(pane.file.?.path); + pane.file.?.path = try p.gpa.dupe(u8, "/t/c.zig"); + const f = &pane.file.?; + f.saved_hash = panes.File.fileHash(f); + for ([_]u21{ 'G', 'o', 'f', Key.escape }) |cp| p.update(.{ .key = .{ .cp = cp } }); + // The tag's own words cut to one, so the question is the longer. + pane.tag.own = try p.gpa.dupe(u8, " Put"); + p.update(.{ .file_changed = .{ .pane = .at(id), .bytes = "zero\n" } }); + _ = p.messages.waiting(pane) orelse return error.NotAsked; + var frame = std.heap.ArenaAllocator.init(std.testing.allocator); + defer frame.deinit(); + for (56..161) |cols| { + p.update(.{ .resize = .{ .cols = @intCast(cols), .rows = 30 } }); + p.sync(); + const rest = pardes.layout.wantedTagRows(p, id); + try std.testing.expect(pane.tag_rows <= @max(rest, 1)); + const shown = try pardes.tagline.tagText(p, frame.allocator(), pane); + for ([_][]const u8{ "r Reload", "k Keep mine", "d Diff" }) |word| try std.testing.expect(std.mem.indexOf(u8, shown, word) != null); + _ = frame.reset(.retain_capacity); + } +} + test "a file changed on disk under unsaved text asks in its tag and never takes the keyboard: SPC e's keyboard answers, d shows the disk's lines as ghosts, Esc leaves it waiting, B2 on Reload reads it again" { const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 20 }); defer p.deinit(); @@ -1368,9 +1400,11 @@ test "a file changed on disk under unsaved text asks in its tag and never takes try std.testing.expect(std.mem.indexOf(u8, prefix, "changed on disk") == null); // The tag's own text is no one's to edit meanwhile. try std.testing.expect((try pardes.TagState.head(p, frame.allocator(), pane)) != null); - // Out of rest (SPC: its key cell at once) the level's head, not the - // question; at rest again, the question. + // Out of rest (SPC's level shown) the level's head, not the question; + // at rest again, the question. p.update(.{ .key = .{ .cp = ' ' } }); + p.advance(p.clock.now_ns); + p.clock.now_ns = p.view().tag_state.due_ns; try std.testing.expect(std.mem.indexOf(u8, try pardes.tagline.tagText(p, frame.allocator(), pane), "changed on disk") == null); p.update(.{ .key = .{ .cp = Key.escape } }); try std.testing.expect(std.mem.indexOf(u8, try pardes.tagline.tagText(p, frame.allocator(), pane), "changed on disk") != null); |
