feat(mothership): pin tasks to keep them at the top of the sidebar#4582
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates the sidebar to display a Pin/Unpin action in the task context menu, show a pin indicator when applicable, and adds a Reviewed by Cursor Bugbot for commit 7b9eb34. Configure here. |
Greptile SummaryThis PR adds a "pin task" feature for mothership chats: a new
Confidence Score: 5/5Safe to merge — the pin/unpin path is end-to-end consistent (migration, schema, contract, API, hooks, UI) with proper optimistic rollback. All layers (DB migration, Drizzle schema, Zod contract, API route, React Query hook, sidebar UI) are updated consistently. The optimistic update correctly partitions the cache and rolls back on error. No auth or data-integrity issues were found. The only callouts are a misleading variable name in two places and the absence of a compound DB index for the new two-column sort — neither affects correctness. No files require special attention; the Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Sidebar
participant useSetTaskPinned
participant QueryCache
participant PATCH /chats/[chatId]
participant DB
User->>Sidebar: Right-click task → Pin/Unpin
Sidebar->>useSetTaskPinned: "mutate({ chatId, pinned: !current })"
useSetTaskPinned->>QueryCache: cancelQueries + snapshot previousTasks
useSetTaskPinned->>QueryCache: setQueryData (optimistic: partition pinned/unpinned)
useSetTaskPinned->>PATCH /chats/[chatId]: { pinned }
PATCH /chats/[chatId]->>DB: UPDATE copilot_chats SET pinned=...
DB-->>PATCH /chats/[chatId]: updated row
PATCH /chats/[chatId]-->>useSetTaskPinned: { success: true }
useSetTaskPinned->>QueryCache: invalidateQueries (onSettled)
QueryCache-->>Sidebar: re-render with server-confirmed order
note over useSetTaskPinned,QueryCache: On error: restore previousTasks snapshot
Reviews (3): Last reviewed commit: "fix(tasks): insert new optimistic tasks ..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7b9eb34. Configure here.
Summary
pinnedflag to mothership chats; sort pinned tasks to the top of the sidebar...overlays on hoverType of Change
Testing
Tested manually. Updated
tasks.test.tsfor the new contract field; mothership chat route tests still pass.Checklist