feat(ui): drag rows in the outline and widgets out of the palette #47

Open
Bolt wants to merge 2 commits from feat/m9-outline-drag into main
Collaborator

Summary

  • Milestone 9, two more of decision 28's four drags. Off current main.
  • Outline: a row drags onto another. A container takes it inside, anything else takes it after - the same rule insertNode already uses for what is selected, now shared as siteBeside. 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 exactly one place.
  • Palette: a widget drags out of the rail and onto the sheet. It starts in one panel and ends in another, so the pointer is followed on the window rather than on either of them.
  • Both filter their targets by making the edit and putting it through the same parse the commit uses, so a line or a highlight only appears where letting go does something.
  • The palette drag reuses the click's own rescue: decision 5 wants a definite main axis over a fill repeat, so a widget arriving at auto height is retried once at grow. Without it a notes block could never be dropped anywhere, since it cannot parse at auto. That rescue was inlined in useEditor; it is now grownToFit and both callers share it.
  • A press that never reaches the paper places nothing and falls back to being a click, which inserts beside the selection the way the palette always has.
  • insertAt joins moveTo in src/spec/edit.ts with the same gap contract. widgetIdFor moves to src/spec/widget.ts rather than being copied into a second caller.

Test plan

  • pnpm test - 678 pass, 14 new
  • pnpm lint, tsc --noEmit and pnpm build clean
  • edit.test.ts covers siteBeside into a container, after a mark, beside a widget rather than inside one (decision 18)
  • App.test.tsx drags a row onto another and asserts the tree, the landing highlight appearing only during a drag, nothing marked for a drop that would be refused, one undo entry, and a row let go over itself doing nothing
  • App.test.tsx also carries a Notes widget out of the palette onto the sheet: it places, previews the gap, places nothing if the pointer never reaches the paper, abandons on cancel, and is one undo entry
## Summary - Milestone 9, two more of decision 28's four drags. Off current `main`. - **Outline**: a row drags onto another. A container takes it inside, anything else takes it after - the same rule `insertNode` already uses for what is selected, now shared as `siteBeside`. 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 exactly one place. - **Palette**: a widget drags out of the rail and onto the sheet. It starts in one panel and ends in another, so the pointer is followed on the window rather than on either of them. - Both filter their targets by making the edit and putting it through the same parse the commit uses, so a line or a highlight only appears where letting go does something. - The palette drag reuses the click's own rescue: decision 5 wants a definite main axis over a fill repeat, so a widget arriving at auto height is retried once at grow. Without it a notes block could never be dropped anywhere, since it cannot parse at auto. That rescue was inlined in `useEditor`; it is now `grownToFit` and both callers share it. - A press that never reaches the paper places nothing and falls back to being a click, which inserts beside the selection the way the palette always has. - `insertAt` joins `moveTo` in `src/spec/edit.ts` with the same gap contract. `widgetIdFor` moves to `src/spec/widget.ts` rather than being copied into a second caller. ## Test plan - `pnpm test` - 678 pass, 14 new - `pnpm lint`, `tsc --noEmit` and `pnpm build` clean - `edit.test.ts` covers `siteBeside` into a container, after a mark, beside a widget rather than inside one (decision 18) - `App.test.tsx` drags a row onto another and asserts the tree, the landing highlight appearing only during a drag, nothing marked for a drop that would be refused, one undo entry, and a row let go over itself doing nothing - `App.test.tsx` also carries a Notes widget out of the palette onto the sheet: it places, previews the gap, places nothing if the pointer never reaches the paper, abandons on cancel, and is one undo entry
- 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
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-outline-drag:feat/m9-outline-drag
git switch feat/m9-outline-drag

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-outline-drag
git switch feat/m9-outline-drag
git rebase main
git switch main
git merge --ff-only feat/m9-outline-drag
git switch feat/m9-outline-drag
git rebase main
git switch main
git merge --no-ff feat/m9-outline-drag
git switch main
git merge --squash feat/m9-outline-drag
git switch main
git merge --ff-only feat/m9-outline-drag
git switch main
git merge feat/m9-outline-drag
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!47
No description provided.