Drag and drop sessions between tag groups in the session list - #83
Merged
Conversation
The sessions list grows drag and drop for the one thing a drop can honestly change: tags. A row picked up under one tag heading and let go over another swaps the source tag for the target, dropping on the untagged remainder clears them all, and both travel as the same update the tag editor sends, so dragging is a shortcut for an existing edit rather than a new power. Machine, state and directory headings refuse the drop out loud, with a no-drop cursor in the air and the reason as a notice on release; the ungrouped view offers no drag at all. The verdict is a pure function beside spawnFromGroup, pinned by unit tests; the table wires dnd-kit around it — a mouse pays five pixels to lift, a finger pays a hold so scrolling stays scrolling, and the ghost is a card naming the row rather than the row itself. The keyboard path remains the tag editor, which drag and drop deliberately never replaces. Closes #81. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drag and drop nobody has tried is drag and drop nobody has: the gesture needed a face. Each row now wears a small grip ahead of its checkbox, quiet until hover exactly as the checkbox and the row menu are, and at full strength for a coarse pointer, which has no hover to learn from. It is an advertisement rather than a handle — the whole row still lifts — so it only renders while some heading on screen would take the drop: a grip under the machine grouping would promise a move that every release refuses. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #81.
What
Session rows in the sessions list can now be picked up and dropped onto a group heading. Dropping on a tag heading moves the session there: the tag it was dragged out of comes off, the tag it landed on goes on, and the rest of its tags are untouched. Dropping on the "No tag" remainder clears every tag. Machine, state and directory headings reject the drop with a no-drop cursor while the row is in the air and a notice explaining why on release. With no grouping there is nothing to drop onto, so dragging is off.
How
@dnd-kit/core(MouseSensor + TouchSensor + DragOverlay). A mouse needs 5px of travel to lift a row, so plain clicks, the checkbox and the row menu keep working. A finger needs a 300ms hold, so scrolling stays scrolling; the rows suppress text selection and the iOS link callout only while a drag contract is present.dropOnGroup(grouping, session, fromKey, toKey)verdict insessions/view.ts, besidespawnFromGroupand unit-tested the same way. The route turns aretagverdict into the samefleet.updatethe tag editor sends, follows it with afleet.list()so the row visibly re-groups, and says what happened in the status line.Multi-select drag is left as the follow-up the issue names.
Tests
cd web && pnpm vitest run— 75 files, 1477 tests, green (includes the real vite build instyles.build.test.ts).pnpm run lint(tsc) — clean.dropOnGroupand the drag wiring the DOM can honestly prove;sessions.test.tsxqueries the notice line by element now that dnd-kit portals a secondrole=statuslive region onto the body.🤖 Generated with Claude Code