Honor iMessage workspace ordering and previews - #4062
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughRenames workspace preview tracking from latestSubmittedMessage to latestConversationMessage, wires it through snapshots/UI and terminal feed, refactors WorkstreamEvent message extraction to key-driven helpers, adds assistant-final handling and conditional tab reordering, and forces top insertion when iMessage mode is enabled. ChangesiMessage Conversation Message Flow
Sequence Diagram(s)sequenceDiagram
participant Client
participant TerminalController
participant TabManager
participant Workspace
participant SidebarUI
Client->>TerminalController: incoming feed event (userPromptSubmit / stop)
TerminalController->>TabManager: v2ApplyIMessageModeSideEffects -> dispatch handler
TabManager->>Workspace: handleConversationMessage / recordConversationMessage(message)
Workspace-->>TabManager: messageRecorded / preview
TabManager->>SidebarUI: update snapshot (latestConversationMessage) / reorder tabs
SidebarUI-->>Client: render updated subtitle
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (12 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR wires up iMessage-mode workspace ordering and sidebar previews. New workspaces now insert at the top of the unpinned segment (pinned tabs remain first), and the sidebar preview tracks both user prompt submits and assistant final messages from
Confidence Score: 5/5Safe to merge; changes are well-scoped to iMessage mode and do not affect non-iMessage workspace behavior. The stop/subagentStop path now uses a non-blocking Task { @mainactor } instead of the synchronous main-thread hop, which is an improvement over the pre-existing userPromptSubmit pattern. The reorder guard correctly handles both new and duplicate assistant messages. The effectivePlacement helper cleanly centralizes iMessage placement logic without touching non-iMessage paths. Tests cover the key scenarios including duplicate-message reordering and blank-message suppression. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "fix: handle repeated assistant imessage ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 705d7ec. Configure here.
| message: assistantFinalMessage, | ||
| iMessageModeEnabled: iMessageModeEnabled | ||
| ) | ||
| } |
There was a problem hiding this comment.
Async stop handling races with synchronous prompt handling
Low Severity
The .stop/.subagentStop branch dispatches sidebar updates via a fire-and-forget Task { @MainActor }, while .userPromptSubmit uses the synchronous v2MainSync. Because the Task is not awaited and ingestBlocking proceeds immediately, a prompt-submit event arriving shortly after a stop event can have its synchronous v2MainSync handler execute before the stop event's Task, causing moveTabToTop calls to run in reverse chronological order. This could make the sidebar workspace ordering briefly inconsistent with the actual event timeline.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 705d7ec. Configure here.


Task: iMessage mode workspace ordering and sidebar previews.
Changes:
Testing:
Note
Medium Risk
Changes workspace insertion/reordering behavior and feed-event side effects in iMessage mode, which can impact tab ordering, selection, and sidebar rendering. Risk is limited to UI/state updates (no auth/data persistence changes) but touches central
TabManagerand event-handling paths.Overview
Improves iMessage mode workspace behavior and sidebar previews. New workspaces now insert at the top of the unpinned segment when iMessage mode is enabled (via
WorkspacePlacementSettings.effectivePlacement), keeping pinned workspaces grouped first.Sidebar preview text is renamed and expanded from
latestSubmittedMessagetolatestConversationMessage, and is now updated from both user prompt submits and assistant final responses;.stop/.subagentStopfeed events trigger these assistant-final side effects.Global search browse hits now treat
.rightSidebarToolpanels like title-only panels (previously excluded from the switch).Reviewed by Cursor Bugbot for commit 705d7ec. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Makes iMessage mode feel like Messages: new workspaces go to the top of unpinned tabs, and the sidebar shows the latest conversation message (user prompt or assistant final). Stop events now count as assistant finals for previews and ordering, and repeated finals still bump the thread.
New Features
.stop/.subagentStop; extracts text from event JSON/context and trims whitespace.Bug Fixes
Written for commit 705d7ec. Summary will update on new commits.
Summary by CodeRabbit
New Features
Improvements
Tests