{activeTab === 'agent' ? (
tabbedChat
) : activeTab === 'widgets' ? (
setWidgetMode(editing ? 'editing' : 'idle')}
widgets={widgets}
onCreateWidget={() => {
selectSession(null)
openChat('Create widget')
}}
/>
) : activeTab === 'scratchpad' ? (
) : null}
{builders
.filter(builder => builder.status !== 'ready')
.map(builder => (
{
if (handle) builderRefs.current.set(builder.id, handle)
else builderRefs.current.delete(builder.id)
}}
active={activeBuilder?.id === builder.id}
builder={builder}
chatDocked={mode === 'split'}
workspaceId={workspaceId}
onEditingStart={() => {
if (mode === 'fullscreen') setFloatingChatOpen(false)
}}
onContinueInChat={openChat}
onOpenChat={() => {
selectSession(builder.sessionId)
openChat()
}}
onDiscard={() => discardBuilder(builder)}
/>
))}
{/* Views are not part of the chain above: ViewManager keeps them
mounted across tab switches (and collapses to nothing while
another tab is on screen), which is what makes a switch back
instant. */}
void annotation.controls.finish()}
/>