Skip to content

The agent that grows with you

fix: honour middle-click on the composer directive pill

teknium149ec28fb1f17
diff --git a/apps/desktop/src/app/chat/composer/directive-actions.tsx b/apps/desktop/src/app/chat/composer/directive-actions.tsx
index edf8c100071..df261d87ec5 100644
--- a/apps/desktop/src/app/chat/composer/directive-actions.tsx
+++ b/apps/desktop/src/app/chat/composer/directive-actions.tsx
@@ -143,6 +143,14 @@ export function ComposerDirectiveActions({ editorRef }: { editorRef: RefObject<H
// The pill is the composer's stand-in for clicking the link, so it
// honours the same convention: ⌘/Ctrl-click escapes to the system
// browser instead of the in-app pane.
+ onAuxClick={event => {
+ // Middle-click never fires `click`; it's the other half of the
+ // open-elsewhere convention.
+ if (event.button === 1) {
+ anchor.action.run(anchor.value, { native: true })
+ setAnchor(null)
+ }
+ }}
onClick={event => {
anchor.action.run(anchor.value, { native: wantsNativeBrowser(event.nativeEvent) })
setAnchor(null)