aboutsummaryrefslogtreecommitdiff
path: root/gptel-tools
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-09 11:03:10 -0500
committerCraig Jennings <c@cjennings.net>2026-05-09 11:03:10 -0500
commit26e97633c2141051dee418aff5d8993700cf39b2 (patch)
tree7dbe6fa685c0b3093f6e7952a340bb61e44ccbea /gptel-tools
parent1945df4bf5f34256908fdf221da8a6f7767ad427 (diff)
downloaddotemacs-26e97633c2141051dee418aff5d8993700cf39b2.tar.gz
dotemacs-26e97633c2141051dee418aff5d8993700cf39b2.zip
fix(ai-vterm): harden F9 toggle across multi-window and buffer-move
Live-testing surfaced four edge-case failures in the F9 toggle geometry preservation. Each gets a dedicated regression test. - Multi-window squeeze: a captured fraction-of-frame replayed at the wrong size in 3+ window layouts because `display-buffer-in-direction` interprets float widths as fractions of the new window's parent, not the frame. In a flat 3-window layout the parent is the root, but in nested splits it's a sub-tree, and the captured fraction blew the layout up. I switched to absolute integer body-cols and body-lines as the captured unit. The unit is layout-independent. - One-col peek: a claude window captured rightmost (no right divider, body=total) replayed into a middle position (with divider, body=total-1) showed 1 col of the sibling buffer peeking through where claude should have ended. I wrap the integer size in a `(body-columns . N)` / `(body-lines . N)` cons so `display-buffer-in-direction` sets the body explicitly, divider-independent. - Position swap and compounding gap: `direction=right` in `display-buffer-in-direction` splits the selected window, not the frame edge. In multi-window layouts the new claude landed mid-frame instead of where it came from. Each toggle compounded a 1-col loss because the new position picked up a divider the original lacked. I map the cardinal direction to its frame-edge variant (`right` -> `rightmost`, `below` -> `bottom`, etc.) so claude always returns to the captured edge. - Extra window after buffer-move: buffer-move (C-M-arrows) doesn't update the claude window's `quit-restore` parameter, so `quit-window` falls through to bury rather than delete. The window stays alive showing some other buffer. Toggle-on doesn't recognize it and creates a fresh side window, landing at N+1 windows. I switched to `delete-window` with a `one-window-p` guard for the single-window-frame case. One tradeoff: in a layout where claude was deliberately in a middle position (e.g. agenda | claude | todo), the next toggle pulls it to the frame edge rather than the middle. The side-panel pattern is the design intent and the common case. 7 new regression tests covering each scenario. 80 ai-vterm tests pass. Full make test green.
Diffstat (limited to 'gptel-tools')
0 files changed, 0 insertions, 0 deletions