Skip to content

Cmd+Enter on a single inbox report opens Create PR dialog#1892

Merged
jonathanlab merged 5 commits into
mainfrom
posthog-code/inbox-cmd-enter-create-pr
May 19, 2026
Merged

Cmd+Enter on a single inbox report opens Create PR dialog#1892
jonathanlab merged 5 commits into
mainfrom
posthog-code/inbox-cmd-enter-create-pr

Conversation

@posthog
Copy link
Copy Markdown
Contributor

@posthog posthog Bot commented Apr 27, 2026

Summary

  • Adds a window-level keydown handler in ReportDetailPane that fires the same handleOpenCloudConfirm callback as the inline "Create PR" button.
  • Only active while a single report is selected (the pane is only mounted in that case) and the report is eligible (canCreateImplementationPr).
  • Skips when focus is in an input/textarea/select/contenteditable, or when a Radix dialog/popper is already open — so cmd+enter inside the cloud confirm dialog still goes to its TextArea.

Test plan

  • Select a single ready/pending-input report in the inbox; press cmd/ctrl+Enter → cloud confirm dialog opens.
  • Multi-select two reports; cmd+Enter does nothing (MultiSelectStack is shown, ReportDetailPane is unmounted).
  • Focus the report-list search input and press cmd+Enter → no dialog.
  • With the cloud confirm dialog open, cmd+Enter inside the prompt textarea does not re-open the dialog.

Created with PostHog Code

PostHog Code and others added 3 commits April 27, 2026 09:01
Mirrors the existing Create PR run-action button so the keyboard
shortcut and the click target stay in sync.

Generated-By: PostHog Code
Task-Id: 35931fe5-864a-4502-89a5-b0a98c8e7f21
Generated-By: PostHog Code
Task-Id: c5674c04-c95c-4bfe-bfcf-248a921b4aae
@jonathanlab jonathanlab marked this pull request as ready for review May 19, 2026 13:21
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 19, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/inbox/components/detail/ReportDetailPane.tsx:303
The `[contenteditable='true']` selector only matches elements that explicitly set `contenteditable="true"`. Many rich-text editors (ProseMirror, CodeMirror, Slate, Tiptap) set the attribute as `contenteditable` (bare attribute) or `contenteditable=""`, which HTML treats as true but the CSS attribute selector `[contenteditable='true']` won't match. If any future dialog renders such an editor, Cmd+Enter would fire the task-creation shortcut unexpectedly.

```suggestion
        target?.closest("input, select, textarea, [contenteditable]:not([contenteditable='false'])")
```

Reviews (1): Last reviewed commit: "resolve merge: port cmd+enter handler to..." | Re-trigger Greptile

}
const target = e.target as HTMLElement | null;
if (
target?.closest("input, select, textarea, [contenteditable='true']")
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.

P2 The [contenteditable='true'] selector only matches elements that explicitly set contenteditable="true". Many rich-text editors (ProseMirror, CodeMirror, Slate, Tiptap) set the attribute as contenteditable (bare attribute) or contenteditable="", which HTML treats as true but the CSS attribute selector [contenteditable='true'] won't match. If any future dialog renders such an editor, Cmd+Enter would fire the task-creation shortcut unexpectedly.

Suggested change
target?.closest("input, select, textarea, [contenteditable='true']")
target?.closest("input, select, textarea, [contenteditable]:not([contenteditable='false'])")
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/detail/ReportDetailPane.tsx
Line: 303

Comment:
The `[contenteditable='true']` selector only matches elements that explicitly set `contenteditable="true"`. Many rich-text editors (ProseMirror, CodeMirror, Slate, Tiptap) set the attribute as `contenteditable` (bare attribute) or `contenteditable=""`, which HTML treats as true but the CSS attribute selector `[contenteditable='true']` won't match. If any future dialog renders such an editor, Cmd+Enter would fire the task-creation shortcut unexpectedly.

```suggestion
        target?.closest("input, select, textarea, [contenteditable]:not([contenteditable='false'])")
```

How can I resolve this? If you propose a fix, please make it concise.

Generated-By: PostHog Code
Task-Id: c5674c04-c95c-4bfe-bfcf-248a921b4aae
Generated-By: PostHog Code
Task-Id: c5674c04-c95c-4bfe-bfcf-248a921b4aae
@jonathanlab jonathanlab enabled auto-merge (squash) May 19, 2026 13:28
@jonathanlab jonathanlab merged commit 7bfd4d3 into main May 19, 2026
15 checks passed
@jonathanlab jonathanlab deleted the posthog-code/inbox-cmd-enter-create-pr branch May 19, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants