Repository navigation
Entity-aware select/move tool and smarter snapping - #368
Merged
Merged
Conversation
Reworks the select tool to understand the things under the cursor, and makes snapping rebuild connections cleanly when shapes move or are drawn. Select tool (client/draw/select.ts, client/draw/entity.ts): - Grab a box's interior to move the whole box and its contents; attached lines stay connected and reflow — straight runs shorten/lengthen, perpendicular moves bend, traced through corners to the real terminal, and arrows that point into the box ride along. - Box borders/lines still resize via the existing DrawMove. - Drag a free line tip to reshape it like the line tool (free 2D with corners), pivoting at the nearest bend; orientation follows the segment's own axis (Ctrl/Shift flips). - Move a word (run of text); shift-click to build a multi-selection. - Rubber-band selections reflow edge-crossing lines too. - Selection travels with undo/redo and is purged when leaving the tool. Snapping (client/snap.ts, client/characters.ts): - Accumulate connections so a cell gaining/losing several at once lands on the right junction instead of the last one winning. - Complete the disconnect table for ┼ (DOWN/LEFT/RIGHT) so drawing onto a line yields a T, not a +. - Normalisation pass: after a change, tidy each affected line/junction to match its neighbours (a dangling ┤ → │, stray ┼ → the right T, etc.), scoped to never mutate the content being moved. - Boxes now snap to adjacent lines/boxes when drawn, like lines do. Tests: new entity/select/snap/box/line/grid specs cover the happy paths and the regressions fixed here. All client + common suites pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Reworks the select tool to be entity-aware and makes snapping rebuild connections cleanly when shapes move or are drawn.
Select tool
DrawMove).Snapping
disconnecttable for┼(DOWN/LEFT/RIGHT) so drawing a line onto another yields a T, not a+.┤→│, a stray┼→ the right T, a moved box's connection points settle correctly). Scoped to never mutate the content being moved, only the structure around it.Testing
New specs cover the happy paths and every regression fixed here:
entity.spec,select.spec,snap.spec,box.spec,line.spec,grid.spec(incl. a 2x2-grid quadrant move). All client + common suites pass.🤖 Generated with Claude Code