aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/routers/lists.ts (follow)
Commit message (Collapse)AuthorAgeFilesLines
* feat: Add collaborative lists (#2146)Mohamed Bassem2025-11-171-18/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: Add collaborative lists backend implementation This commit implements the core backend functionality for collaborative lists, allowing multiple users to share and interact with bookmark lists. Database changes: - Add listCollaborators table to track users with access to lists and their roles (viewer/editor) - Add addedBy field to bookmarksInLists to track who added bookmarks - Add relations for collaborative list functionality Access control updates: - Update List model to support role-based access (owner/editor/viewer) - Add methods to check and enforce permissions for list operations - Update Bookmark model to allow access through collaborative lists - Modify bookmark queries to include bookmarks from collaborative lists List collaboration features: - Add/remove/update collaborators - Get list of collaborators - Get lists shared with current user - Only manual lists can have collaborators tRPC procedures: - addCollaborator: Add a user as a collaborator to a list - removeCollaborator: Remove a collaborator from a list - updateCollaboratorRole: Change a collaborator's role - getCollaborators: Get all collaborators for a list - getSharedWithMe: Get all lists shared with the current user - cloneBookmark: Clone a bookmark to the current user's collection Implementation notes: - Editors can add/remove bookmarks from the list (must own the bookmark) - Viewers can only view bookmarks in the list - Only the list owner can manage collaborators and list metadata - Smart lists cannot have collaborators (only manual lists) - Users cannot edit bookmarks they don't own, even in shared lists * feat: Add collaborative lists frontend UI This commit implements the frontend user interface for collaborative lists, allowing users to view shared bookmarks and manage list collaborators. New pages: - /dashboard/shared: Shows bookmarks from lists shared with the user - Displays bookmarks from all collaborative lists - Uses SharedBookmarks component - Shows empty state when no lists are shared Navigation: - Added "Shared with you" link to sidebar with Users icon - Positioned after "Home" in main navigation - Available in both desktop and mobile sidebar Collaborator management: - ManageCollaboratorsModal component for managing list collaborators - Add collaborators by user ID with viewer/editor role - View current collaborators with their roles - Update collaborator roles inline - Remove collaborators - Shows empty state when no collaborators - Integrated into ListOptions dropdown menu - Accessible via "Manage Collaborators" menu item Components created: - SharedBookmarks.tsx: Server component fetching shared lists/bookmarks - ManageCollaboratorsModal.tsx: Client component with tRPC mutations - /dashboard/shared/page.tsx: Route for shared bookmarks page UI features: - Role selector for viewer/editor permissions - Real-time collaborator list updates - Toast notifications for success/error states - Loading states for async operations - Responsive design matching existing UI patterns Implementation notes: - Uses existing tRPC endpoints (getSharedWithMe, getCollaborators, etc.) - Follows established modal patterns from ShareListModal - Integrates seamlessly with existing list UI - Currently uses user ID for adding collaborators (email lookup TBD) * fix typecheck * add collaborator by email * add shared list in the sidebar * fix perm issue * hide UI components from non list owners * list leaving * fix shared bookmarks showing up in homepage * fix getBookmark access check * e2e tests * hide user specific fields from shared lists * simplify bookmark perm checks * disable editable fields in bookmark preview * hide lists if they don't have options * fix list ownership * fix highlights * move tests to trpc * fix alignment of leave list * make tag lists unclickable * allow editors to remove from list * add a badge for shared lists * remove bookmarks of user when they're removed from a list * fix tests * show owner in the manage collab modal * fix hasCollab * drop shared with you * i18n * beta badge * correctly invalidate caches on collab change * reduce unnecessary changes * Add ratelimits * stop manually removing bookmarks on remove * some fixes * fixes * remove unused function * improve tests --------- Co-authored-by: Claude <noreply@anthropic.com>
* feat: recursive list delete (#1989)Mohamed Bassem2025-09-281-1/+6
|
* refactor: Move webhook, users and tags into modelsMohamedBassem2025-08-021-9/+9
|
* feat: Generate RSS feeds from lists (#1507)Mohamed Bassem2025-05-311-0/+43
| | | | | | | | | | | * refactor: Move bookmark utils from shared-react to shared * Expose RSS feeds for lists * Add e2e tests * Slightly improve the look of the share dialog * allow specifying a limit in the rss endpoint
* feat: Implement generic rule engine (#1318)Mohamed Bassem2025-04-271-1/+2
| | | | | | | | | | | | | | | | | * Add schema for the new rule engine * Add rule engine backend logic * Implement the worker logic and event firing * Implement the UI changesfor the rule engine * Ensure that when a referenced list or tag are deleted, the corresponding event/action is * Dont show smart lists in rule engine events * Add privacy validations for attached tag and list ids * Move the rules logic into a models
* feat(web): Add support for merging lists (#1231)omnitrix2025-04-161-0/+13
| | | | | | | | | | | * feat: Support list merging * some fixes * move @hoarder to @karakeep --------- Co-authored-by: Mohamed Bassem <me@mbassem.com>
* chore: Rename hoarder packages to karakeepMohamedBassem2025-04-121-1/+1
|
* feat(web): Show list stats in the sidebarMohamed Bassem2025-03-021-0/+11
|
* refactor: Move the list logic into a separate modelMohamed Bassem2025-03-021-169/+20
|
* feat: Add support for smart lists (#802)Mohamed Bassem2025-01-021-20/+39
| | | | | | | | | | | | | | | | | | | * feat: Add support for smart lists * i18n * Fix update list endpoint * Add a test for smart lists * Add header to the query explainer * Hide remove from lists in the smart context list * Add proper validation to list form --------- Co-authored-by: Deepak Kapoor <41769111+orthdron@users.noreply.github.com>
* feature: Add APIs to create new lists and bookmarksMohamed Bassem2024-10-201-10/+4
|
* fix: Increase list name size to max 40 chars up from 20. Fixes #254MohamedBassem2024-07-011-1/+1
|
* feature(extension): Allow adding tags and lists to newly hoarded bookmarksMohamedBassem2024-04-231-0/+20
|
* feature: Nested lists (#110). Fixes #62Mohamed Bassem2024-04-191-30/+49
| | | | | * feature: Add support for nested lists * prevent moving the parent to a subtree
* refactor: Move the shared types to the shared packageMohamedBassem2024-04-181-1/+1
|
* format: Add missing lint and format, and format the entire repoMohamedBassem2024-03-301-1/+2
|
* feature(web): Add support for removing items from listsMohamedBassem2024-03-201-2/+29
|
* feature(web): Add support for demo modeMohamedBassem2024-03-191-5/+10
|
* refactor: Extract trpc logic into its packageMohamedBassem2024-03-051-0/+173