Add “Mark unread” thread action in sidebar context menu - #104
Conversation
- Add `mark-unread` option to thread context menu and dispatch reducer action - Implement `MARK_THREAD_UNREAD` to set `lastVisitedAt` just before latest completion - Add reducer tests for unread behavior and no-op when no completed turn - Update fallback context menu styling so only delete uses destructive color
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Mark unread undone when viewing thread
- Added a guard in ChatView's auto-visit effect to skip dispatching MARK_THREAD_VISITED when lastVisitedAt equals the sentinel value (latestTurnCompletedAt - 1ms) set by MARK_THREAD_UNREAD.
Or push these changes by commenting:
@cursor push 8e11ca162e
Preview (8e11ca162e)
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -380,6 +380,9 @@
if (Number.isNaN(turnCompletedAt)) return;
const lastVisitedAt = activeThread.lastVisitedAt ? Date.parse(activeThread.lastVisitedAt) : NaN;
if (!Number.isNaN(lastVisitedAt) && lastVisitedAt >= turnCompletedAt) return;
+ // MARK_THREAD_UNREAD sets lastVisitedAt to turnCompletedAt - 1ms as a
+ // sentinel. Don't auto-mark visited if the user explicitly marked unread.
+ if (!Number.isNaN(lastVisitedAt) && lastVisitedAt === turnCompletedAt - 1) return;
dispatch({
type: "MARK_THREAD_VISITED",Constraint: Jarvis PRs pingdotgg#97-pingdotgg#104 expose parent_chat_id for project threads and this task required a tight sidebar/conversation-only diff.\nRejected: Rewriting sidebar project grouping or composer flows | outside P3 ownership and likely to conflict with parallel agents.\nConfidence: high\nScope-risk: narrow\nDirective: Keep contracts schema-only and keep future child-chat creation separate from this render-only tree work.\nTested: pnpm exec vp test apps/web/src/components/chatTree.logic.test.ts; pnpm exec vp check; pnpm exec vp run typecheck\nNot-tested: Manual browser dogfood; task explicitly said not to run dev servers.
|
Coordinator reconciliation pass sealed.
No controller work item, phone build or install, PR, merge, or acceptance verdict was created. |

Summary
mark-unreadoption to the thread context menu in the sidebar beforeDelete.mark-unreadto dispatchMARK_THREAD_UNREAD, updating thread read state without triggering delete flow.MARK_THREAD_UNREADin the store reducer by settinglastVisitedAtto 1ms beforelatestTurnCompletedAt.Deleteonly.Testing
apps/web/src/store.test.tsforMARK_THREAD_UNREADbehavior.lastVisitedAtbecomeslatestTurnCompletedAt - 1msand is strictly earlier than completion time.latestTurnCompletedAtis absent.Note
Low Risk
Low risk UI/state update: adds a new reducer action to tweak
lastVisitedAtand a context-menu entry to trigger it; minimal surface area with unit coverage.Overview
Adds a “Mark unread” entry to the sidebar thread context menu (ahead of Delete) that dispatches
MARK_THREAD_UNREADand exits before the delete flow.Implements
MARK_THREAD_UNREADin the store reducer by setting a thread’slastVisitedAtto 1ms beforelatestTurnCompletedAt(no-op if missing/invalid), updates the non-Electron context-menu fallback styling so onlydeleteis destructive-colored, and addsvitestcoverage for the new reducer behavior.Written by Cursor Bugbot for commit c0e3c1a. This will update automatically on new commits. Configure here.
Note
Add a 'Mark unread' action to the sidebar thread context menu and dispatch
MARK_THREAD_UNREADto setlastVisitedAttolatestTurnCompletedAtminus 1 msIntroduce
MARK_THREAD_UNREADin the store reducer and wire it to the sidebar context menu; adjust non-destructive context menu item styling in contextMenuFallback.ts; add reducer tests in store.test.ts.📍Where to Start
Start with the
handleThreadContextMenucallback in Sidebar.tsx, then review thereducercase forMARK_THREAD_UNREADin store.ts.Macroscope summarized c0e3c1a.