feat(favorites): add per-user favorite pages#1310
Merged
Merged
Conversation
Adds a private, per-user favorites list, separate from the global editorial "Pinned Pages" flag: any authenticated user (not just editor/admin) can favorite/unfavorite any page they can read. Backend: new internal/favorites package (own favorites.db, outside resync's reach per ADR-0001), AddFavorite/RemoveFavorite/ListFavorites use cases, PUT/DELETE /api/pages/:id/favorite and GET /api/favorites routes, cascade cleanup on page delete and user delete. Frontend: stores/favorites.ts (optimistic add/remove), star toggle on tree rows and the page viewer header, new "Favorites" sidebar accordion section between Pinned and Pages, loaded/cleared reactively off the session user id in App.tsx.
mrchypark
added a commit
to mrchypark/leafwiki
that referenced
this pull request
Jul 15, 2026
* feat(editor): make preview split resizable (perber#1279) * feat(tree): drag & drop page/section reordering in the page tree (perber#1307) Reorder and move pages/sections directly in the sidebar tree by dragging rows: drop between rows to reorder (insertion indicator), drop onto a section to move into it (auto-expands collapsed sections on hover), with optimistic updates and a silent tree re-sync. Same-parent reorders use the existing sort endpoint; cross-parent drops use the move endpoint, which now accepts an optional position for atomic move+placement (MoveNodeToPosition; omitted position appends, so existing callers are unchanged). Also folds in two fixes surfaced while testing the feature: - Firefox performed a full page navigation on drop because the post-drag click bypasses React's synthetic handlers; click suppression is now a native window-level capture listener armed during the drag. - MarkdownPreview re-parsed and re-rendered the whole article on every tree store update (byId identity churn); the rendered markdown element is now memoized on the resolved content string. Fixes perber#1110 * feat(favorites): add per-user favorite pages (perber#1310) Adds a private, per-user favorites list, separate from the global editorial "Pinned Pages" flag: any authenticated user (not just editor/admin) can favorite/unfavorite any page they can read. Backend: new internal/favorites package (own favorites.db, outside resync's reach per ADR-0001), AddFavorite/RemoveFavorite/ListFavorites use cases, PUT/DELETE /api/pages/:id/favorite and GET /api/favorites routes, cascade cleanup on page delete and user delete. Frontend: stores/favorites.ts (optimistic add/remove), star toggle on tree rows and the page viewer header, new "Favorites" sidebar accordion section between Pinned and Pages, loaded/cleared reactively off the session user id in App.tsx. * refactor(sqliteutil): share open/corruption-recovery logic across stores (perber#1311) Extract the "open → ensure schema → on recoverable SQLite corruption, wipe and retry once" sequence, previously copy-pasted near-verbatim in tags, links, properties, and search's store constructors, into a single sqliteutil.RetryOnCorruption helper. Each store keeps its own opening mechanics (eager sql.Open, links' lazy Connect(), search's fully lazy withDB); only the recovery policy is now shared. * feat(preview): add AutoHotkey syntax highlighting (perber#1312) Co-authored-by: Chen Zhang <c436zhan@gmail.com> * test(e2e): stabilize CodeMirror replace flow * fix: address upstream sync review findings * fix: guard favorite snapshot visibility --------- Co-authored-by: Abu Hossain Foysal <ahfoysal30@gmail.com> Co-authored-by: Aurelio Arcabascio <140868181+arcabaa@users.noreply.github.com> Co-authored-by: perber <patrick.erber@gmail.com> Co-authored-by: c436zhan <zc19970919@gmail.com> Co-authored-by: Chen Zhang <c436zhan@gmail.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.
Adds a private, per-user favorites list, separate from the global editorial "Pinned Pages" flag: any authenticated user (not just editor/admin) can favorite/unfavorite any page they can read.
Backend: new internal/favorites package (own favorites.db, outside resync's reach per ADR-0001), AddFavorite/RemoveFavorite/ListFavorites use cases, PUT/DELETE /api/pages/:id/favorite and GET /api/favorites routes, cascade cleanup on page delete and user delete.
Frontend: stores/favorites.ts (optimistic add/remove), star toggle on tree rows and the page viewer header, new "Favorites" sidebar accordion section between Pinned and Pages, loaded/cleared reactively off the session user id in App.tsx.