Skip to content

Draggable tabs with live slide while dragging - #10

Merged
Marvelxy merged 6 commits into
mainfrom
feature/draggable-tabs
Oct 21, 2026
Merged

Marvelxy merged 6 commits into
mainfrom
feature/draggable-tabs

Conversation

@Marvelxy

Copy link
Copy Markdown
Owner

Summary

  • Tabs rearrange by dragging: the dragged tab slides live under the pointer with a slight lift (scale + shadow) while the other tabs spring out of the way slot by slot; release commits the order (browser-style, no system drag session — only gestures can drive mid-drag layout).
  • Reorder commits at half-over so natural drops settle (almost) in place; displaced tabs never jump.
  • The active document never reloads while reordering; the new order persists to session restore.
  • Drag feel: gesture threshold travel is baselined (no start hop), the dragged tab chases the pointer with a short linear animation, and slides/settle share one soft spring.

Test plan

  • Verified live with synthesized mouse drags (CGEvent scripts) in both directions: mid-drag slide frames, settle frames after release, session order persistence, active tab follows the dropped document without reload (page number intact).
  • swift build -c release passes; verify tool passes.

Tabs are drag sources (NSItemProvider with the tab URL) and drop
targets (plainText onDrop): dropping a tab onto another takes its
position, browser-style. PDFReaderState.moveTab re-syncs the active
tab index from its URL after the move so the displayed document never
reloads, and the reordered session persists through the tabURLs
observer. The hovered target shows a dashed accent border. Per-tab
drag/drop wiring lives in a small TabItem view so the modifier chain
type-checks fast.
@Marvelxy
Marvelxy merged commit 9cb62ee into main Oct 21, 2026
1 check passed
@Marvelxy
Marvelxy deleted the feature/draggable-tabs branch October 21, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant