Skip to content

feat(desktop): add stash to composer context menu - #6484

Open
edoedac0 wants to merge 4 commits into
pingdotgg:mainfrom
edoedac0:agent/add-stash-to-native-composer-menu
Open

feat(desktop): add stash to composer context menu#6484
edoedac0 wants to merge 4 commits into
pingdotgg:mainfrom
edoedac0:agent/add-stash-to-native-composer-menu

Conversation

@edoedac0

@edoedac0 edoedac0 commented Aug 13, 2026

Copy link
Copy Markdown

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+S accelerator when the context-menu target is the active chat composer. The main process dispatches the existing composer.stash menu 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)
  • targeted lint for the four changed files
  • pnpm exec vp run --filter @t3tools/web --filter @t3tools/desktop typecheck
  • manual Electron verification: the macOS native menu exposed Cut, Copy, Paste, Select All, and Stash; selecting Stash used the existing stash flow

Visual verification

Before After
Before: native composer menu with standard editing actions After: native composer menu with Stash and Command-S shortcut

Note

Add Stash option to the native context menu in the desktop composer

  • Adds a 'Stash' menu item (Cmd/Ctrl+S) to the native right-click context menu in DesktopWindow.ts, shown only when the click target is inside an element marked with data-composer-stash.
  • Clicking the item sends a composer.stash action over MENU_ACTION_CHANNEL to the renderer; ChatComposer.tsx handles this via desktopBridge.onMenuAction and routes it through the existing stash gate.
  • The data-composer-stash attribute 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.
  • Zoom factor is applied when converting window pixel coordinates to CSS pixels for accurate hit testing.

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-adjusted elementFromPoint hit-test for [data-composer-stash] before showing the menu. When the target is the composer, the menu adds Stash (CmdOrCtrl+S), which sends composer.stash over the existing menu-action IPC channel.

In ChatComposer, the editor wrapper gets data-composer-stash only when stashing is allowed; stash eligibility and execution are centralized in runStashCommand, used by both the shortcut handler and desktopBridge.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.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 84040a44-694d-4668-a183-53c78ca91a46

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 13, 2026
@edoedac0
edoedac0 marked this pull request as ready for review August 13, 2026 16:08

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/desktop/src/window/DesktopWindow.ts
@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Comment thread apps/desktop/src/window/DesktopWindow.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant