@synergenius/flow-weaver-pack-weaver 0.9.80 → 0.9.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Replaces bot-workspace.tsx as the primary center-dock workspace.
5
5
  * Composes: SwarmControls, BudgetBar, BotSlotCard, TaskPoolList,
6
- * TaskCreateForm, and TaskDetailView into a unified swarm dashboard.
6
+ * TaskEditor, and TaskDetailView into a unified swarm dashboard.
7
7
  *
8
8
  * Two-panel navigation:
9
9
  * - Default: full swarm dashboard (controls + budget + bots + task pool + create form)
@@ -29,8 +29,8 @@ import SwarmControls from './swarm-controls';
29
29
  import BudgetBar from './budget-bar';
30
30
  import BotSlotCard from './bot-slot-card';
31
31
  import TaskPoolList from './task-pool-list';
32
- import TaskCreateForm from './task-create-form';
33
32
  import TaskDetailView from './task-detail-view';
33
+ import TaskEditor from './task-editor';
34
34
  import ProfileCard from './profile-card';
35
35
  import ProfileEditor from './profile-editor';
36
36
  import DecisionLog from './decision-log';
@@ -121,6 +121,8 @@ function SwarmDashboard() {
121
121
  const [editingBotId, setEditingBotId] = useState<string | null>(null);
122
122
  const [profileEditorMode, setProfileEditorMode] = useState<'create' | 'edit' | null>(null);
123
123
  const [editingProfileId, setEditingProfileId] = useState<string | null>(null);
124
+ const [taskEditorMode, setTaskEditorMode] = useState<'create' | 'edit' | null>(null);
125
+ const [editingTaskId, setEditingTaskId] = useState<string | null>(null);
124
126
 
125
127
  // --- Data state ---
126
128
  const [swarmStatus, setSwarmStatus] = useState<SwarmStatus | null>(null);
@@ -283,9 +285,22 @@ function SwarmDashboard() {
283
285
  refreshAll();
284
286
  }, [refreshAll]);
285
287
 
286
- const handleTaskCreated = useCallback(() => {
287
- fetchTaskList();
288
- }, [fetchTaskList]);
288
+ // --- Render: TaskEditor from detail view ---
289
+
290
+ const handleEditFromDetail = useCallback((tid: string) => {
291
+ setEditingTaskId(tid);
292
+ setTaskEditorMode('edit');
293
+ }, []);
294
+
295
+ if (selectedTaskId && taskEditorMode === 'edit' && editingTaskId) {
296
+ return React.createElement(TaskEditor, {
297
+ mode: 'edit',
298
+ taskId: editingTaskId,
299
+ onSave: () => { setTaskEditorMode(null); setEditingTaskId(null); },
300
+ onCancel: () => { setTaskEditorMode(null); setEditingTaskId(null); },
301
+ onDelete: () => { setTaskEditorMode(null); setEditingTaskId(null); setSelectedTaskId(null); fetchTaskList(); },
302
+ });
303
+ }
289
304
 
290
305
  // --- Render: TaskDetailView (when task is selected) ---
291
306
 
@@ -293,6 +308,7 @@ function SwarmDashboard() {
293
308
  return React.createElement(TaskDetailView, {
294
309
  taskId: selectedTaskId,
295
310
  onBack: handleBack,
311
+ onEdit: handleEditFromDetail,
296
312
  });
297
313
  }
298
314
 
@@ -355,8 +371,19 @@ function SwarmDashboard() {
355
371
  style: { flex: 1, minHeight: 0, overflow: 'auto' },
356
372
  },
357
373
 
