Skip to content

feat(app): send browser, file and review comments to the session with Mod+Enter - #65264

Merged
usrnk1 merged 4 commits into
devfrom
comment-steer
Nov 20, 2026
Merged

usrnk1 merged 4 commits into
devfrom
comment-steer

Conversation

@usrnk1

@usrnk1 usrnk1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Send comment while the agent is idle
  • Steer comment or Queue comment while it works, following the Follow-up behavior setting

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

  • App: the composer's single-quote send now sends any attached part (quote, note or file comment) on its own. A sent file comment also leaves the file's comments.
  • GUI plugin SDK (packages/plugin/src/gui/host-apis.ts): adds Composer.delivery() and Composer.send(commentID), with TSDoc.
  • Plugins: the browser, file and review editors pass the action through. session-ui's line comment machine carries a send flag, and the shared LineCommentEditor full-size footer now gets the tooltip and the ⌘ label switch the compact editor already had.
  • Components Lab: adds Composer/QuoteComment and Session/TimelineQuote stories, send states in UI/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/dev and 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/35
  • bun typecheck in app, gui-plugins, session-ui, ui and plugin: passed
  • bun test:
    • app (composer, session composer, runtime plugin): 592 pass
    • session-ui: 662 pass
    • ui line comment: 15 pass
    • gui-plugins browser/review/file: 1370 pass, 1 fail. The failure is src/browser/electron-crash.test.ts (Electron reports killed instead of crashed); it fails the same way on untouched origin/dev.
  • Component tests (browser-pane, line-comment, plugin-): 153 passed
  • bun run lint:changed origin/dev: 0 problems
  • script/sdk-docs.ts: 0 problems
  • Manual: in the web app, ⌘⏎ on a file comment sent it as its own message both while the session was idle and while it was working.

Added by the opencode bot (AI-generated).

Public API: adds ComposerDelivery, Composer.delivery() and Composer.send(commentID) to the GUI plugin SDK (backwards compatible for callers)

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

@opencodejr opencodejr 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.

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: () => {

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.

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.

@usrnk1 usrnk1 Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

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.

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 leave alternateActive off for non-compact editors when alternateSubmit.disabled.
  • ⌘-click on the footer button: action.clicked with modified still goes to submit(..., 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.

@usrnk1

usrnk1 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

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.

@opencodejr

opencodejr Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

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 alternateKeyReady check in packages/ui/src/data-display/line-comment/machine.ts, and the new test covers both the full-size and compact cases.

I ran bun test src/data-display/line-comment in packages/ui at efe6ae8 in a temporary worktree, which I've since removed: 16 pass, 0 fail.

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 repo/ is bun.lock, which bun install modified during the earlier review; I've left it in place.

@opencodejr opencodejr 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.

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.

@usrnk1
usrnk1 enabled auto-merge (squash) November 20, 2026 20:36
@usrnk1
usrnk1 merged commit 3bc82a1 into dev Nov 20, 2026
10 checks passed
@usrnk1
usrnk1 deleted the comment-steer branch November 20, 2026 20:42

@opencodejr opencodejr 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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant