feat: tag drag-to-reorder (#41)#71
Merged
Merged
Conversation
- Add nullable `position` int column to Tag model - New tags auto-assigned next position on creation - `GET /api/tags` now orders by position (nulls last), then name - `PATCH /api/tags/reorder` (auth-required) accepts ordered tag_ids - Alembic migration 598878310987 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Install @dnd-kit/core, @dnd-kit/sortable, @dnd-kit/utilities - Sidebar (vertical) and mobile pill strip (horizontal) both support drag reorder via dnd-kit SortableContext - Drag handles show on hover in sidebar; visible in pill strip - Drag handles only appear when authenticated (reorder is auth-required) - On drop: optimistic local reorder + async PATCH /api/tags/reorder - New "custom" sort mode (server position order); cycles usage → alpha → custom - Non-authenticated readers see custom order without drag handles Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
🚅 Deployed to the breadcrumbs-pr-71 environment in Breadcrumbs
|
- Fix N+1: compute next tag position once before loop, not per tag - Migration: backfill positions for existing tags (alphabetical order) so no tag starts as NULL after deploy - DnD: clear localOrder after successful server sync; rollback on error - SortToggle: fix label/title mapping for all three sort modes - Move nulls_last import to module level Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <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 #41
Summary
positioncolumn toTagmodel with Alembic migrationPATCH /api/tags/reorder(auth-required) assigns server-side positions from an ordered list of tag IDsGET /api/tagsnow returns tags in position order (nulls last, then alphabetical as tiebreaker)PATCH /api/tags/reorder+ query invalidationTest plan
uv run pytest(200/200)npm run build(type-clean)🤖 Generated with Claude Code