diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-28 17:56:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-28 21:05:39 -0300 |
| commit | be98a09274b597649fe8a53eb3ce43f7151201d7 (patch) | |
| tree | b3a6d15c6d21e4fde48c7dfd6aeab5408f6a97ce | |
| parent | f8fb785c9572855943713181d738b72ea494b7d5 (diff) | |
| download | pardes-be98a09274b597649fe8a53eb3ce43f7151201d7.tar.gz pardes-be98a09274b597649fe8a53eb3ce43f7151201d7.zip | |
draw: no dashed hint on hovering a column's edge or corner (columns resize by their grips; a drag still draws its guide); cornerdrag, cornerdrag-left, tagalign2col, windowops goldens: the hover frames without the dashes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| -rw-r--r-- | src/draw.zig | 25 | ||||
| -rw-r--r-- | src/look.zig | 6 | ||||
| -rw-r--r-- | test/snapshots/cornerdrag-left.golden | 30 | ||||
| -rw-r--r-- | test/snapshots/cornerdrag-left.snap | 8 | ||||
| -rw-r--r-- | test/snapshots/cornerdrag.golden | 50 | ||||
| -rw-r--r-- | test/snapshots/cornerdrag.snap | 3 | ||||
| -rw-r--r-- | test/snapshots/tagalign2col.golden | 35 | ||||
| -rw-r--r-- | test/snapshots/windowops.golden | 113 | ||||
| -rw-r--r-- | test/snapshots/windowops.snap | 4 |
9 files changed, 71 insertions, 203 deletions
diff --git a/src/draw.zig b/src/draw.zig index f4c43631..e141ce31 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -14,7 +14,6 @@ const modal = @import("modal.zig"); const tracy = @import("tracy.zig"); const colors = @import("colors.zig"); const edit = @import("edit.zig"); -const mouse = @import("mouse.zig"); const tagline = @import("tagline.zig"); const body_layer = @import("body_layer.zig"); const Messages = @import("Messages.zig"); @@ -697,28 +696,8 @@ pub fn render(p: *Pardes, arena: std.mem.Allocator) !*Surface { s.addRegion(.{ .kind = .guide, .rect = .{ .x = d.cur_x, .y = placement.row, .w = 1, .h = 1 } }); }; }, - // A hover left over from a bigger window points past this one. - .none, .select => if (p.pointer_inside and p.hover_row < s.rows and p.hover_col < s.cols) { - // hover hints on a pane's own trailing edge - var c: usize = 0; - while (c + 1 < p.ncol) : (c += 1) { - if (p.hover_col == p.col_x[c] + p.col_w[c] -| 1) { - var row: u16 = p.topBarHeight(); - while (row < s.rows) : (row += 1) s.overlayDash(p.hover_col, row, "╎"); - s.addRegion(.{ .kind = .guide, .rect = .{ .x = p.hover_col, .y = p.topBarHeight(), .w = 1, .h = s.rows -| p.topBarHeight() } }); - } - } - // No hint over a pane's last row: a row of text is no handle; two - // panes resize by the rule between them or by the grip. - for (0..p.ncol -| 1) |cn| { - if (p.hover_col != p.col_x[cn] + p.col_w[cn] -| 1) continue; - if (mouse.seamIdxAt(p, cn, p.hover_row) != null) continue; - if (mouse.seamIdxAt(p, cn + 1, p.hover_row) == null) continue; - var col = p.col_x[cn + 1]; - while (col < p.col_x[cn + 1] + p.col_w[cn + 1]) : (col += 1) s.overlayDash(col, p.hover_row, "╌"); - s.addRegion(.{ .kind = .guide, .rect = .{ .x = p.col_x[cn + 1], .y = p.hover_row, .w = p.col_w[cn + 1], .h = 1 } }); - } - }, + // A hover draws no hint: columns resize by their grips. + .none, .select => {}, } // debug overlay: a small stats box drawn last, top-right ("Debug") diff --git a/src/look.zig b/src/look.zig index ede7d910..1a574212 100644 --- a/src/look.zig +++ b/src/look.zig @@ -2010,15 +2010,9 @@ test "Look hover waits without mutating the pane and input cancels it" { const seam_x = p.col_x[0] + p.col_w[0] - 1; p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = seam_x, .row = body_y } }); - _ = frame.reset(.retain_capacity); - const hovered_seam = try p.render(frame.allocator()); - try std.testing.expectEqualStrings("╎", hovered_seam.at(seam_x, body_y).grapheme()); p.update(.pointer_leave); try std.testing.expect(p.look_hover_wait == null); try std.testing.expect(p.look_hover_preview == null); - _ = frame.reset(.retain_capacity); - const left_seam = try p.render(frame.allocator()); - try std.testing.expect(!std.mem.eql(u8, "╎", left_seam.at(seam_x, body_y).grapheme())); const blank_x = rect.x + config.GUTTER + config.PREFIX_W + 30; p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = blank_x, .row = body_y } }); diff --git a/test/snapshots/cornerdrag-left.golden b/test/snapshots/cornerdrag-left.golden index 4d2d6d43..2c42d746 100644 --- a/test/snapshots/cornerdrag-left.golden +++ b/test/snapshots/cornerdrag-left.golden @@ -21,36 +21,6 @@ | ls | w.txt == snap hover-corner grid=100x31 cursor=54,11 -|1: New Tty Find Grep Joincol Delcol ╎ New Tty Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag-left/cwd Tty+bash S╎ /tmp/pardes-snap/cornerdrag-left/cwd Tty+bash Sa -|3: ve Mode Filter Collapse Del ╎ ve Mode Filter Collapse Del -|4: ls ╎ ls -|5: w.txt ╎ w.txt -|6: ╎ -|7: ╎ /tmp/pardes-snap/cornerdrag-left/cwd Tty+bash Sa -|8: ╎ ve Mode Filter Collapse Del -|9: ╎ ls -|10: ╎ w.txt -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: /tmp/pardes-snap/cornerdrag-left/cwd Tty+bash S╎ -|18: ve Mode Filter Collapse Del ╎ -|19: ls ╎ -|20: w.txt ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ == snap hover-left-corner grid=100x31 cursor=54,11 == snap corner-drag grid=100x31 cursor=54,11 |1: New Tty Find Grep Joincol D╎lcol New Tty Find Grep Joincol Delcol diff --git a/test/snapshots/cornerdrag-left.snap b/test/snapshots/cornerdrag-left.snap index 3b95c01e..124f6351 100644 --- a/test/snapshots/cornerdrag-left.snap +++ b/test/snapshots/cornerdrag-left.snap @@ -17,14 +17,12 @@ stable 400 5000 key a-n stable 700 15000 snap right-split -# hover col 1's corner: the v hint runs full height AND col 1's h hint lights, -# from col 51 rightward. Before this that row was dark on the handle — only the -# hovered column's seam lit, and the hovered cell belongs to col 0 +# hover col 1's corner: hovering draws no hints any more, so the frame is +# empty; the drags below still show their previews motion 50 5 stable 400 5000 snap hover-corner -# CONTROL: col 0's own seam is still a left-column corner, its h hint drawn -# through the handle from col 1 to the handle itself, unchanged +# CONTROL: col 0's own seam, hovered: no hint either motion 50 16 stable 400 5000 snap hover-left-corner diff --git a/test/snapshots/cornerdrag.golden b/test/snapshots/cornerdrag.golden index 246840bc..40695375 100644 --- a/test/snapshots/cornerdrag.golden +++ b/test/snapshots/cornerdrag.golden @@ -1,35 +1,25 @@ == snap hover-corner grid=100x31 cursor=4,6 | Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit -| New Tty Find Grep Joincol Delcol ╎ New Tty Find Grep Joincol Delcol -| /tmp/pardes-snap/cornerdrag/cwd Tty+bash Save M╎ /tmp/pardes-snap/cornerdrag/cwd Tty+bash Save Mo -| de Filter Collapse Del ╎ de Filter Collapse Del -| ls ╎ ls -| w.txt ╎ w.txt -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| /tmp/pardes-snap/cornerdrag/cwd Tty+bash Save M╎ -| de Filter Collapse Del ╎ -| ls ╎ -| w.txt ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ +| New Tty Find Grep Joincol Delcol New Tty Find Grep Joincol Delcol +| /tmp/pardes-snap/cornerdrag/cwd Tty+bash Save Mo /tmp/pardes-snap/cornerdrag/cwd Tty+bash Save Mo +| de Filter Collapse Del de Filter Collapse Del +| ls ls +| w.txt w.txt +| +| +| +| +| +| +| +| +| +| +| +| /tmp/pardes-snap/cornerdrag/cwd Tty+bash Save Mo +| de Filter Collapse Del +| ls +| w.txt == snap edge-drag grid=100x31 cursor=4,6 |1: New Tty Find Grep Joincol D╎lcol New Tty Find Grep Joincol Delcol |2: /tmp/pardes-snap/cornerdrag╎cwd Tty+bash Save Mo /tmp/pardes-snap/cornerdrag/cwd Tty+bash Save Mo diff --git a/test/snapshots/cornerdrag.snap b/test/snapshots/cornerdrag.snap index 0fbfe8a4..69140c17 100644 --- a/test/snapshots/cornerdrag.snap +++ b/test/snapshots/cornerdrag.snap @@ -8,7 +8,8 @@ file w.txt x start 31 100 -n 3 wait 8000 w.txt stable 700 20000 -# hover the corner: BOTH hints light, before anything is grabbed +# hover the corner: no hints (columns resize by their grips); the frame +# stays empty motion 50 16 stable 400 5000 snap hover-corner diff --git a/test/snapshots/tagalign2col.golden b/test/snapshots/tagalign2col.golden index 3fe442db..411a3288 100644 --- a/test/snapshots/tagalign2col.golden +++ b/test/snapshots/tagalign2col.golden @@ -10,33 +10,8 @@ |7: ls |8: deep == snap widened grid=160x31 cursor=4,9 -|1: New Tty Find Grep Joincol Delcol ╎ New Tty Find Grep Joincol Delcol -|2: /tmp/pardes-snap/tagalign2col/cwd/deep/proj/document.txt Save Tty Collapse Del ╎ /tmp/pardes-snap/tagalign2col/cwd Tty+bash Save Mode Filte -|3: 1 alpha ╎ r Collapse Del -|4: 2 beta ╎ ls -|5: 3 gamma ╎ deep -|6: /tmp/pardes-snap/tagalign2col/cwd Tty+bash Save Mode Filter Collapse Del ╎ -|7: ls ╎ -|8: deep ╎ -|9: ╎ -|10: ╎ -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: ╎ -|18: ╎ -|19: ╎ -|20: ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ +|1: New Tty Find Grep Joincol Delcol New Tty Find Grep Joincol Delcol +|2: /tmp/pardes-snap/tagalign2col/cwd/deep/proj/document.txt Save Tty Collapse Del /tmp/pardes-snap/tagalign2col/cwd Tty+bash Save Mode Filte +|3: 1 alpha r Collapse Del +|4: 2 beta ls +|5: 3 gamma deep diff --git a/test/snapshots/windowops.golden b/test/snapshots/windowops.golden index d93f2da6..3e1f0d0a 100644 --- a/test/snapshots/windowops.golden +++ b/test/snapshots/windowops.golden @@ -1,66 +1,26 @@ == snap hover-v grid=100x31 cursor=4,6 | Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit -| New Tty Find Grep Joincol Delcol ╎ New Tty Find Grep Joincol Delcol -| /tmp/pardes-snap/windowops/cwd Tty+bash Save Mo╎ /tmp/pardes-snap/windowops/cwd Tty+bash Save Mod -| e Filter Collapse Del ╎ e Filter Collapse Del -| ls ╎ ls -| w.txt ╎ w.txt -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| /tmp/pardes-snap/windowops/cwd Tty+bash Save Mo╎ -| e Filter Collapse Del ╎ -| ls ╎ -| w.txt ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ +| New Tty Find Grep Joincol Delcol New Tty Find Grep Joincol Delcol +| /tmp/pardes-snap/windowops/cwd Tty+bash Save Mod /tmp/pardes-snap/windowops/cwd Tty+bash Save Mod +| e Filter Collapse Del e Filter Collapse Del +| ls ls +| w.txt w.txt +| +| +| +| +| +| +| +| +| +| +| +| /tmp/pardes-snap/windowops/cwd Tty+bash Save Mod +| e Filter Collapse Del +| ls +| w.txt == snap hover-h grid=100x31 cursor=4,6 -|1: New Tty Find Grep Joincol Delcol New Tty Find Grep Joincol Delcol -|2: /tmp/pardes-snap/windowops/cwd Tty+bash Save Mod /tmp/pardes-snap/windowops/cwd Tty+bash Save Mod -|3: e Filter Collapse Del e Filter Collapse Del -|4: ls ls -|5: w.txt w.txt -|6: -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: /tmp/pardes-snap/windowops/cwd Tty+bash Save Mod -|18: e Filter Collapse Del -|19: ls -|20: w.txt -|21: -|22: -|23: -|24: -|25: -|26: -|27: -|28: -|29: -|30: == snap border-drag grid=100x31 cursor=4,6 |1: New Tty Find Grep Joincol Delcol ╎ New Tty Find Grep Joincol Delcol |2: /tmp/pardes-snap/windowops/cwd Tty+ba╎h Save Mod /tmp/pardes-snap/windowops/cwd Tty+bash Save Mod @@ -93,14 +53,6 @@ |29: ╎ |30: ╎ == snap border-done grid=100x31 cursor=4,6 -|1: New Tty Find Grep Joincol Delcol ╎ New Tty Find Grep Joincol Delcol -|2: /tmp/pardes-snap/windowops/cwd Tty+ba╎ /tmp/pardes-snap/windowops/cwd Tty+bash Save Mode Filter C -|3: h Save Mode Filter Collapse Del ╎ ollapse Del -|4: ls ╎ ls -|5: w.txt ╎ w.txt -|17: /tmp/pardes-snap/windowops/cwd Tty+ba╎ -|18: h Save Mode Filter Collapse Del ╎ -== snap hborder-done grid=100x31 cursor=4,6 |1: New Tty Find Grep Joincol Delcol New Tty Find Grep Joincol Delcol |2: /tmp/pardes-snap/windowops/cwd Tty+bas /tmp/pardes-snap/windowops/cwd Tty+bash Save Mode Filter C |3: h Save Mode Filter Collapse Del ollapse Del @@ -113,14 +65,14 @@ |10: |11: |12: -|13: /tmp/pardes-snap/windowops/cwd Tty+bas -|14: h Save Mode Filter Collapse Del -|15: ls -|16: w.txt -|17: -|18: -|19: -|20: +|13: +|14: +|15: +|16: +|17: /tmp/pardes-snap/windowops/cwd Tty+bas +|18: h Save Mode Filter Collapse Del +|19: ls +|20: w.txt |21: |22: |23: @@ -131,6 +83,15 @@ |28: |29: |30: +== snap hborder-done grid=100x31 cursor=4,6 +|13: /tmp/pardes-snap/windowops/cwd Tty+bas +|14: h Save Mode Filter Collapse Del +|15: ls +|16: w.txt +|17: +|18: +|19: +|20: == snap move-preview grid=100x31 cursor=4,17 == snap moved grid=100x31 cursor=4,17 == snap altn grid=100x31 cursor=4,22 diff --git a/test/snapshots/windowops.snap b/test/snapshots/windowops.snap index e003292c..7eb82148 100644 --- a/test/snapshots/windowops.snap +++ b/test/snapshots/windowops.snap @@ -1,9 +1,9 @@ -# hover resize hints, border drags, grip resize, move drag, Alt-n, Ctrl-w focus (window mode), Debug box +# hover (no hints), border drags, grip resize, move drag, Alt-n, Ctrl-w focus (window mode), Debug box file w.txt x start 31 100 -n 3 wait 8000 w.txt stable 700 20000 -# hover over the left column's last col: vertical dash hint +# hover over the left column's last col: no hint, columns resize by their grips motion 50 10 stable 400 5000 snap hover-v |
