Skip to content

fix: file dragged cards into pinboard tabs again - #17

Merged
tarikbc merged 1 commit into
tarikbc:mainfrom
NigamDevansh:bugfix/drag-and-drop-fixed
Oct 1, 2026
Merged

tarikbc merged 1 commit into
tarikbc:mainfrom
NigamDevansh:bugfix/drag-and-drop-fixed

Conversation

@NigamDevansh

@NigamDevansh NigamDevansh commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Fixes dragging a card onto a pinboard tab, which stopped working after #10 (tab reordering): the card just slid back.

  • Fix: the shelf has no SwiftUI .onDrop anymore. ShelfHostingView (the shelf's NSHostingView) handles both drags in AppKit: cards are filed into the tab under the pointer, and tabs are reordered as before.
  • Feedback: while dragging over a tab, a small callout under it names the board the card will land in, then briefly confirms the drop. This replaces the "Added to…" HUD (a failed drop still shows it).
  • Dragging an unselected card now selects it first, like Finder.

How you tested it

Screen.Recording.2026-10-01.at.5.44.54.PM.1.mp4

Built and ran on macOS 27:

  1. Drag one card onto a tab: it's filed and that tab opens.
  2. Drag 3 selected cards onto a tab: all 3 are filed.
  3. Drag a card over a tab and away: nothing is filed, the highlight clears.
  4. Drag a tab onto another tab: reordering still works.

  • Every commit is signed off (git commit -s, or turn on the hook once with
    git config core.hooksPath .githooks). The DCO check enforces this. See
    CONTRIBUTING.md.
  • Engine changes come with tests (swift test --package-path CopyCore): no engine changes
  • CopyCore/Package.resolved still pins GRDB, KeyboardShortcuts and Sparkle: not touched

Dragging a card onto a pinboard tab did nothing: the card slid back with
no highlight. The shelf's SwiftUI .onDrop installs a full-size drop view
registered for public.item, so it claimed every drag over the shelf, and
since the tab reordering change its delegate rejected card drags.

The shelf now has no SwiftUI .onDrop. ShelfHostingView, the shelf's
NSHostingView, is the only drag destination and handles both drags in
AppKit: cards are filed into the tab under the pointer (which then
opens), and tabs are reordered. Both resolve the tab from the frames the
tabs publish. Dragging a card that isn't selected now selects it first,
as in Finder.

While a card drag is over a tab, a small callout hangs from that tab
naming the board it will land in, follows the drag along the row, and
confirms the drop for a moment afterwards. It replaces the "Added to"
HUD; a failed drop still shows the HUD.

Signed-off-by: devansh nigam <devanshn02@gmail.com>
@NigamDevansh

NigamDevansh commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi @tarikbc @brzvsk , the drag and drop feature was broken somehow in the recent merges so i have fixed them , please have a look and let me know if there are any changes that needs to be done.

Thanks! :)

checked it on 27.0.1 , works fine.

@NigamDevansh
NigamDevansh marked this pull request as ready for review October 1, 2026 12:27
@tarikbc
tarikbc merged commit 633c466 into tarikbc:main Oct 1, 2026
2 checks passed
@tarikbc

tarikbc commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Great job! This is a great addition. Thanks for the PR :)

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.

2 participants