feat(desktop): add stash to composer context menu - #6484
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort 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 8fe24ad. Configure here.
ApprovabilityVerdict: Needs human review This PR adds a new 'Stash' option to the desktop app's native context menu, which is a new user-facing feature. It involves cross-process DOM detection and new IPC message handling between Electron's main process and the renderer. You can customize Macroscope's approvability policy. Learn more. |

The Electron composer context menu only exposed the standard editing actions, so prompt stashing was discoverable through the keyboard shortcut and stash badge but not from the native right-click menu.
This adds a native Stash item with the platform
CmdOrCtrl+Saccelerator when the context-menu target is the active chat composer. The main process dispatches the existingcomposer.stashmenu action back to the renderer, where it shares the same guarded stash path as the keyboard shortcut. Other editable fields keep the existing native menu unchanged, and composer states where stashing is unavailable do not advertise the action.User impact: desktop users can stash the current prompt directly from the existing Cut/Copy/Paste/Select All menu without changing web or mobile context-menu behavior.
Validation
pnpm exec vp test run apps/desktop/src/window/DesktopWindow.test.ts apps/web/src/keybindings.test.ts apps/web/src/promptStashStore.test.ts(78 tests passed)pnpm exec vp run --filter @t3tools/web --filter @t3tools/desktop typecheckVisual verification
Note
Add Stash option to the native context menu in the desktop composer
data-composer-stash.composer.stashaction overMENU_ACTION_CHANNELto the renderer; ChatComposer.tsx handles this viadesktopBridge.onMenuActionand routes it through the existing stash gate.data-composer-stashattribute is conditionally added to the composer container when stashing is allowed (not in approval, no pending inputs, no active progress), enabling the hit-test in Electron.Macroscope summarized 17b7d6e.
Note
Low Risk
Desktop-only UX wiring reuses the existing stash guards and menu-action channel; no auth, persistence, or web behavior changes.
Overview
Desktop users can Stash the current prompt from the native right-click menu on the chat composer, not only via the keyboard shortcut.
In
DesktopWindow, editable context menus run a zoom-adjustedelementFromPointhit-test for[data-composer-stash]before showing the menu. When the target is the composer, the menu adds Stash (CmdOrCtrl+S), which sendscomposer.stashover the existing menu-action IPC channel.In
ChatComposer, the editor wrapper getsdata-composer-stashonly when stashing is allowed; stash eligibility and execution are centralized inrunStashCommand, used by both the shortcut handler anddesktopBridge.onMenuAction. Other editable fields keep the standard Cut/Copy/Paste menu without Stash.Tests cover composer vs non-composer menus, zoom-adjusted coordinates, and the IPC payload on Stash click.
Reviewed by Cursor Bugbot for commit 17b7d6e. Bugbot is set up for automated code reviews on this repo. Configure here.