Skip to content

fix(ui): move the Plan and Swarm mode tokens out of the composer context drawer #1897

Closed

Description

@Astro-Han

What happens

With Plan Mode on, a blue Plan × token renders inside the composer's context drawer — the collapsible panel above the input that also holds pending quotes, attachments and skill tokens.

Where

packages/ui/src/composer.tsx:795-830. planModeActive and swarmModeActive each render a Token inside <ChatComposerDrawer>, alongside props.pendingQuotes, props.pendingAttachments and skillDraft.skills.

Why it is wrong

The drawer's contract is context staged for the next send: everything else in it is consumed and disappears when the message goes out, and its count badge (drawerTokenCount) tells the user how many such items are pending. Plan and Swarm are session-scoped modes that survive the send. Putting them in the drawer inflates that count with things the send does not consume, and gives a persistent mode the visual weight of a transient attachment.

Desired outcome

Plan and Swarm read as mode state on the composer's footer toolbar, next to the permission-mode and model controls, and stop contributing to drawerTokenCount. Removal stays available (the onRemove path today is the only way to leave the mode from the composer), and the disabled reasons (planModeDisabledReason, streaming/running/waiting) keep surfacing.

Verification

Composer story variants for plan-on, swarm-on, both-on, and mode-on-with-pending-attachments; a contract test that the drawer count excludes modes.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions