Skip to content

Commit 512c298

Browse files
committed
Fix workflow welcome card selection
1 parent 297b388 commit 512c298

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

components/frontend/src/app/projects/[name]/sessions/[sessionName]/components/welcome-experience.tsx

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export function WelcomeExperience({
116116
}, [isSetupTypingComplete, hasRealMessages]);
117117

118118
const handleWorkflowSelect = (workflowId: string) => {
119+
console.log('[WelcomeExperience] Workflow selected:', workflowId);
119120
setSelectedWorkflowId(workflowId);
120121
onWorkflowSelect(workflowId);
121122
onUserInteraction();
@@ -139,6 +140,18 @@ export function WelcomeExperience({
139140
return 0; // Keep original order for items in the same category
140141
});
141142

143+
// Debug logging to trace workflow rendering
144+
useEffect(() => {
145+
if (enabledWorkflows.length > 0) {
146+
console.log('[WelcomeExperience] Enabled workflows:', enabledWorkflows.map((w, idx) => ({
147+
index: idx,
148+
id: w.id,
149+
name: w.name,
150+
description: w.description?.substring(0, 50) + '...'
151+
})));
152+
}
153+
}, [enabledWorkflows]);
154+
142155
// Filter workflows based on search query (for dropdown - includes all workflows)
143156
const filteredWorkflows = ootbWorkflows.filter((workflow) => {
144157
if (!workflowSearch) return true;
@@ -247,19 +260,12 @@ export function WelcomeExperience({
247260
}}
248261
>
249262
<CardContent className="p-3 space-y-1">
250-
<div className="flex items-center justify-between">
251-
<h3 className={cn(
252-
"text-sm font-semibold",
253-
selectedWorkflowId !== null && selectedWorkflowId !== workflow.id && "text-muted-foreground/60"
254-
)}>
255-
{workflow.name}
256-
</h3>
257-
{selectedWorkflowId === workflow.id && (
258-
<Badge variant="outline" className="bg-green-50 text-green-700 border-green-200">
259-
Selected
260-
</Badge>
261-
)}
262-
</div>
263+
<h3 className={cn(
264+
"text-sm font-semibold",
265+
selectedWorkflowId !== null && selectedWorkflowId !== workflow.id && "text-muted-foreground/60"
266+
)}>
267+
{workflow.name}
268+
</h3>
263269
<p className={cn(
264270
"text-xs line-clamp-2",
265271
selectedWorkflowId !== null && selectedWorkflowId !== workflow.id

components/frontend/src/app/projects/[name]/sessions/[sessionName]/hooks/use-workflow-management.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ export function useWorkflowManagement({
9797

9898
// Handle workflow selection change
9999
const handleWorkflowChange = useCallback((value: string, ootbWorkflows: WorkflowConfig[], onCustom: () => void) => {
100+
console.log('[WorkflowManagement] handleWorkflowChange called with:', value);
101+
console.log('[WorkflowManagement] Available workflows:', ootbWorkflows.map(w => ({ id: w.id, name: w.name })));
100102
setSelectedWorkflow(value);
101103

102104
if (value === "none") {
@@ -111,6 +113,7 @@ export function useWorkflowManagement({
111113

112114
// Find the selected workflow from OOTB workflows
113115
const workflow = ootbWorkflows.find(w => w.id === value);
116+
console.log('[WorkflowManagement] Found workflow:', workflow ? { id: workflow.id, name: workflow.name } : 'NOT FOUND');
114117
if (!workflow) {
115118
errorToast(`Workflow ${value} not found`);
116119
return null;

0 commit comments

Comments
 (0)