feat: enable all workflow types for scratchpad sessions

Scratchpad sessions were hardcoded to only use single-mode workflows.
The handleCreateScratchpad handler filtered for orchestrationMode === 'single'
and auto-selected the first match without any user choice.

Now clicking 'New Scratchpad' opens the WorkflowPicker (same as regular
sessions), letting users choose from all available workflows including
sequential, concurrent, handoff, and group-chat. When only one workflow
exists, it still auto-creates for a seamless single-click experience.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-04-07 08:00:40 +02:00
co-authored by Copilot
parent 59170a794d
commit bf72315735
+5 -11
View File
@@ -557,18 +557,12 @@ export default function App() {
const handleCreateScratchpad = useCallback(() => {
if (!workspace) return;
const singleWorkflows = workspace.workflows
.filter((w) => (w.settings.orchestrationMode ?? 'single') === 'single')
.sort((a, b) => {
if (a.isFavorite && !b.isFavorite) return -1;
if (!a.isFavorite && b.isFavorite) return 1;
return 0;
});
const defaultWorkflow = singleWorkflows[0];
if (defaultWorkflow) {
void api.createSession({ projectId: SCRATCHPAD_PROJECT_ID, workflowId: defaultWorkflow.id });
if (workspace.workflows.length <= 1) {
const wf = workspace.workflows[0];
if (wf) void api.createSession({ projectId: SCRATCHPAD_PROJECT_ID, workflowId: wf.id });
return;
}
setWorkflowPickerProjectId(SCRATCHPAD_PROJECT_ID);
}, [api, workspace]);
/** Opens the workflow picker, or creates immediately if ≤1 workflow. */