feat(ui): resize a node by dragging its edge #48

Open
Bolt wants to merge 3 commits from feat/m9-resize into main
Collaborator

Summary

  • Milestone 9, the last of decision 28's four drags. Stacked on feat/m9-outline-drag (#47) - merge that first.
  • Dragging the far edge of an axis writes a fixed size. Only the far edge: a flow layout positions a node by its place among siblings, so dragging the near edge would slide the box under the pointer rather than resize it, and the number written is the same one either way.
  • An auto edge draws a dashed tick and takes no drag, holding no number to write. Double-clicking converts it to fixed at the size it had measured, which is the one conversion that moves nothing on the page as it happens.
  • A size set by an expression offers nothing at all. Decision 7 says no control can write one, and a grip that refused on release is worse than no grip.
  • A resize commits as it goes rather than on release, and is still one entry on the undo stack: decision 14 coalesces edits to one field within 500ms, and this writes the same field the inspector's stepper does. Decision 28's commit-on-drop is for structural edits, which never coalesce - a size is not one.
  • rebalance is in src/spec/resize.ts and tested, ready for the grow-divider handle, which is the one part of decision 28 still to be drawn.

Test plan

  • pnpm test - 695 pass, 17 new
  • pnpm lint, tsc --noEmit and pnpm build clean
  • new src/spec/resize.test.ts covers what each mode offers, the clamp short of zero, fixing at the measured size, and the divider preserving a pair's shared weight against a third sibling
  • App.test.tsx selects the todo widget, converts its auto height on a double click at the measured 56mm, drags the grip and asserts the millimetres written, and checks a node auto on both axes shows ticks and no grips
## Summary - Milestone 9, the last of decision 28's four drags. Stacked on `feat/m9-outline-drag` (#47) - merge that first. - Dragging the far edge of an axis writes a fixed size. Only the far edge: a flow layout positions a node by its place among siblings, so dragging the near edge would slide the box under the pointer rather than resize it, and the number written is the same one either way. - An `auto` edge draws a dashed tick and takes no drag, holding no number to write. Double-clicking converts it to fixed **at the size it had measured**, which is the one conversion that moves nothing on the page as it happens. - A size set by an expression offers nothing at all. Decision 7 says no control can write one, and a grip that refused on release is worse than no grip. - A resize commits as it goes rather than on release, and is still one entry on the undo stack: decision 14 coalesces edits to one field within 500ms, and this writes the same field the inspector's stepper does. Decision 28's commit-on-drop is for structural edits, which never coalesce - a size is not one. - `rebalance` is in `src/spec/resize.ts` and tested, ready for the grow-divider handle, which is the one part of decision 28 still to be drawn. ## Test plan - `pnpm test` - 695 pass, 17 new - `pnpm lint`, `tsc --noEmit` and `pnpm build` clean - new `src/spec/resize.test.ts` covers what each mode offers, the clamp short of zero, fixing at the measured size, and the divider preserving a pair's shared weight against a third sibling - `App.test.tsx` selects the todo widget, converts its auto height on a double click at the measured 56mm, drags the grip and asserts the millimetres written, and checks a node auto on both axes shows ticks and no grips
- a container takes the row inside it, anything else takes it after
- only a drop the commit would accept marks the row under the pointer
- the four move buttons stay, for the keyboard and for a move of one place
- the pointer is followed on the window, the drag starting in one panel and ending in another
- only gaps the insert would survive are offered, growing the node to fit as the click already does
- a press that never reaches the paper places nothing and stays a click
- the far edge of each axis writes a fixed size; the near one would move the box
- an auto edge draws a tick and converts on double click, at the size it measured
- a size set by an expression offers nothing, no control being able to write one
- a resize coalesces like the stepper it shares a field with, so a drag is one undo
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/m9-resize:feat/m9-resize
git switch feat/m9-resize

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/m9-resize
git switch feat/m9-resize
git rebase main
git switch main
git merge --ff-only feat/m9-resize
git switch feat/m9-resize
git rebase main
git switch main
git merge --no-ff feat/m9-resize
git switch main
git merge --squash feat/m9-resize
git switch main
git merge --ff-only feat/m9-resize
git switch main
git merge feat/m9-resize
git push origin main
Sign in to join this conversation.
No reviewers
No labels
chore
core
render
ui
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
TJC/daily-planner-template!48
No description provided.