summaryrefslogtreecommitdiff
path: root/core/draw.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 12:38:27 -0300
committerGabriel Schneider <[email protected]>2026-11-25 12:50:44 -0300
commite6c384833912598d65c509f0d3a7b713fab0a8eb (patch)
tree8392991253b366e4152df327528ba1c4f8af005f /core/draw.zig
parent46f004ba04ad6d6299c8967d6890b8f7110db88a (diff)
parent7e4d1d727487455376c54695bb13683b9d1e5cc9 (diff)
downloadpardes-e6c384833912598d65c509f0d3a7b713fab0a8eb.tar.gz
pardes-e6c384833912598d65c509f0d3a7b713fab0a8eb.zip
walk UI M9: X3's seed 109/162 fix (wkylslmo 7e4d1d727487, one change on X2's suvlqwul: a walk step never refuses and never takes a row its column cannot give: a walked reading pane's tag at rest folds to its newest step, then cuts its path from the left, `…` and the basename whole, worked out each time from the pane's own rect by tagline.folded (Fold{whole, cut, squeezed}), restPath writing the cut name; Trail.lift takes a row at a time from the column (layout.giveRow) while the column has one; draw.zig tagTintRange/paintPaneTag and Prompt.unlit take `.whole`; the tree.zig placement test runs under the walk default, 300 seeds) merged onto M8 (tspqtroz), resolved by meaning: no text conflict (X3's tagline, Trail, layout.giveRow and its one-line hunks in draw.zig and Prompt.zig sit beside X1's and X2's); THE ORDER X3 ASKED TO CHECK: X1 (E5.2) gives each pane of a column its width before its height in layout.compute, so that a band host's floor (floorRows: max(wantedTagRows, headRows + band)) wraps its tag at the width it will have; compute starts from zeroed rects, so in that pass a pane has `w` and `h == 0`; X3's folded reads both: on X3's own tree `w == 0` there returned before any cut (and wantedTagRows returned the last sync's rows); on the merge `h == 0` read as a pane with no rows, so a walked reading pane hosting a band had its path cut to its basename in the floor while the sync after it, with the real height, kept it whole: the floor counted fewer rows above the body than the tag took; RUN (TEST FIRST): Trail.zig "a band on a walked reading pane keeps it a body of 60 % ..." (40 columns, the reader's path some 230 cells, its tag at rest 6 rows or more; its share of the column swept from 12 rows to 30, Help with a query nothing matches, a 4-row band): fails on the merge at Trail.zig:1019, the body under 60 % of the pane (UX D6, E3); a user could have hit it on a walked reading pane with a long path in a narrow column, any band (a level, Help, a picker) opened on it; THE FIX (tagline.folded): `r.h == 0` reads as not laid out, as `r.w == 0` does: no cut, the tag at rest whole; the floor then reserves the whole tag and the sync, given at least that many rows, finds it fits: both count the same rows; where the column cannot give them, the sync cuts as X3 does; the witnesses X3 named pass: tree.zig "random placements, refused or not ..." (shell-test, filtered 8/8) and P1's Pick "after Enter the list is a word in the reader's trail ..." (core-test, filtered 11/11); core-test 1097/1268 (171 skipped: M8's 1095 + X3's test + this one), process-test 0 of 147 failed (3 skipped): no golden moved
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/draw.zig')
-rw-r--r--core/draw.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/draw.zig b/core/draw.zig
index 685f67ea..8f690e8e 100644
--- a/core/draw.zig
+++ b/core/draw.zig
@@ -721,7 +721,11 @@ fn tagTintRange(p: *const Pardes, pane: *const Pane, tag: []const u8, prefix_len
} else return null;
const basename = if (std.mem.lastIndexOfScalar(u8, name, '/')) |slash| slash + 1 else 0;
if (basename == name.len) return null;
- return .{ .lo = start + basename, .hi = start + name.len };
+ // A walked file's path cut from its left: a `…` for the bytes it drops
+ // (tagline.folded), never its basename's.
+ const cut = if (pane.file != null) tagline.folded(p, pane).cut else 0;
+ const dots: usize = if (cut > 0) "…".len else 0;
+ return .{ .lo = start + dots + basename - cut, .hi = start + dots + name.len - cut };
}
/// A header or a notice band as a tag layer: `viewport.h` rows, line `top`
@@ -1102,7 +1106,7 @@ fn paintPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane,
const ahead = tagline.forwardSpan(p, pane);
if (ahead[0] < ahead[1]) inkTag(p, s, shown, lines[0..rows], top, tx, tag_y, tw, ahead[0], @min(ahead[1], first_line.len), inks.dim, false);
if (pane.file != null and pane.trail.n > 0 and !pardes.Trail.outOfRest(p, pane)) {
- const kept = tagline.folded(p, pane);
+ const kept = tagline.folded(p, pane).whole;
const t = &pane.trail;
const first: usize = @intFromBool(t.steps[0] == .owner);
if (t.isFolded(first, kept)) {