Repository navigation
Documents and collections dragged onto the Library's tree open Move set to the place they land on - #734
Open
zlareb1 wants to merge 2 commits into
Open
Documents and collections dragged onto the Library's tree open Move set to the place they land on#734zlareb1 wants to merge 2 commits into
zlareb1 wants to merge 2 commits into
Conversation
…et to the place they land on Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…on's Move hands focus on only after a move Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #672
Related: #680
Related: #686
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
In the dashboard's Library, drag a document (or the selection it is in) onto a place in the tree to move it there, and drag a collection onto another to nest it or onto Drop here for the top level. Each drop opens the same Move dialog as the menus, already set to that place.
Why
A collection works like a folder of documents, and people move things between folders by dragging them. The Library already had Move to… for documents (
knowledge.move) and Move… for a collection (collection.move). Dragging onto the tree is a quicker way to start those same moves.Scope and risk
MoveDocumentsDialog) with the destination already picked. It moves through the existing dialog andmoveKnowledge, and the summary toast, partial-failure handling and list reload are unchanged. A drop asks for one confirm instead of moving straight away because a move changes who can read the documents, and the dialog says how ("They take X's sharing").placesFromthat builds the dialog's list. So the source place, a collection the person only reads, All documents, and the namespace or My files where Move to… leaves them out all refuse a drop. A selection that spans several places has no place that takes it, becauseknowledge.movemoves from one namespace. A place that takes the drop gets a dashed accent outline while the drag is held, and a solid one with a fill while the pointer is over it. A place that refuses gets no outline, itsdragoveris not cancelled, and a drop on it does nothing.collection.moverequires admin), other than My files, can be dragged in the tree. It can land on a collection the person writes (the handler checks writer on the new parent), but not on itself, on anything under it (isUnder, moved from the dialog intolib/collections.tsso the tree and the dialog share it), or on the parent it is already in. While a nested collection is held, Drop here for the top level appears at the tree's foot, sincecollection.movetakesparent: "". A drop opensMoveCollectionDialogalready set to that parent. When the dialog closes, focus goes to the parent it was dropped on, or to New collection for the top level, because the moved row is drawn again elsewhere.lib/useDragHold.tsholds the dragged value a tick afterdragstart, because Chrome aborts a drag whosedragstartreshapes the page. It also holds nothing if the drag ended within that tick. The tree and the document list both use it.<button>. Most of a document row is its preview button, so in Firefox a row drags only from its edges and its tag and place lines. Chromium and WebKit drag the whole row. The menus still offer every move.knowledge.moveandcollection.moveas before.Compatibility, rollout and rollback
Tests
make format-check lint typecheck(with the shared venv): pass.tests/unit/test_doc_links.pyandtests/unit/test_public_copy.py: 242 passed. The unit tests that read the frontend (test_dashboard_routes,test_every_list_row_is_projectable,test_page_field_lists_name_server_fields,test_list_answers_what_the_page_asked,test_mixed_version_gate,test_op_reach_census,test_agent_instructions): 293 passed. The fullmake test-unitwas not run locally.frontend/:npx tsc -bpasses.npx vitest run --maxWorkers=2passes: 311 files, 3606 tests.npm run buildandnpm run budgetpass.src/views/Documents.drag.test.tsxchecks:knowledge.move, with the list read again in place;dragoveruncancelled and drop nothing;src/views/LibraryTree.test.tsxgains a block for collection drops:collection.moveand hands focus back;documentDropmarks the right places and passes the drop to the page.--workers=2onlibrary*.spec.ts,sharing.spec.tsanda11y.spec.ts, andtasks-*.spec.ts(the Tasks board now holds its dragged card through the sameuseDragHold): pass. The newlibrary-drag.spec.tsuses real mouse drags at 1440 px: a document onto a collection (it moves, and its row leaves the list), a selection, and a collection nested into another.Screenshots (mocked API, the dashboard's dark theme, 1440 px):
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. I checked the accepted and refused drop targets against Move to…'s place list and
collection.move's role checks, and checked the real drags in Chromium with screenshots.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed. (format-check, lint and typecheck pass; see Tests for the unit tests run)main; no merged migration is edited. (none)npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code