358
- // Tasks tab
359
- activeTab === 'tasks' && React.createElement(Flex, {
374
+ // Tasks tab — when TaskEditor is open, render it INSTEAD of the list
375
+ activeTab === 'tasks' && taskEditorMode != null && React.createElement(TaskEditor, {
376
+ mode: taskEditorMode,
377
+ taskId: editingTaskId ?? undefined,
378
+ onSave: () => { setTaskEditorMode(null); setEditingTaskId(null); fetchTaskList(); },
379
+ onCancel: () => { setTaskEditorMode(null); setEditingTaskId(null); },
380
+ onDelete: taskEditorMode === 'edit'
381
+ ? () => { setTaskEditorMode(null); setEditingTaskId(null); fetchTaskList(); }
382
+ : undefined,
383
+ }),
384
+
385
+ // Tasks tab — default list view
386
+ activeTab === 'tasks' && taskEditorMode == null && React.createElement(Flex, {
360
387
  variant: 'column-stretch-start-nowrap-0',
361
388
  style: { flex: 1, minHeight: 0 },
362
389
  },
@@ -418,14 +445,16 @@ function SwarmDashboard() {
418
445
  }, 'Clear All'),
419
446
  ),
420
447
 
421
- // Task create form (inside Tasks tab)
448
+ // New Task button (bottom bar)
422
449
  React.createElement(Flex, {
423
450
  variant: 'column-stretch-start-nowrap-0',
424
- style: { padding: '8px 16px', flexShrink: 0, borderTop: '1px solid var(--color-border-default)' },
451
+ style: { flexShrink: 0, borderTop: '1px solid var(--color-border-default)', padding: '8px 16px' },
425
452
  },
426
- React.createElement(TaskCreateForm, {
427
- onTaskCreated: handleTaskCreated,
428
- }),
453
+ React.createElement(Button, {
454
+ size: 'xs', variant: 'clear', color: 'primary',
455
+ leftIcon: 'add',
456
+ onClick: () => setTaskEditorMode('create'),
457
+ }, 'New Task'),
429
458
  ),
430
459
  ),
431
460
 
@@ -81,6 +81,7 @@ interface Subtask {
81
81
  interface TaskDetailViewProps {
82
82
  taskId: string;
83
83
  onBack: () => void;
84
+ onEdit?: (taskId: string) => void;
84
85
  }
85
86
 
86
87
  // ---------------------------------------------------------------------------
@@ -201,7 +202,7 @@ function SubtaskRowItem({ sub, onBack }: { sub: Subtask; onBack: () => void }) {
201
202
  // Component
202
203
  // ---------------------------------------------------------------------------
203
204
 
204
- function TaskDetailView({ taskId, onBack }: TaskDetailViewProps) {
205
+ function TaskDetailView({ taskId, onBack, onEdit }: TaskDetailViewProps) {
205
206
  const ctx = usePackWorkspace();
206
207
  const { callTool } = ctx;
207
208
  const packId = ctx.packId;
@@ -500,21 +501,28 @@ function TaskDetailView({ taskId, onBack }: TaskDetailViewProps) {
500
501
  variant: 'column-stretch-start-nowrap-6',
501
502
  style: { ...headerStyle, padding: '12px 16px', borderBottom: '1px solid var(--color-border-default)' },
502
503
  },
503
- // Top row: back + title + status
504
- React.createElement(Flex, { variant: 'row-center-start-nowrap-8' },
505
- React.createElement(IconButton, {
506
- icon: 'back', size: 'xs', variant: 'clear',
507
- onClick: onBack,
508
- }),
509
- React.createElement(StatusIcon, {
510
- status: statusToIcon[task.status] || 'pending',
511
- size: 'sm',
504
+ // Top row: back + title + status + edit
505
+ React.createElement(Flex, { variant: 'row-center-space-between-nowrap-8' },
506
+ React.createElement(Flex, { variant: 'row-center-start-nowrap-8', style: { flex: 1, minWidth: 0 } },
507
+ React.createElement(IconButton, {
508
+ icon: 'back', size: 'xs', variant: 'clear',
509
+ onClick: onBack,
510
+ }),
511
+ React.createElement(StatusIcon, {
512
+ status: statusToIcon[task.status] || 'pending',
513
+ size: 'sm',
514
+ }),
515
+ React.createElement(Typography, {
516
+ variant: 'caption-thick',
517
+ color: 'color-text-high',
518
+ style: { flex: 1, minWidth: 0, wordBreak: 'break-word' },
519
+ }, task.title || 'Untitled Task'),
520
+ ),
521
+ onEdit && React.createElement(IconButton, {
522
+ icon: 'edit', size: 'xs', variant: 'clear',
523
+ onClick: () => onEdit(taskId),
524
+ title: 'Edit task',
512
525
  }),
513
- React.createElement(Typography, {
514
- variant: 'caption-thick',
515
- color: 'color-text-high',
516
- style: { flex: 1, minWidth: 0, wordBreak: 'break-word' },
517
- }, task.title || 'Untitled Task'),
518
526
  ),
519
527
 
520
528
  // Meta row: status tag, assigned profile, priority, attempts