提交0.1.0版本

- 完成了书签的基本功能和插件
This commit is contained in:
2026-01-21 23:09:33 +08:00
parent 3e2d1456eb
commit 1a3bbac9ff
95 changed files with 12431 additions and 12445 deletions

View File

@@ -1,24 +1,24 @@
# Design: Persistent ordering + touch-friendly DnD
## Database
- Add `sort_order integer not null default 0` to `bookmarks`.
- Add indexes to support ordered listing:
- `(user_id, folder_id, sort_order)`
## API
- Extend `Bookmark` DTO/schema with `sortOrder`.
- Add `POST /bookmarks/reorder` similar to existing `/folders/reorder`:
- Input: `{ folderId: uuid|null, orderedIds: uuid[] }`
- Validates `orderedIds` is a permutation of all bookmarks for that user+folder (excluding deleted).
- Transactionally updates `sort_order` for each id.
## Web UI
- Replace native HTML5 drag/drop with a touch-capable approach.
- Implementation choice: `sortablejs` (small, proven, touch-friendly).
- Bind Sortable to:
- Folder header list (per parent group) for folder ordering.
- Each open folders bookmark list for bookmark ordering.
- Root group is rendered as a first-class group and can also be reordered.
## Compatibility
- If the DB schema lacks ordering columns (fresh/old DB), endpoints should return a clear 409 prompting `db:migrate`.
# Design: Persistent ordering + touch-friendly DnD
## Database
- Add `sort_order integer not null default 0` to `bookmarks`.
- Add indexes to support ordered listing:
- `(user_id, folder_id, sort_order)`
## API
- Extend `Bookmark` DTO/schema with `sortOrder`.
- Add `POST /bookmarks/reorder` similar to existing `/folders/reorder`:
- Input: `{ folderId: uuid|null, orderedIds: uuid[] }`
- Validates `orderedIds` is a permutation of all bookmarks for that user+folder (excluding deleted).
- Transactionally updates `sort_order` for each id.
## Web UI
- Replace native HTML5 drag/drop with a touch-capable approach.
- Implementation choice: `sortablejs` (small, proven, touch-friendly).
- Bind Sortable to:
- Folder header list (per parent group) for folder ordering.
- Each open folders bookmark list for bookmark ordering.
- Root group is rendered as a first-class group and can also be reordered.
## Compatibility
- If the DB schema lacks ordering columns (fresh/old DB), endpoints should return a clear 409 prompting `db:migrate`.