Files
outline/app/components
Tom Moor 88de417a21 Refactor drag-and-drop to support dragging from document lists (#12587)
* Allow dragging documents from list views into the sidebar

Previously the react-dnd provider was scoped to the sidebar, so only
sidebar rows could be dragged. This lifts the DndProvider up to the
authenticated layout so both the main content and the sidebar share a
single drag-and-drop context, and makes DocumentListItem a drag source.

Now any document in search results or paginated lists (Home, Drafts,
Collections, etc.) can be dragged into the sidebar to move it between
collections, reparent it under another document, star it, or archive it
— reusing the existing sidebar drop targets.

* Make the whole Starred section a drop target to star documents

Previously the only "create star" drop targets in the Starred section
were the thin cursors between items, so dragging a document onto the
section header or a starred row showed the drop cursor but did nothing.

Wrap the section in a catch-all drop target (mirroring the Archive
section) so dropping anywhere in Starred stars the document, while the
precise inter-item cursors still control ordering. A didDrop guard on
useDropToCreateStar prevents the catch-all from double-starring when a
nested cursor already handled the drop, and the hover highlight uses a
shallow isOver check so it only lights up when not over a nested target.

* Let document list drag ghost follow the cursor

The sidebar drag placeholder tethers the ghost near its starting x so it
stays aligned with the sidebar during reordering. When a drag starts out
in the main content (a document list item), that clamp pinned the ghost
to a narrow band, making it look stuck in a small area.

Thread a constrainToSidebar flag through the drag item (true for sidebar
drags, false for document list drags) and let the placeholder follow the
cursor freely when the drag originated outside the sidebar.

* Clarify constrainToSidebar JSDoc to match placeholder behavior

The placeholder treats an unset flag as tethered (constrainToSidebar
!== false), so external drags must set it explicitly to false rather
than leaving it unset. Update the comment to reflect that.

* css
2026-06-05 08:27:10 -04:00
..
2026-06-02 22:11:24 -04:00
2025-12-23 11:53:41 -05:00
2026-04-18 15:12:57 -04:00
2026-04-18 15:12:57 -04:00
2023-02-25 12:03:05 -08:00
2026-02-20 18:53:00 -05:00
2024-11-02 10:58:03 -07:00
2025-03-15 15:06:12 -07:00
2026-04-20 19:34:16 -04:00
2026-04-18 15:12:57 -04:00
2026-04-18 15:12:57 -04:00
2023-09-23 14:31:55 -04:00
2026-04-18 15:12:57 -04:00
2026-02-20 18:53:00 -05:00