From 266515537a917154ef4736a1d6b1cc97be23fced Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 22:17:47 -0300 Subject: mouse: no drag guides, and columns resize by their grips alone A drag draws no guide lines: the dashes where a pane or column would land, the carried column's rail and the held seam's dashes are gone, with the guide region kind, Surface.overlayDash, the rail's Region.clip and MAX_GUIDES; the gui's floating draw group is the debug box's alone. The line between two columns is no resize handle: Drag.border_v and its corner variant are gone, with clampBorderCol and the unused chromeTarget. A press there is a press in the pane under it (a sweep). A column resizes by its grip, a pane by its grip or, in a window, the rule above it (border_h, unchanged). Tests: the corner and border-drag unit tests and the cornerdrag and cornerdrag-left tty cases are deleted; windowops loses its border drag and tagalign2col widens its column by the grip; colgrip, shrinktag and windowops goldens drop the guides; a unit test pins that a press on the line between columns sweeps and resizes nothing. The cheatsheet, themes, render-pipeline notes and changelog say so. Co-Authored-By: Claude Opus 5.5 --- test/snapshots/colgrip.golden | 147 ++++----------------- test/snapshots/cornerdrag-left.golden | 86 ------------ test/snapshots/cornerdrag.golden | 239 ---------------------------------- test/snapshots/shrinktag.golden | 1 - test/snapshots/windowops.golden | 162 +++++++---------------- 5 files changed, 75 insertions(+), 560 deletions(-) delete mode 100644 test/snapshots/cornerdrag-left.golden delete mode 100644 test/snapshots/cornerdrag.golden (limited to 'test/snapshots') diff --git a/test/snapshots/colgrip.golden b/test/snapshots/colgrip.golden index a76642b1..a64be69c 100644 --- a/test/snapshots/colgrip.golden +++ b/test/snapshots/colgrip.golden @@ -27,143 +27,46 @@ |1: 0-1 d,#887455, 2-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#f4c086, 52-99 #becfc4,#314738, == snap resize-drag grid=100x24 cursor=54,6 | Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit -| New Term Find Grep Joincol Delcol ╎ New Term Find Grep Joincol Delcol -| /tmp/pardes-snap/colgrip/cwd/w.txt Sa╎e Term Col /tmp/pardes-snap/colgrip/cwd Term+bash Save Mode -| lapse Follow Del ╎ Filter Collapse Del -| 1 x ╎ ls -| ╎ w.txt -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ -| ╎ +| New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol +| /tmp/pardes-snap/colgrip/cwd/w.txt Save Term Col /tmp/pardes-snap/colgrip/cwd Term+bash Save Mode +| lapse Follow Del Filter Collapse Del +| 1 x ls +| w.txt == style resize-drag grid=100x24 -|1: 0-1 d,#887455, 2-38 #b2c3b8,#1d2824, 39-49 #f4c086,#1d2824, 50-51 #f4c086,#f4c086, 52-99 #becfc4,#314738, -|2: 0-1 d,#496656, 2-30 #b2c3b8,#1d2824, 31-36 #d3b0d9,#1d2824, 37-38 #b2c3b8,#1d2824, 39-39 #f4c086,#1d2824, 40-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#add38a, 52-80 #becfc4,#314738, 81-90 #dfbce5,#314738, 91-99 #becfc4,#314738, -|3: 0-1 d,#1d2824, 2-38 #b2c3b8,#1d2824, 39-49 #f4c086,#1d2824, 50-52 #f4c086,#314738, 53-99 #becfc4,#314738, -|4: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-38 #e5eee5,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-51 #f4c086,#0d1410, 52-99 #e5eee5,#0d1410, -|5: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-51 #f4c086,#0d1410, 52-99 #e5eee5,#0d1410, -|6: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|7: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|8: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|9: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|10: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|11: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|12: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|13: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|14: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|15: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|16: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|17: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|18: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|19: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|20: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|21: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|22: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, -|23: 0-0 d,#608269, 1-38 d,#0d1410, 39-49 #f4c086,#0d1410, 50-50 #f4c086,#608269, 51-99 #f4c086,#0d1410, == snap resize-done grid=100x24 cursor=44,6 |1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol |2: /tmp/pardes-snap/colgrip/cwd/w.txt Sav /tmp/pardes-snap/colgrip/cwd Term+bash Save Mode Filter Co |3: e Term Collapse Follow Del llapse Del |4: 1 x ls |5: w.txt -|6: -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: -|18: -|19: -|20: -|21: -|22: -|23: == snap reorder-drag grid=100x24 cursor=44,6 -|4: ╎ 1 x ls -|5: ╎ w.txt -|6: ╎ -|7: ╎ -|8: ╎ -|9: ╎ -|10: ╎ -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: ╎ -|18: ╎ -|19: ╎ -|20: ╎ -|21: ╎ -|22: ╎ -|23: ╎ == style reorder-drag grid=100x24 |1: 0-1 d,#887455, 2-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#f4c086, 42-99 #becfc4,#314738, |2: 0-1 d,#496656, 2-30 #b2c3b8,#1d2824, 31-36 #d3b0d9,#1d2824, 37-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#add38a, 42-70 #becfc4,#314738, 71-80 #dfbce5,#314738, 81-99 #becfc4,#314738, |3: 0-1 d,#1d2824, 2-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#314738, 42-99 #becfc4,#314738, -|4: 0-0 d,#608269, 1-4 #f4c086,#0d1410, 5-6 #59675c,#0d1410, 7-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|5: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-41 #f4c086,#0d1410, 42-99 #e5eee5,#0d1410, -|6: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|7: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|8: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|9: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|10: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|11: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|12: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|13: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|14: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|15: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|16: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|17: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|18: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|19: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|20: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|21: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|22: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, -|23: 0-0 d,#608269, 1-39 #f4c086,#0d1410, 40-40 #f4c086,#608269, 41-99 #f4c086,#0d1410, +|4: 0-0 d,#608269, 1-4 d,#0d1410, 5-6 #59675c,#0d1410, 7-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, +|5: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-41 d,#0d1410, 42-99 #e5eee5,#0d1410, +|6: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|7: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|8: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|9: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|10: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|11: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|12: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|13: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|14: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|15: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|16: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|17: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|18: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|19: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|20: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|21: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|22: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, +|23: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, == snap reorder-done grid=100x24 cursor=4,6 |1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol |2: /tmp/pardes-snap/colgrip/cwd Term+bash Save Mode Filter Co /tmp/pardes-snap/colgrip/cwd/w.txt Sav |3: llapse Del e Term Collapse Follow Del |4: ls 1 x |5: w.txt -|6: -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: -|18: -|19: -|20: -|21: -|22: -|23: diff --git a/test/snapshots/cornerdrag-left.golden b/test/snapshots/cornerdrag-left.golden deleted file mode 100644 index d5c7b7fd..00000000 --- a/test/snapshots/cornerdrag-left.golden +++ /dev/null @@ -1,86 +0,0 @@ -== snap right-split grid=100x31 cursor=54,11 -| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit -| New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -| /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -| ave Mode Filter Collapse Del ave Mode Filter Collapse Del -| ls ls -| w.txt w.txt -| -| /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -| ave Mode Filter Collapse Del -| ls -| w.txt -| -| -| -| -| -| -| /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -| ave Mode Filter Collapse Del -| ls -| w.txt -== snap hover-corner grid=100x31 cursor=54,11 -== snap hover-left-corner grid=100x31 cursor=54,11 -== snap corner-drag grid=100x31 cursor=54,11 -|1: New Term Find Grep Joincol ╎elcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag╎left/cwd Term+bash S /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -|3: ave Mode Filter Collapse De╎ ave Mode Filter Collapse Del -|4: ls ╎ ls -|5: w.txt ╎ w.txt -|6: ╎ -|7: ╎ /tmp/pardes-snap/cornerdrag-left/cwd Term+bash S -|8: ╎ ave Mode Filter Collapse Del -|9: ╎ ls -|10: ╎ w.txt -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: /tmp/pardes-snap/cornerdrag╎left/cwd Term+bash S -|18: ave Mode Filter Collapse De╎ -|19: ls ╎ -|20: w.txt ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap corner-done grid=100x31 cursor=34,11 -|1: New Term Find Grep Joincol D New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag- /tmp/pardes-snap/cornerdrag-left/cwd Term+bash Save Mode Filter Coll -|3: left/cwd Term+bash Save Mode apse Del -|4: Filter Collapse Del ls -|5: ls w.txt -|6: w.txt -|7: /tmp/pardes-snap/cornerdrag-left/cwd Term+bash Save Mode Filter Coll -|8: apse Del -|9: ls -|10: w.txt -|11: -|12: -|13: -|14: -|15: -|16: -|17: /tmp/pardes-snap/cornerdrag- -|18: left/cwd Term+bash Save Mode -|19: Filter Collapse Del -|20: ls -|21: w.txt -|22: -|23: -|24: -|25: -|26: -|27: -|28: -|29: -|30: diff --git a/test/snapshots/cornerdrag.golden b/test/snapshots/cornerdrag.golden deleted file mode 100644 index bd552949..00000000 --- a/test/snapshots/cornerdrag.golden +++ /dev/null @@ -1,239 +0,0 @@ -== snap hover-corner grid=100x31 cursor=4,6 -| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit -| New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -| /tmp/pardes-snap/cornerdrag/cwd Term+bash Save M /tmp/pardes-snap/cornerdrag/cwd Term+bash Save M -| ode Filter Collapse Del ode Filter Collapse Del -| ls ls -| w.txt w.txt -| -| -| -| -| -| -| -| -| -| -| -| /tmp/pardes-snap/cornerdrag/cwd Term+bash Save M -| ode Filter Collapse Del -| ls -| w.txt -== snap edge-drag grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol ╎elcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag╎cwd Term+bash Save M /tmp/pardes-snap/cornerdrag/cwd Term+bash Save M -|3: ode Filter Collapse Del ╎ ode 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/cornerdrag╎cwd Term+bash Save M -|18: ode Filter Collapse Del ╎ -|19: ls ╎ -|20: w.txt ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap edge-done grid=100x31 cursor=4,7 -|1: New Term Find Grep Joincol D New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag/ /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter Collapse -|3: cwd Term+bash Save Mode Filt Del -|4: er Collapse Del ls -|5: ls w.txt -|6: w.txt -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: /tmp/pardes-snap/cornerdrag/ -|18: cwd Term+bash Save Mode Filt -|19: er Collapse Del -|20: ls -|21: w.txt -|22: -|23: -|24: -|25: -|26: -|27: -|28: -|29: -|30: -== snap corner-drag grid=100x31 cursor=4,7 -|1: New Term Find Grep Joincol D New Term Find Grep Joincol ╎elcol -|2: /tmp/pardes-snap/cornerdrag/ /tmp/pardes-snap/cornerdrag╎cwd Term+bash Save Mode Filter Collapse -|3: cwd Term+bash Save Mode Filt Del ╎ -|4: er Collapse Del ls ╎ -|5: ls w.txt ╎ -|6: w.txt ╎ -|7: ╎ -|8: ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ -|9: ╎ -|10: ╎ -|11: ╎ -|12: ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: /tmp/pardes-snap/cornerdrag/ ╎ -|18: cwd Term+bash Save Mode Filt ╎ -|19: er Collapse Del ╎ -|20: ls ╎ -|21: w.txt ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap corner-done grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter /tmp/pardes-snap/cornerdrag/cwd Term+b -|3: Collapse Del ash Save Mode Filter Collapse Del -|4: ls ls -|5: w.txt w.txt -|6: -|7: -|8: -|9: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter -|10: Collapse Del -|11: ls -|12: w.txt -|13: -|14: -|15: -|16: -|17: -|18: -|19: -|20: -|21: -|22: -|23: -|24: -|25: -|26: -|27: -|28: -|29: -|30: -== snap clamp-x grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol D╎lcol -|2: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter /tmp/pardes-snap/cornerdrag/╎wd Term+b -|3: Collapse Del ash Save Mode Filter Collaps╎ Del -|4: ls ls ╎ -|5: w.txt w.txt ╎ -|6: ╎ -|7: ╎ -|8: ╎ -|9: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter ╎ -|10: Collapse Del ╎ -|11: ls ╎ -|12: w.txt ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: ╎ -|18: ╎ -|19: ╎ -|20: ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap clamp-y grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol ╎ New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filte╎ /tmp/pardes-snap/cornerdrag/cwd Term+b -|3: Collapse Del ╎ ash Save Mode Filter Collapse Del -|4: ls ╎ ls -|5: w.txt ╎ w.txt -|6: ╎ -|7: ╎ -|8: ╎ -|9: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filte╎ -|10: Collapse Del ╎ -|11: ls ╎ -|12: w.txt ╎ -|13: ╎ -|14: ╎ -|15: ╎ -|16: ╎ -|17: ╎ -|18: ╎ -|19: ╎ -|20: ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ -|30: ╎ -== snap clamp-done grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter /tmp/pardes-snap/cornerdrag/cwd Term+b -|3: Collapse Del ash Save Mode Filter Collapse Del -|4: ls ls -|5: w.txt w.txt -|6: -|7: -|8: -|9: -|10: -|11: -|12: -|13: -|14: -|15: -|16: -|17: -|18: -|19: -|20: -|21: -|22: -|23: -|24: -|25: -|26: -|27: /tmp/pardes-snap/cornerdrag/cwd Term+bash Save Mode Filter -|28: Collapse Del -|29: w.txt -|30: diff --git a/test/snapshots/shrinktag.golden b/test/snapshots/shrinktag.golden index d2167e86..bfca20e3 100644 --- a/test/snapshots/shrinktag.golden +++ b/test/snapshots/shrinktag.golden @@ -32,7 +32,6 @@ |19: |20: == snap move-preview grid=100x31 cursor=4,9 -|8: ls ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌▌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ == snap restored grid=100x31 cursor=4,9 |4: ls ls |5: w.txt w.txt diff --git a/test/snapshots/windowops.golden b/test/snapshots/windowops.golden index 6d27586b..ab97a868 100644 --- a/test/snapshots/windowops.golden +++ b/test/snapshots/windowops.golden @@ -21,71 +21,9 @@ | ls | w.txt == snap hover-h grid=100x31 cursor=4,6 -== snap border-drag grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol ╎ New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/windowops/cwd Term+b╎sh Save Mo /tmp/pardes-snap/windowops/cwd Term+bash Save Mo -|3: de Filter Collapse Del ╎ de 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 Term+b╎sh Save Mo -|18: de Filter Collapse Del ╎ -|19: ls ╎ -|20: w.txt ╎ -|21: ╎ -|22: ╎ -|23: ╎ -|24: ╎ -|25: ╎ -|26: ╎ -|27: ╎ -|28: ╎ -|29: ╎ -|30: ╎ -== snap border-done grid=100x31 cursor=4,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/windowops/cwd Term+ba /tmp/pardes-snap/windowops/cwd Term+bash Save Mode Filter -|3: sh Save Mode Filter Collapse Del 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 Term+ba -|18: sh Save Mode Filter Collapse Del -|19: ls -|20: w.txt -|21: -|22: -|23: -|24: -|25: -|26: -|27: -|28: -|29: -|30: == snap hborder-done grid=100x31 cursor=4,6 -|13: /tmp/pardes-snap/windowops/cwd Term+ba -|14: sh Save Mode Filter Collapse Del +|13: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo +|14: de Filter Collapse Del |15: ls |16: w.txt |17: @@ -95,63 +33,63 @@ == snap move-preview grid=100x31 cursor=4,17 == snap moved grid=100x31 cursor=4,17 == snap altn grid=100x31 cursor=4,22 -|18: /tmp/pardes-snap/windowops/cwd Term+ba -|19: sh Save Mode Filter Collapse Del +|18: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo +|19: de Filter Collapse Del |20: ls |21: w.txt -== snap focus-right grid=100x31 cursor=44,6 -== snap debug-on grid=100x31 cursor=44,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep J╭────────────────────────────────────╮ -|2: /tmp/pardes-snap/windowops/cwd Term+ba /tmp/pardes-snap/win│pardes resizes=1 │ -|3: sh Save Mode Filter Collapse Del Collapse Del │theme orchard │ -|4: ls ls │font default │ -|5: w.txt w.txt │terms 4 cols 2 │ -|6: │active #2 58x27 │ +== snap focus-right grid=100x31 cursor=54,6 +== snap debug-on grid=100x31 cursor=54,6 +|1: New Term Find Grep Joincol Delcol New Term F╭────────────────────────────────────╮ +|2: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo /tmp/parde│pardes resizes=1 │ +|3: de Filter Collapse Del de Filter │theme orchard │ +|4: ls ls │font default │ +|5: w.txt w.txt │terms 4 cols 2 │ +|6: │active #2 48x27 │ |7: │scroll 0/27 │ |8: │frame virtual clock │ |9: │ │ |10: │ │ |11: │ │ |12: │ │ -|13: /tmp/pardes-snap/windowops/cwd Term+ba ╰────────────────────────────────────╯ +|13: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo ╰────────────────────────────────────╯ == style debug-on grid=100x31 |0: 0-1 d,#1d2824, 2-74 #b2c3b8,#1d2824, 75-79 #f5f7ee,#3c614a, 80-80 #f5f7ee,#1d2824, 81-99 #b2c3b8,#1d2824, -|1: 0-1 d,#887455, 2-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#887455, 42-61 #becfc4,#314738, 62-99 d,d, -|2: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-39 #d3b0d9,#1d2824, 40-41 #d3b0d9,#add38a, 42-61 #becfc4,#314738, 62-62 d,d, 63-79 #b2c3b8,d, 80-98 #b2c3b8,#152019, 99-99 d,d, -|3: 0-1 d,#1d2824, 2-4 #d3b0d9,#1d2824, 5-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#314738, 42-61 #becfc4,#314738, 62-62 d,d, 63-76 #b2c3b8,d, 77-98 #b2c3b8,#152019, 99-99 d,d, -|4: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-61 #e5eee5,#0d1410, 62-62 d,d, 63-76 #b2c3b8,d, 77-98 #b2c3b8,#152019, 99-99 d,d, -|5: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-61 #e5eee5,#0d1410, 62-62 d,d, 63-77 #b2c3b8,d, 78-98 #b2c3b8,#152019, 99-99 d,d, -|6: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-78 #b2c3b8,d, 79-98 #b2c3b8,#152019, 99-99 d,d, -|7: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-73 #b2c3b8,d, 74-98 #b2c3b8,#152019, 99-99 d,d, -|8: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-82 #b2c3b8,d, 83-98 #b2c3b8,#152019, 99-99 d,d, -|9: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, -|10: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, -|11: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, -|12: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, -|13: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-39 #d3b0d9,#1d2824, 40-40 #d3b0d9,#608269, 41-61 #d3b0d9,#0d1410, 62-99 d,d, -|14: 0-1 d,#1d2824, 2-4 #d3b0d9,#1d2824, 5-39 #b2c3b8,#1d2824, 40-40 #b2c3b8,#608269, 41-99 #b2c3b8,#0d1410, -|15: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|16: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|17: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|18: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-39 #d3b0d9,#1d2824, 40-40 #d3b0d9,#608269, 41-99 #d3b0d9,#0d1410, -|19: 0-1 d,#1d2824, 2-4 #d3b0d9,#1d2824, 5-39 #b2c3b8,#1d2824, 40-40 #b2c3b8,#608269, 41-99 #b2c3b8,#0d1410, -|20: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|21: 0-0 d,#608269, 1-1 d,#0d1410, 2-39 #e5eee5,#0d1410, 40-40 #e5eee5,#608269, 41-99 #e5eee5,#0d1410, -|22: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|23: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|24: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|25: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|26: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|27: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|28: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|29: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -|30: 0-0 d,#608269, 1-39 d,#0d1410, 40-40 d,#608269, 41-99 d,#0d1410, -== snap debug-off grid=100x31 cursor=44,6 -|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol -|2: /tmp/pardes-snap/windowops/cwd Term+ba /tmp/pardes-snap/windowops/cwd Term+bash Save Mode Filter -|3: sh Save Mode Filter Collapse Del Collapse Del -|4: ls ls Debug -|5: w.txt w.txt +|1: 0-1 d,#887455, 2-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#887455, 52-61 #becfc4,#314738, 62-99 d,d, +|2: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-42 #d3b0d9,#1d2824, 43-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#add38a, 52-61 #becfc4,#314738, 62-62 d,d, 63-79 #b2c3b8,d, 80-98 #b2c3b8,#152019, 99-99 d,d, +|3: 0-1 d,#1d2824, 2-49 #b2c3b8,#1d2824, 50-51 #b2c3b8,#314738, 52-61 #becfc4,#314738, 62-62 d,d, 63-76 #b2c3b8,d, 77-98 #b2c3b8,#152019, 99-99 d,d, +|4: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-61 #e5eee5,#0d1410, 62-62 d,d, 63-76 #b2c3b8,d, 77-98 #b2c3b8,#152019, 99-99 d,d, +|5: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-61 #e5eee5,#0d1410, 62-62 d,d, 63-77 #b2c3b8,d, 78-98 #b2c3b8,#152019, 99-99 d,d, +|6: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-78 #b2c3b8,d, 79-98 #b2c3b8,#152019, 99-99 d,d, +|7: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-73 #b2c3b8,d, 74-98 #b2c3b8,#152019, 99-99 d,d, +|8: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-82 #b2c3b8,d, 83-98 #b2c3b8,#152019, 99-99 d,d, +|9: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, +|10: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, +|11: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, +|12: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-61 d,#0d1410, 62-62 d,d, 63-98 d,#152019, 99-99 d,d, +|13: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-42 #d3b0d9,#1d2824, 43-49 #b2c3b8,#1d2824, 50-50 #b2c3b8,#608269, 51-61 #b2c3b8,#0d1410, 62-99 d,d, +|14: 0-1 d,#1d2824, 2-49 #b2c3b8,#1d2824, 50-50 #b2c3b8,#608269, 51-99 #b2c3b8,#0d1410, +|15: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-99 #e5eee5,#0d1410, +|16: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-99 #e5eee5,#0d1410, +|17: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|18: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-42 #d3b0d9,#1d2824, 43-49 #b2c3b8,#1d2824, 50-50 #b2c3b8,#608269, 51-99 #b2c3b8,#0d1410, +|19: 0-1 d,#1d2824, 2-49 #b2c3b8,#1d2824, 50-50 #b2c3b8,#608269, 51-99 #b2c3b8,#0d1410, +|20: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-99 #e5eee5,#0d1410, +|21: 0-0 d,#608269, 1-1 d,#0d1410, 2-49 #e5eee5,#0d1410, 50-50 #e5eee5,#608269, 51-99 #e5eee5,#0d1410, +|22: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|23: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|24: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|25: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|26: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|27: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|28: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|29: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +|30: 0-0 d,#608269, 1-49 d,#0d1410, 50-50 d,#608269, 51-99 d,#0d1410, +== snap debug-off grid=100x31 cursor=54,6 +|1: New Term Find Grep Joincol Delcol New Term Find Grep Joincol Delcol +|2: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo /tmp/pardes-snap/windowops/cwd Term+bash Save Mo +|3: de Filter Collapse Del de Filter Collapse Del +|4: ls ls Debug +|5: w.txt w.txt |6: |7: |8: @@ -159,4 +97,4 @@ |10: |11: |12: -|13: /tmp/pardes-snap/windowops/cwd Term+ba +|13: /tmp/pardes-snap/windowops/cwd Term+bash Save Mo -- cgit v1.3 From fa504c392b5f3c04a7cfce74566e23cb94ddd6cf Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 23:58:16 -0300 Subject: test: a +Diff pinned before it moves: process-test's `diffstack` pages a patch into `pardes -` and snaps the +Diff it is restacked into (its hunk found two lines down where the file moved it, under the declaration it stands in, `a.zig:3` and `const S = struct {`, its label one level deep, `a.zig:5 *`; the changed word on a stronger ground in both lines, a line added whole on a faint one, the markers in their tints' hue), as text and as styles; replicas opens with a .patch looked at by the authority and as the replica's own input, the first stopped at its first read and confirmed with no rollback, the replica's digest and +Diff the authority's either way; the soak's fixture is a repository whose last commit changes code.zig, and `gitshow` pages `git show HEAD` into `pardes -` from a shell Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/process/tty_editing.zig | 24 +++++++++++++ test/replicas.zig | 76 ++++++++++++++++++++++++++++++++++++++++- test/snapshots/diffstack.golden | 61 +++++++++++++++++++++++++++++++++ test/soak.py | 21 +++++++++++- 4 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 test/snapshots/diffstack.golden (limited to 'test/snapshots') diff --git a/test/process/tty_editing.zig b/test/process/tty_editing.zig index 72cbb573..b5f0495c 100644 --- a/test/process/tty_editing.zig +++ b/test/process/tty_editing.zig @@ -35,6 +35,7 @@ pub const cases = .{ .{ "tty editing: lsp-rename-files", lsp_rename_files }, .{ "tty editing: callstack", callstack }, .{ "tty editing: diffview", diffview }, + .{ "tty editing: diffstack", diffstack }, .{ "tty editing: dirpane", dirpane }, .{ "tty editing: scrolloff", scrolloff }, .{ "tty editing: wrap", wrap }, @@ -2018,6 +2019,29 @@ fn diffview(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.done(); } +// A diff paged (`pardes -`) is stacked in a +Diff: its hunk found where the +// file has moved it since (two lines further down), under the declaration it +// stands in (`a.zig:3`, `const S = struct {`) and its label one level deep +// (`a.zig:5 *`); a changed line's changed word on a stronger ground in both +// lines (`c` and `a`), and a line added whole (`log();`) on a faint one, each +// marker in its tint's hue. +fn diffstack(gpa: std.mem.Allocator, exe: [:0]const u8) !void { + var t = try Tty.init(gpa, exe, "diffstack"); + defer t.deinit(); + try t.file("a.zig", "// one\n// two\nconst S = struct {\n fn f() void {\n a();\n b();\n log();\n }\n};\n"); + try t.file("change.patch", "--- a.zig\n+++ a.zig\n@@ -3,4 +3,5 @@ git's guess\n fn f() void {\n- c();\n+ a();\n b();\n+ log();\n }\n"); + try t.start(31, 100, &.{}); + try t.wait(8000, "$"); + try t.stable(700, 20000); + try t.send("cat change.patch | $(readlink /proc/$PPID/exe) -"); + try t.key("enter"); + try t.wait(20000, "a.zig:5 *"); + try t.stable(700, 20000); + try t.snap("diff-stack"); + try t.style("diff-stack-colours"); + try t.done(); +} + // a look at a directory opens a pane named for it with a trailing /, its // entries in columns as acme's directory window lays them out: down each // column first, a directory's marked /, dotfiles shown. A look at an entry diff --git a/test/replicas.zig b/test/replicas.zig index f50fb04f..038d747a 100644 --- a/test/replicas.zig +++ b/test/replicas.zig @@ -213,6 +213,13 @@ fn writeFile(path: [:0]const u8, lines: usize) !void { } } +fn writeText(path: [:0]const u8, text: []const u8) !void { + const fd = libc.open(path, .{ .ACCMODE = .WRONLY, .CREAT = true, .TRUNC = true }, @as(libc.mode_t, 0o644)); + if (fd < 0) return error.OpenFailed; + defer _ = libc.close(fd); + if (libc.write(fd, text.ptr, text.len) != @as(isize, @intCast(text.len))) return error.WriteFailed; +} + const Run = struct { seed: u64, rtt_ms: u64, steps: usize, clients: u16, shared: bool, flood_mb: u64 }; /// The terminal pane's screen as a hash of screen_state's dump of it. @@ -470,6 +477,73 @@ fn run(r: Run, dir: []const u8, totals: *Totals) !void { } } +/// A .patch looked at opens a +Diff, whose rows are made from files read +/// in the step (hunks.zig: the patch, the file each section names, its +/// declarations). Looked at by the authority, a replica replays the reads +/// the unit carries and makes the same +Diff; looked at as the replica's own +/// input, the first read poisons the speculation, which shows nothing and +/// waits for the authority's unit (no rollback of what it showed). Either +/// way the replica's digest and the +Diff's text are the authority's. +fn diffCase(dir: []const u8) !bool { + var host: Host = .{}; + defer { + for (host.echo.items) |e| gpa.free(e.bytes); + host.echo.deinit(gpa); + } + var buf: [256]u8 = undefined; + const source = try std.fmt.bufPrintSentinel(&buf, "{s}/a.zig", .{dir}, 0); + try writeText(source, "// one\n// two\nconst S = struct {\n fn f() void {\n a();\n b();\n log();\n }\n};\n"); + var pbuf: [256]u8 = undefined; + const patch = try std.fmt.bufPrintSentinel(&pbuf, "{s}/change.patch", .{dir}, 0); + try writeText(patch, "--- a.zig\n+++ a.zig\n@@ -3,4 +3,5 @@\n fn f() void {\n- c();\n+ a();\n b();\n+ log();\n }\n"); + var lbuf: [300]u8 = undefined; + const look = try std.fmt.bufPrint(&lbuf, "Look {s}", .{patch}); + var ok = true; + for ([_]bool{ false, true }) |own| { + const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty }, host.host(), true); + defer a.deinit(); + const first = try gpa.dupe(u8, try a.unit(0, 0)); + defer gpa.free(first); + const rp = try replica.Replica.init(gpa, 1, first, true); + defer rp.deinit(); + if (own) { + const msg = try gpa.dupe(u8, try rp.input(.{ .command = look })); + defer gpa.free(msg); + if (rp.stats.stopped != 1) { + std.debug.print("diff: the replica's own look at a .patch was not stopped at its first read ({d} stopped, {d} applied)\n", .{ rp.stats.stopped, rp.stats.speculated }); + ok = false; + } + if (try a.pending()) |batch| rp.confirm(batch); + rp.confirm(try a.take(msg)); + } else rp.confirm(try a.local(.{ .command = look })); + rp.settle(); + const named = for (a.core.panes, 0..) |slot, pid| { + const f = (slot orelse continue).file orelse continue; + if (std.mem.endsWith(u8, f.path, "/+Diff")) break pid; + } else null; + const mine = if (named) |pid| if (rp.core().panes[pid]) |pane| pane.file else null else null; + if (named == null or mine == null or !std.mem.eql(u8, a.core.panes[named.?].?.file.?.content, mine.?.content) or + std.mem.indexOf(u8, mine.?.content, "a.zig:5 *") == null) + { + std.debug.print("diff: {s}: the replica holds no +Diff of the authority's\n", .{if (own) "its own look" else "the authority's look"}); + ok = false; + } + if (rp.diverged) |why| { + std.debug.print("diff: {s}: the replica diverged: {s}\n", .{ if (own) "its own look" else "the authority's look", why }); + ok = false; + } else if (!rp.quiet() or rp.digest() != replica.digestOf(a)) { + std.debug.print("diff: {s}: the replica's digest is not the authority's\n", .{if (own) "its own look" else "the authority's look"}); + ok = false; + } + if (rp.stats.mispredicted + rp.stats.foreign != 0) { + std.debug.print("diff: {s}: {d} rollbacks\n", .{ if (own) "its own look" else "the authority's look", rp.stats.mispredicted + rp.stats.foreign }); + ok = false; + } + } + std.debug.print("diff: a .patch looked at by the authority and as a replica's own input: {s}\n", .{if (ok) "the same +Diff" else "FAILED"}); + return ok; +} + fn push(q: *std.PriorityQueue(Msg, void, Msg.order), nn: *u64, m: Msg) !void { var mm = m; mm.n = nn.*; @@ -1437,7 +1511,7 @@ pub fn main(init: std.process.Init) !void { if (!try echoMain(seeds, first, rtts)) std.process.exit(1); return; } - var failed = false; + var failed = !try diffCase(dir); std.debug.print("{d} seeds x {d} inputs from each of {d} clients, {s}, a TUI then {d} MB of yes in the shell; costs in us (frame {d})\n", .{ seeds, steps, clients, if (shared) "sharing one view" else "a view each", flood_mb, frame_us }); std.debug.print(" rtt inputs at-once stopped view units fast rollback(mis+foreign) rate rebase spec p50/p99 copy p50/p99 (KB) rollback p50/p99 diverged unequal\n", .{}); var term_lines: std.ArrayList(u8) = .empty; diff --git a/test/snapshots/diffstack.golden b/test/snapshots/diffstack.golden new file mode 100644 index 00000000..51251c4c --- /dev/null +++ b/test/snapshots/diffstack.golden @@ -0,0 +1,61 @@ +== snap diff-stack grid=100x31 cursor=4,4 +| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit +| New Term Find Grep Joincol Delcol +|$ /tmp/pardes-snap/diffstack/cwd Term+bash Save Mode Filter Collapse Del +| $ cat change.patch | $(readlink /proc/$PPID/exe) - +| $ +| /tmp/pardes-snap/diffstack/cwd/+Diff Save Term Diff Collapse LocationsConfig Del +| a.zig:3 +| const S = struct { +| a.zig:5 * +| fn f() void { +| - c(); +| + a(); +| b(); +| + log(); +| } +| +| +| +| +| +| +| +| +| +| +| +| /tmp/pardes-snap/diffstack/cwd/+New Save Term Collapse Follow Del +| 1 +== style diff-stack-colours grid=100x31 +|0: 0-1 d,#1d2824, 2-99 #b2c3b8,#1d2824, +|1: 0-1 d,#887455, 2-99 #becfc4,#314738, +|2: 0-1 #000000,#add38a, 2-32 #becfc4,#314738, 33-42 #dfbce5,#314738, 43-99 #becfc4,#314738, +|3: 0-0 d,#608269, 1-1 d,#0d1410, 2-99 #e5eee5,#0d1410, +|4: 0-0 d,#608269, 1-1 d,#0d1410, 2-99 #e5eee5,#0d1410, +|5: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-38 #d3b0d9,#1d2824, 39-99 #b2c3b8,#1d2824, +|6: 0-0 d,#608269, 1-1 d,#0d1410, 2-99 #59675c,#0d1410, +|7: 0-0 d,#608269, 1-2 d,#0d1410, 3-99 #59675c,#0d1410, +|8: 0-0 d,#608269, 1-1 d,#0d1410, 2-99 #59675c,#0d1410, +|9: 0-0 d,#608269, 1-6 d,#0d1410, 7-9 #c9a7ed,#0d1410, 10-99 #e5eee5,#0d1410, +|10: 0-0 d,#608269, 1-1 d,#0d1410, 2-2 #f1a39b,#0d1410,b 3-10 #f1a39b,#0d1410, 11-11 #e5eee5,#453832, 12-99 #e5eee5,#0d1410, +|11: 0-0 d,#608269, 1-1 d,#0d1410, 2-2 #b6ce94,#0d1410,b 3-10 #b6ce94,#0d1410, 11-11 #e5eee5,#364131, 12-99 #e5eee5,#0d1410, +|12: 0-0 d,#608269, 1-10 d,#0d1410, 11-99 #e5eee5,#0d1410, +|13: 0-0 d,#608269, 1-1 d,#0d1410, 2-2 #b6ce94,#171f18,b 3-10 #b6ce94,#171f18, 11-99 #e5eee5,#171f18, +|14: 0-0 d,#608269, 1-6 d,#0d1410, 7-99 #e5eee5,#0d1410, +|15: 0-0 d,#608269, 1-99 d,#0d1410, +|16: 0-0 d,#608269, 1-99 d,#0d1410, +|17: 0-0 d,#608269, 1-99 d,#0d1410, +|18: 0-0 d,#608269, 1-99 d,#0d1410, +|19: 0-0 d,#608269, 1-99 d,#0d1410, +|20: 0-0 d,#608269, 1-99 d,#0d1410, +|21: 0-0 d,#608269, 1-99 d,#0d1410, +|22: 0-0 d,#608269, 1-99 d,#0d1410, +|23: 0-0 d,#608269, 1-99 d,#0d1410, +|24: 0-0 d,#608269, 1-99 d,#0d1410, +|25: 0-0 d,#608269, 1-99 d,#0d1410, +|26: 0-1 d,#496656, 2-32 #b2c3b8,#1d2824, 33-37 #d3b0d9,#1d2824, 38-99 #b2c3b8,#1d2824, +|27: 0-0 d,#608269, 1-4 d,#0d1410, 5-99 #59675c,#0d1410, +|28: 0-0 d,#608269, 1-99 d,#0d1410, +|29: 0-0 d,#608269, 1-99 d,#0d1410, +|30: 0-0 d,#608269, 1-99 d,#0d1410, diff --git a/test/soak.py b/test/soak.py index 401cb84e..faf447ab 100644 --- a/test/soak.py +++ b/test/soak.py @@ -148,6 +148,15 @@ def fixture(at, rng): sub.mkdir(exist_ok=True) (sub / 'inner.txt').write_text(''.join(f'inner {i} {rng.choice(WORDS)}\n' for i in range(60))) (sub / 'more.md').write_text('# More\n\n' + ''.join(f'- item {i} {rng.choice(WORDS)}\n' for i in range(40))) + # A repository whose last commit changes code.zig, for act_gitshow. + if shutil.which('git'): + git = ['git', '-c', 'user.name=soak', '-c', 'user.email=soak@invalid', '-c', 'init.defaultBranch=main'] + subprocess.run(git + ['init', '-q'], cwd=at, check=True) + subprocess.run(git + ['add', 'code.zig'], cwd=at, check=True) + subprocess.run(git + ['commit', '-qm', 'code'], cwd=at, check=True) + code = (at / 'code.zig').read_text().replace('return x * 7 +', 'return x * 8 +').replace('pub fn f9(', 'pub fn nine(') + (at / 'code.zig').write_text(code) + subprocess.run(git + ['commit', '-qam', 'change'], cwd=at, check=True) # ---- terminals ---- @@ -681,6 +690,16 @@ def act_shell(c, rng, k): k(rng.choice([b'k', b'j', b''])) +def act_gitshow(c, rng, k): + # A commit paged into `pardes -` (git's pager): the +Pager restacked into + # a +Diff, whose rows come from the files the step reads (hunks.zig). + k(b' nt') + time.sleep(rng.uniform(0.8, 1.5)) + k(b'git show HEAD | "$(readlink /proc/$PPID/exe)" -\r') + time.sleep(rng.uniform(1.0, 2.0)) + k(b'\x02') + + def act_window(c, rng, k): # Enter ends window mode, as a person would: left open, it took the next # action's keys, and a `k` at a column's top went to its tag, where `SPC q` ran Exit @@ -762,7 +781,7 @@ ACTIONS = [ ('panes', 3, act_panes), ('find', 3, act_find), ('shell', 3, act_shell), ('window', 4, act_window), ('column', 1, act_column), ('del', 2, act_del), ('new', 2, act_new), ('esc', 4, act_esc), ('click', 8, act_click), ('wheel', 8, act_wheel), ('hover', 6, act_hover), ('paste', 2, act_paste), - ('settings', 1, act_settings), ('idle', 6, act_idle), + ('settings', 1, act_settings), ('gitshow', 1, act_gitshow), ('idle', 6, act_idle), ] -- cgit v1.3