Skip to content

Plugin SDK: let ThreadChat collapse its history while keeping the same composer #5251

Description

@ComicBit

The workflow

I'm building a plugin dashboard (full-page plugin route) around one persistent agent conversation. The design puts the conversation's composer in the dashboard header. When a reply arrives, or when I ask, the history expands in place above the composer, and it collapses again so the rest of the dashboard stays visible. It's one existing thread with one composer, never navigating away.

What happens today

ThreadChat (@get-bb/plugin-sdk 0.6.15) has three fixed variants: "full" and "compact" (timeline plus composer) and "timeline" (no composer). There is no composer-only presentation, and switching variant or remounting loses the draft, attachments, focus, the in-progress stream view and queue/send state. So the only options are:

  • render the full chat permanently (it buries the dashboard);
  • link out to the thread page (leaves the dashboard);
  • build a second composer in the plugin (duplicates BB's send/queue/permission engine and drifts from it);
  • crop BB's DOM (private and fragile).

What you would expect

A controlled prop that hides past messages without unmounting the chat:

<ThreadChat
  threadId={id}
  variant="full"
  experimental_history="collapsed" // "expanded" (default) | "collapsed"
  experimental_onHistoryRequest={() => setHistory("expanded")}
/>

While collapsed:

  • the composer is the same mounted instance: draft, attachments, caret/focus, pickers and queue state survive collapse and expand;
  • anything waiting on the user stays visible above the composer: pending permission requests and interactions, queued-input controls, running/Stop state and runtime errors;
  • an in-flight reply keeps streaming, and expanding shows it at its current position;
  • toggling is instant and doesn't refetch the thread.

Nice to have: an experimental_onActivity callback (assistant message started or finished), so the host page can expand on reply without polling.

Context and alternatives

It's a prop rather than a new variant because the collapse has to be a transition of one instance, and a variant change implies a different presentation. The prop is additive: "expanded" is today's behaviour, and variant: "timeline" ignores it. It would ship with the experimental_ prefix and an entry in docs/api_to_audit.md.

Related but different: #2967 (embedded ThreadChat feature parity) and #4814 (forkable thread view). A forkable thread view would also solve this, but it's much larger.

Checks

  • I searched open and closed issues for the same request.
  • If an agent wrote this, the body ends with > AGENT GENERATED.

AGENT GENERATED

Activity

  1. added
    plugins
    ui
    on Oct 9, 2026
  2. bb-slop-cop commented on Oct 9, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied missing classification: Type: Feature · Priority: Medium · Effort: Medium. Added labels: plugins, ui. No existing classifications were replaced.

    The current SDK offers timeline-plus-composer and timeline-only presentations; independently collapsing history while retaining the composer adds a supported interaction. Priority reflects a meaningful but limited plugin-dashboard use case with workarounds. Effort reflects coordinated SDK, embedded-chat UI, documentation, and state-preservation verification changes within the existing chat subsystem.

    Final Type verified as Feature. Reproduction report and automatic fix skipped; no PR opened because this requests new API behavior rather than a verified bug.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginsui

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions