Skip to content

fix(ui): fix drag-and-drop on Windows and catalog rail layout#24

Merged
thcp merged 1 commit into
mainfrom
fix/dnd-folder-drop-webview2
May 9, 2026
Merged

fix(ui): fix drag-and-drop on Windows and catalog rail layout#24
thcp merged 1 commit into
mainfrom
fix/dnd-folder-drop-webview2

Conversation

@thcp
Copy link
Copy Markdown
Collaborator

@thcp thcp commented May 9, 2026

Summary

  • dragDropEnabled: false in tauri.conf.json — WebView2 was intercepting OS-level drag events before they reached the HTML page, silently swallowing all dragover/drop events. This is the documented requirement for HTML5 DnD on Windows in Tauri v2.
  • Catalog rail background fills full height — the rail column was auto-placing catalog-main into an implicit grid row in the collapsed state, stealing height from the 1fr row and leaving the rail background short. Fixed by pinning both children to explicit grid-column/grid-row and adding grid-template-rows: 1fr to the catalog grid.
  • dropOnFolder / getDraggedTrackId hardening — accepts an explicit trackId argument and a text/plain fallback for WebView2's cross-origin dataTransfer restrictions.
  • Restore from trash — dragging a track from the trash view onto the Library rail button now restores it to the first non-trash folder and switches back to library view.

Test plan

  • Drag a song card from Unsorted to a user folder — moves cleanly
  • Drag a song card to the Trash rail button — moves to trash
  • Switch to Trash view, drag a track back onto the Library rail button — restores to Unsorted, view switches to Library
  • Collapse the library panel — rail background fills full height with no lighter strip below About
  • Expand the library panel — layout correct, no regression

- Set dragDropEnabled: false in tauri.conf.json so WebView2 doesn't
  intercept OS-level drag events, allowing HTML5 dragover/drop to fire
- Fix catalog-rail background not filling full panel height by adding
  grid-template-rows: 1fr and explicit grid-column/row placement on
  rail and main, preventing catalog-main from wrapping to an implicit
  row in the collapsed state
- Restore dropOnFolder and getDraggedTrackId to accept explicit trackId
  and text/plain fallback for cross-origin dataTransfer in WebView2
- Add wireRailLibraryDrop so tracks can be dragged from trash back to
  library by dropping on the Library rail button
@thcp thcp merged commit 13ce0c9 into main May 9, 2026
1 check passed
@thcp thcp deleted the fix/dnd-folder-drop-webview2 branch May 9, 2026 23:33
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