Kanshō/Session branch switcher

Session branch switcher

Like git branch for a conversation. Lets the operator fork the current session, switch between alternative paths, and merge a branch back in when the experiment proves out.

Included in the single kansho full pack. Components are not offered as separate installs.

Inline switcher

Live demo — switching, forking, and merging update the state below

Selected branch: main

Demo action: none

In a session header

Header placement preview — switching and forking are wired here; merge is omitted in the tighter layout
SessionS-2014-08/

Component documentation

Session Branch Switcher

components/control-plane/session-branch-switcher.tsx

Purpose

Lets an operator inspect, select, fork, and merge session branches from a popover.

Appropriate use

Use in a session header when branch state is controlled and fork/merge operations are available.

Example

components/control-plane/session-branch-switcher.tsx has a representative live example in the "Inline switcher" section on /components/session-branch-switcher.

States

Branches may carry current, pending-count, base, freeform status, and neutral/accent/warning/success tone metadata; selection is controlled, and fork and merge actions are optional.

API and props

SessionBranchSwitcher accepts branches, value, onChange, onFork, onMerge, and className; SessionBranchOption supplies id, label, base, status, tone, pending, and current.

Dependencies

Direct imports are React, Radix Popover, cmdk, Lucide icons, and cn.

Accessibility

The trigger and branch choices are keyboard reachable through popover and command-list patterns; active/status text and merge labels are visible.

Limitations

It does not search or filter branches, create or merge them itself, confirm destructive conflicts, update branch state, or display asynchronous failures.

Source

Source: components/control-plane/session-branch-switcher.tsx.

Full pack

components/control-plane/session-branch-switcher.tsx is documented at /components/session-branch-switcher and installs only through the single Kansho full pack; no individual component install is offered.