Repository navigation
feat(app): send browser, file and review comments to the session with Mod+Enter - #65264
Conversation
… Mod+Enter Comment editors in the browser pane, file viewer and review diff now offer the composer's second action: Send comment while the session is idle, and Steer comment or Queue comment by the follow-up behavior while it works. Adds Composer.delivery() and Composer.send() to the GUI plugin SDK, and centers the submit tooltip's rows.
Adds Composer/QuoteComment and Session/TimelineQuote stories, send variants to UI/LineComment, and a Delivery control to the Browser, Files and Review plugin stories.
There was a problem hiding this comment.
I found nothing blocking. I read the diff, then ran the composer, runtime-plugin, session-ui line-comment, ui line-comment and browser overlay-machine tests (all pass) and the type checks for app, gui-plugins, plugin, session-ui and ui (all clean). I couldn't exercise it end to end: the change is GUI-only and there's no TUI surface to drive here.
The send waits behind pending attach/update writes, so it finds the part it was just given, and a sent file comment also leaves the comments store, as a normal submit does.
Public API (GUI plugin SDK, additive): adds the ComposerDelivery type ("send" | "steer" | "queue"), Composer.delivery(): ComposerDelivery | undefined and Composer.send(commentID: string): void. Plugins that call Composer are unaffected; only code that implements Composer itself (mocks, alternate hosts) needs the two new methods.
One small behaviour change (inline comment): Mod+Enter used to save a comment in the full-size editor. Now it does nothing whenever nothing can be sent.
| updateCommentInContext({ id, file: p, selection, comment }) | ||
| updateCommentInContext({ id, file: p, selection, comment, send }) | ||
| }, | ||
| send: () => { |
There was a problem hiding this comment.
This always gives the editor an alternate action, disabled when delivery() is undefined. With allowsAlternate no longer limited to the compact variant, Mod+Enter in the full-size editor now goes to that disabled action and is swallowed. Before, it fell through to the normal save. So in a subagent session (no composer), while the model catalog loads, or while another send is in flight, Mod+Enter no longer saves the comment. The same applies to commentSend in review/model.ts and sendOverlay in the browser pane. Returning undefined when there is no composer to send to (at least in child sessions) would keep Mod+Enter saving there.
There was a problem hiding this comment.
Fixed in efe6ae8. The editor machine now lets Mod+Enter in a full-size editor fall through to the normal save while the alternate submit is disabled (no composer in a child session, catalog loading, or a send in flight). The compact variant keeps swallowing it. This covers the file view, commentSend in review/model.ts and the browser sendOverlay, since all three go through LineCommentEditor. I added a machine test for both variants.
There was a problem hiding this comment.
Confirmed, the fix works. In efe6ae8, textareaKey only takes the alternate path on Mod+Enter when alternateKeyReady(config) is true (machine.ts ~229 and ~371). When the alternate is disabled, a full-size editor now continues to the normal save, and a compact editor still swallows the key. File, review and the full-size browser overlay (panel.tsx:1669) all use the shared LineCommentEditor, so the fix covers all three. The compact browser editor (panel.tsx:1586) keeps swallowing the key, as you intended.
I ran bun test src/data-display/line-comment at pr/head in a temporary worktree: 16 pass, including the new test that covers both variants. I then removed the worktree. I changed nothing in repo/. The bun.lock change in git status was already there.
Two small gaps remain in the full-size editor while the alternate is disabled. Neither blocks merge:
- Label: holding ⌘ still sets
alternateActive, so the footer button shows the disabled "Send/Steer comment" label (defaultDisabled,machine.ts:209). Mod+Enter in the textarea now saves, so the button doesn't match what the key does. One fix is to leavealternateActiveoff for non-compact editors whenalternateSubmit.disabled. - ⌘-click on the footer button:
action.clickedwithmodifiedstill goes tosubmit(..., true), which does nothing, and the button is disabled in that state anyway. That's consistent with the label, so it's fine if you fix the label.
|
Re the review summary: the one behaviour change it flags (Mod+Enter doing nothing when nothing can be sent) is the same finding as the inline thread and is fixed in efe6ae8. Mod+Enter now saves the comment in that case. The rest of the summary has no findings. |
|
Confirmed: efe6ae8 fixes it. In a full-size editor whose alternate action is disabled, Mod+Enter now saves the comment like Enter does. This covers subagent sessions, model catalog loading and a send already in flight, in the file, review and browser editors. A compact editor still swallows the key, as before. The fix is the new I ran One small leftover, not blocking: the button's ⌘ preview wasn't changed. If you hold ⌘ over the full-size button while nothing can be sent, it still shows the disabled "Send/Steer comment" label, and ⌘-click does nothing. Pressing Mod+Enter in the textarea saves. I didn't change any files. The only local change in |
There was a problem hiding this comment.
efe6ae8 fixes the earlier thread: in a full-size editor, Mod+Enter now saves the comment like Enter when nothing can be sent, and a compact editor still ignores it. I checked it with the line-comment tests in packages/ui (16 pass) but didn't run it in the app. Not blocking: holding ⌘ over the full-size button while nothing can be sent still shows the disabled send label, and ⌘-click does nothing. This commit doesn't change the public API. The PR as a whole adds ComposerDelivery, Composer.delivery() and Composer.send(commentID) to the GUI plugin SDK, without breaking existing callers.
There was a problem hiding this comment.
The new commit only merges dev (#65002). The merge is clean and none of this pull request's files change, so there's nothing new to review and no open threads. The public API impact is still the same additive change to the GUI plugin SDK (ComposerDelivery, Composer.delivery(), Composer.send(commentID)).
Summary
The comment editors in the browser pane, file viewer and review diff now have the same second action as quoting in the timeline. ⌘⏎ (or ⌘-click) attaches the comment and sends it right away:
The submit button's tooltip lists both actions, with each row centered, and holding ⌘ switches the button's label. The timeline's own quote editor is unchanged ("Steer with quote" uses its Mod+Enter delivery).
packages/plugin/src/gui/host-apis.ts): addsComposer.delivery()andComposer.send(commentID), with TSDoc.sendflag, and the sharedLineCommentEditorfull-size footer now gets the tooltip and the ⌘ label switch the compact editor already had.Composer/QuoteCommentandSession/TimelineQuotestories, send states inUI/LineComment, and a Delivery control on the Browser, Files and Review plugin stories.No feature flag. The change is client-only and adds an action next to the existing ones; plain Enter behaves as before.
Visual
Browser element comment: before / after
File viewer line comment: before / after
Review diff comment: before / after
The before shots are from
origin/devand the after shots from this branch, both in the Components Lab plugin stories with the same viewport and theme. The after states use Delivery: Steer.Checks
bun run check(root): passed, 35/35bun typecheckin app, gui-plugins, session-ui, ui and plugin: passedbun test:src/browser/electron-crash.test.ts(Electron reportskilledinstead ofcrashed); it fails the same way on untouchedorigin/dev.browser-pane,line-comment,plugin-): 153 passedbun run lint:changed origin/dev: 0 problemsscript/sdk-docs.ts: 0 problemsAdded by the opencode bot (AI-generated).
Public API: adds
ComposerDelivery,Composer.delivery()andComposer.send(commentID)to the GUI plugin SDK (backwards compatible for callers)