feat: add context menu support for editable fields#1870
Conversation
Generated-By: PostHog Code Task-Id: b318a92e-0eeb-4cd9-8602-e64a1ee35c09
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/code/src/renderer/features/message-editor/components/PromptInput.tsx
Line: 277-279
Comment:
**stopPropagation applied to entire InputGroup, not just the editor**
`handleContextMenu` unconditionally stops propagation on the `InputGroup` wrapper, which also encloses the send button and the `AttachmentsBar`. Right-clicking those sub-elements will suppress the Radix context menu without triggering the Electron native menu either (since `params.isEditable` will be `false` for a button/non-editable area), leaving the user with no context menu at all. This matches the pattern used by `SessionView`'s handler — which only stops propagation when the target is actually an editable element — so aligning the two would be more consistent.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat: add context menu support for edita..." | Re-trigger Greptile |
| onClick={handleContainerClick} | ||
| onContextMenu={handleContextMenu} | ||
| className={`h-auto bg-card ${isBashMode ? "ring-1 ring-blue-9" : ""}`} |
There was a problem hiding this comment.
stopPropagation applied to entire InputGroup, not just the editor
handleContextMenu unconditionally stops propagation on the InputGroup wrapper, which also encloses the send button and the AttachmentsBar. Right-clicking those sub-elements will suppress the Radix context menu without triggering the Electron native menu either (since params.isEditable will be false for a button/non-editable area), leaving the user with no context menu at all. This matches the pattern used by SessionView's handler — which only stops propagation when the target is actually an editable element — so aligning the two would be more consistent.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/message-editor/components/PromptInput.tsx
Line: 277-279
Comment:
**stopPropagation applied to entire InputGroup, not just the editor**
`handleContextMenu` unconditionally stops propagation on the `InputGroup` wrapper, which also encloses the send button and the `AttachmentsBar`. Right-clicking those sub-elements will suppress the Radix context menu without triggering the Electron native menu either (since `params.isEditable` will be `false` for a button/non-editable area), leaving the user with no context menu at all. This matches the pattern used by `SessionView`'s handler — which only stops propagation when the target is actually an editable element — so aligning the two would be more consistent.
How can I resolve this? If you propose a fix, please make it concise.
now you can right click > paste
Created with PostHog Code