mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
88de417a21
* 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