Repository navigation
Description
Summary
From the code-review (git-diff) panel you can only send a selection to the main composer; you cannot pull it into a side chat to ask a focused follow-up or fix without cluttering the main thread. This proposes a "Reply in side chat" action on git-diff (and file-preview) selections that auto-creates a side chat seeded with the selected code — reusing the side-chat plugin flow the timeline already uses for messages, so no new plugin-SDK surface is needed. Opening this first per CONTRIBUTING, since it is a UI/feature change.
Context
The side-chat plugin already lets you fork a hidden side thread from a message ("Reply in side chat"): the selected message text becomes the fork's quoted context, and the side chat opens in a panel beside the thread (plugins/side-chat). Core already drives this plugin directly — ThreadDetailView opens the side-chat panel for the "open-plugin-side-chat" title action (apps/app/src/views/thread-detail/ThreadDetailView.tsx ~L2018-2025) and can call plugin RPCs via callPluginRpc (apps/app/src/lib/plugin-sdk-hooks.ts:137).
The code-review panel has no equivalent. Its selection menu offers only "Add to chat", which routes through onSelectionAddToChat to the main composer (ThreadDetailView.tsx ~L1122-1131, appendQuoteAndAttachmentsToDraft). So a reviewer who wants to interrogate or fix one hunk in isolation has to dump it into the main thread.
Proposal
Add a second selection action, "Reply in side chat", available alongside "Add to chat" in the shared selection menu (apps/app/src/components/thread/timeline/TimelineSelectionMenu.tsx), surfaced in the git-diff panel and file previews via SecondaryPanelSelectionActions.
Behavior (chosen scope: always available + auto-create): clicking it always starts a fresh side chat seeded with the selected text and opens its panel — no requirement that a side chat already be open.
Wiring (mirrors the existing onSelectionAddToChat path, no new plugin-SDK slot):
- New optional prop
onSelectionReplyInSideChat?(text)threaded down the same chain asonSelectionAddToChat(ThreadDetailView → ThreadSecondaryPanel → GitDiffTabContent → DiffFilesPanel → DiffFileCard / selection menu). - Terminal handler in
ThreadDetailView: call the side-chat plugin RPCcreateSideChat({ sourceThreadId, anchorText: selectedText })(omittingsourceSeqEndforks from current thread state — appropriate for a code selection with no message anchor;plugins/side-chat/server.ts:69-135), then open the side-chat panel with the returned thread id using the existinghandleOpenTimelinePluginPanelpath. - Likely enrich
anchorTextwith the file path and a fenced code block so the quote reads as code in the side chat (TBD during implementation).
Design questions for maintainers
- Is piggybacking on the
side-chatplugin id + itscreateSideChatRPC from core acceptable here, or should this go through a more generic "selection action" plugin surface? Core already couples to the side-chat plugin for panel opening, so this extends an existing pattern rather than introducing a new one. - Should the selected diff text be wrapped as a fenced code block with its file path, or passed verbatim like message selections?
Out of scope / ruled out
- A new plugin-SDK selection-action slot for the secondary panel: heavier, and unnecessary given core already integrates with the side-chat plugin.
- "Only when a side chat is open" and "follow the focused chat" variants were considered; the chosen behavior is always-available with auto-create.
Prototype branch to follow once the approach is signed off. Environment: bb 0.46.1 / current main.
Activity
bb-slop-cop commentedon Oct 23, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied classification:
ui,side-chat.All values were missing; no existing classifications were replaced. Final Type verified as Feature. Bug reproduction and an automated fix PR are skipped because this is a feature request requiring product/design review.
kolsha commentedon Oct 23, 2026
Prototype pushed: https://github.com/kolsha/bb/tree/feat/git-diff-reply-in-side-chat
Implements the "always + auto-create" behavior described above:
onSelectionReplyInSideChatprop threaded alongside the existingonSelectionAddToChatdown the git-diff and file-preview chains; a "Reply in side chat" action added to the sharedTimelineSelectionMenu(iconSideChat), gated on the handler being present.ThreadDetailViewcalls the side-chat plugin'screateSideChatRPC (seeded with the selection, forking from current thread state) and opens the side-chat panel via the existing plugin-panel path.18 files, +214/-2. typecheck + oxlint clean; 78 tests pass in the affected suites, including two new
TimelineSelectionMenutests covering the action.Not yet done: live run-through in the app, and the per-line diff gutter "add to chat" button still has no side-chat sibling (the text-selection menu does). Both design questions above are still open — happy to adjust (e.g. drop the core→plugin-id coupling for a generic selection-action surface) before this becomes a PR.
kolsha commentedon Oct 30, 2026
Update: reworked prototype (force-pushed) — now two explicit targets
Refined the "always + auto-create" behavior into two explicit selection-menu actions, since always creating a new side chat clutters the panel when you just want to keep iterating in the one you have open:
createSideChatRPC) and opens it.Key mechanism for the "open" target (no plugin or plugin-SDK change needed): core resolves the last-active open side-chat panel from the secondary-panel tab state, then appends the quote to that thread's composer draft via the shared prompt-draft store (
appendToThreadComposerDraft). The mounted side chat subscribes to that store and picks up the appended text live. "Last-active" is tracked because at selection time the active tab is the diff, not a side chat; target resolution (last-active → currently-active → most-recent) is a pure module with unit tests guarding the last-vs-first regression.Clean prototype (force-pushed, old "always new" history dropped): https://github.com/kolsha/bb/tree/feat/git-diff-reply-in-side-chat — 21 files, +659/-3. typecheck + oxlint clean; 23 tests pass (TimelineSelectionMenu actions + openSideChatTarget resolution). Reviewed via an adversarial review loop (fully approved). Verified working on a local build against a copy of real data.
Still main-timeline selection menu is untouched (it already offers the plugin's own message action). Design question from the original post stands: OK to drive the
side-chatplugin id + its RPC from core, or prefer a generic selection-action surface?