@fish-under-sea/dsh-client-ui-task-board-fish 1.0.2 → 2.0.0

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.
Files changed (125) hide show
  1. package/NOTICE +1 -1
  2. package/README.en.md +6 -4
  3. package/README.md +6 -4
  4. package/README.zh.md +6 -4
  5. package/icon.png +0 -0
  6. package/lib/client.js +4428 -1508
  7. package/lib/client.js.map +1 -1
  8. package/lib/index.js +2670 -496
  9. package/lib/types/client/CardDefaultPresetField.d.ts +35 -0
  10. package/lib/types/client/PluginSettingsCard.d.ts +130 -19
  11. package/lib/types/client/RangeBubble.d.ts +46 -0
  12. package/lib/types/client/SegmentGroup.d.ts +28 -0
  13. package/lib/types/client/TaskBoardSettingsCard.d.ts +63 -0
  14. package/lib/types/client/board/AttachmentField.d.ts +70 -0
  15. package/lib/types/client/board/ExecutionLog.d.ts +24 -0
  16. package/lib/types/client/board/ReasoningEffortField.d.ts +25 -0
  17. package/lib/types/client/board/TaskForm.d.ts +4 -0
  18. package/lib/types/client/board/VerificationReport.d.ts +2 -15
  19. package/lib/types/client/board/model-options.d.ts +87 -0
  20. package/lib/types/client/board/preset-label.d.ts +21 -0
  21. package/lib/types/client/board/preset-roster.d.ts +45 -0
  22. package/lib/types/client/board/source-group.d.ts +27 -0
  23. package/lib/types/client/body-mutations.d.ts +45 -0
  24. package/lib/types/client/host-api.d.ts +25 -0
  25. package/lib/types/client/locales.d.ts +87 -9
  26. package/lib/types/client/pending-verify.d.ts +47 -0
  27. package/lib/types/client/plugin-card-seat.d.ts +3 -1
  28. package/lib/types/client/service.d.ts +4 -1
  29. package/lib/types/client/settings-form.d.ts +73 -51
  30. package/lib/types/core/attachment.d.ts +132 -0
  31. package/lib/types/core/card-defaults.d.ts +78 -0
  32. package/lib/types/core/controller.d.ts +57 -8
  33. package/lib/types/core/execution-summary.d.ts +52 -0
  34. package/lib/types/core/extension.d.ts +116 -0
  35. package/lib/types/core/launch-width.d.ts +31 -0
  36. package/lib/types/core/reasoning-effort.d.ts +57 -0
  37. package/lib/types/core/session-reuse.d.ts +7 -1
  38. package/lib/types/core/spend-budget.d.ts +28 -0
  39. package/lib/types/core/subtask.d.ts +100 -37
  40. package/lib/types/core/tasks.d.ts +94 -10
  41. package/lib/types/core/use-cases/task-create.d.ts +10 -5
  42. package/lib/types/core/use-cases/task-tag.d.ts +36 -0
  43. package/lib/types/core/use-cases/task-update.d.ts +22 -1
  44. package/lib/types/core/wire-projection.d.ts +35 -0
  45. package/lib/types/core/workspace-target.d.ts +23 -3
  46. package/lib/types/host/attachments.d.ts +250 -0
  47. package/lib/types/host/extension-registry.d.ts +40 -0
  48. package/lib/types/host/launch-admission.d.ts +71 -0
  49. package/lib/types/host-ledger.d.ts +114 -47
  50. package/lib/types/host-routes.d.ts +63 -0
  51. package/lib/types/host-runner.d.ts +164 -18
  52. package/lib/types/host-service.d.ts +182 -46
  53. package/lib/types/host-spend.d.ts +52 -0
  54. package/lib/types/index.d.ts +173 -54
  55. package/lib/types/loopback.d.ts +41 -1
  56. package/lib/types/protocol.d.ts +52 -11
  57. package/lib/types/tool-surface.d.ts +1 -0
  58. package/locale/en.json +6 -0
  59. package/locale/zh.json +6 -0
  60. package/package.json +36 -29
  61. package/src/client/CardDefaultPresetField.tsx +101 -0
  62. package/src/client/PluginSettingsCard.tsx +385 -111
  63. package/src/client/RangeBubble.tsx +164 -0
  64. package/src/client/SegmentGroup.tsx +93 -0
  65. package/src/client/TaskBoardSettingsCard.tsx +332 -37
  66. package/src/client/board/AttachmentField.tsx +383 -0
  67. package/src/client/board/EditTaskModal.tsx +63 -0
  68. package/src/client/board/ExecutionLog.tsx +154 -0
  69. package/src/client/board/LinkSubtaskModal.tsx +1 -1
  70. package/src/client/board/NewTaskModal.tsx +154 -45
  71. package/src/client/board/ReasoningEffortField.tsx +50 -0
  72. package/src/client/board/TagManagerModal.tsx +151 -2
  73. package/src/client/board/TaskBoard.tsx +47 -10
  74. package/src/client/board/TaskCard.tsx +45 -23
  75. package/src/client/board/TaskDetail.tsx +468 -258
  76. package/src/client/board/TaskForm.tsx +19 -4
  77. package/src/client/board/VerificationReport.tsx +143 -104
  78. package/src/client/board/model-options.ts +208 -0
  79. package/src/client/board/preset-label.ts +32 -0
  80. package/src/client/board/preset-roster.ts +58 -0
  81. package/src/client/board/source-group.ts +94 -0
  82. package/src/client/board/task-markdown.module.css +11 -8
  83. package/src/client/board-settings.module.css +35 -7
  84. package/src/client/board.module.css +1044 -105
  85. package/src/client/body-mutations.ts +133 -0
  86. package/src/client/host-api.ts +70 -0
  87. package/src/client/index.ts +109 -95
  88. package/src/client/locales.ts +205 -48
  89. package/src/client/pending-verify.ts +90 -0
  90. package/src/client/plugin-card-seat.ts +8 -2
  91. package/src/client/service.ts +24 -0
  92. package/src/client/settings-card.module.css +466 -89
  93. package/src/client/settings-entry-form.ts +0 -1
  94. package/src/client/settings-form.ts +102 -60
  95. package/src/core/attachment.ts +287 -0
  96. package/src/core/card-defaults.ts +132 -0
  97. package/src/core/controller.ts +90 -11
  98. package/src/core/execution-summary.ts +96 -0
  99. package/src/core/extension.ts +120 -0
  100. package/src/core/launch-width.ts +38 -0
  101. package/src/core/reasoning-effort.ts +92 -0
  102. package/src/core/session-reuse.ts +7 -1
  103. package/src/core/spend-budget.ts +35 -0
  104. package/src/core/store.ts +19 -1
  105. package/src/core/subtask.ts +144 -68
  106. package/src/core/tasks.ts +117 -10
  107. package/src/core/use-cases/task-create.ts +27 -16
  108. package/src/core/use-cases/task-tag.ts +56 -0
  109. package/src/core/use-cases/task-update.ts +33 -5
  110. package/src/core/wire-projection.ts +81 -0
  111. package/src/core/workspace-target.ts +27 -3
  112. package/src/host/agent-tools.ts +33 -21
  113. package/src/host/attachments.ts +650 -0
  114. package/src/host/extension-registry.ts +150 -5
  115. package/src/host/launch-admission.ts +139 -0
  116. package/src/host-ledger.ts +248 -117
  117. package/src/host-routes.ts +233 -15
  118. package/src/host-runner.ts +395 -61
  119. package/src/host-service.ts +512 -139
  120. package/src/host-spend.ts +105 -0
  121. package/src/index.ts +312 -92
  122. package/src/loopback.ts +57 -1
  123. package/src/protocol.ts +83 -18
  124. package/src/tool-surface.ts +1 -0
  125. package/icon.svg +0 -3
@@ -4,92 +4,202 @@
4
4
  * delete (with confirmation), manual status moves, and a jump to the
5
5
  * execution's session transcript.
6
6
  */
7
- import { useCallback, useEffect, useState } from 'react'
7
+ import { useCallback, useEffect, useId, useRef, useState, type ReactNode } from 'react'
8
8
  import type { BoardController, ControllerSnapshot } from '../../core/controller.ts'
9
9
  import type { TaskBoardExtensionActionRequest, TaskBoardExtensionDispatch } from '../../core/extension.ts'
10
10
  import { useTaskBoardSeats } from '../seats.tsx'
11
11
  import { isValidCron } from '../../core/schedule.ts'
12
- import { MANUAL_STATUSES, TASK_PERMISSIONS, canMoveTask, hasOpenExecution, tagTone, type ExecutionRecord, type ScheduleMode, type TaskPermission, type TaskRecord } from '../../core/tasks.ts'
12
+ import { MANUAL_STATUSES, TASK_PERMISSIONS, canMoveTask, hasOpenExecution, tagTone, type ScheduleMode, type TaskPermission, type TaskRecord } from '../../core/tasks.ts'
13
13
  import { canEditTaskContent } from '../../core/use-cases/task-update.ts'
14
14
  import { requiresPermissionConfirmation } from '../../core/handover.ts'
15
- import { DEFAULT_SUBTASK_DEPTH, directSubtasks, taskDepth } from '../../core/subtask.ts'
15
+ import { DEFAULT_SUBTASK_DEPTH, descendantTasks, directSubtasks, joinsCascadeRun, taskDepth } from '../../core/subtask.ts'
16
16
  import { t, type TaskBoardKey } from '../locales.ts'
17
+ import { attachmentImageUrl } from '../host-api.ts'
18
+ import { formatAttachmentBytes } from './AttachmentField.tsx'
17
19
  import { SCHEDULE_PRESETS } from '../schedule-presets.ts'
18
20
  import { budgetLabel, defaultZonedInputValue, endedLabel, nextRunLabel, parseZonedInput, runCapOption, skippedLabel, zonedInputValue, zoneChoices } from '../schedule-zone.ts'
19
21
  import css from '../board.module.css'
20
22
  import { ConfirmDialog } from './ConfirmDialog.tsx'
21
23
  import { EditTaskModal, EditTagsModal } from './EditTaskModal.tsx'
22
- import { IconClose, IconPlus, IconSession } from './icons.tsx'
24
+ import { IconClose, IconPlus } from './icons.tsx'
23
25
  import { LinkSubtaskModal } from './LinkSubtaskModal.tsx'
24
26
  import { NewTaskModal } from './NewTaskModal.tsx'
25
27
  import { useDialog, usePresence, type OverlayPhase } from './overlay.tsx'
26
28
  import { inheritPresetLabel, presetLabel } from './preset-label.ts'
29
+ import { ReasoningEffortField } from './ReasoningEffortField.tsx'
30
+ import { modelDisplayLabel, reconcileReasoningEffort } from './model-options.ts'
27
31
  import { formatHostTimestamp, formatTime } from './TaskCard.tsx'
28
32
  import { STATUS_KEY } from './status-key.ts'
29
- import { VerificationReport } from './VerificationReport.tsx'
30
33
  import { ClampedMarkdown } from './ClampedMarkdown.tsx'
34
+ import { EXECUTION_RESULT_KEY, ExecutionLog } from './ExecutionLog.tsx'
31
35
 
32
- /** Execution outcome → locale key. */
33
- const RESULT_KEY: Record<NonNullable<ExecutionRecord['result']>, TaskBoardKey> = {
34
- succeeded: 'detail.result.succeeded',
35
- failed: 'detail.result.failed',
36
- cancelled: 'detail.result.cancelled',
36
+ /** One choice of a compact action menu. */
37
+ interface ActionMenuItem {
38
+ /** Stable identity of the choice (the status id, or an action name). */
39
+ key: string
40
+ label: string
41
+ disabled: boolean
42
+ title?: string
43
+ onSelect: () => void
37
44
  }
38
45
 
39
- /** One execution-history row. */
40
- function ExecutionRow({ execution, timeZone, onOpen }: { execution: ExecutionRecord; timeZone?: string; onOpen: (sessionId: string) => void }) {
41
- const result = execution.result
42
- // An external record is one the Host never observed running: no session, no
43
- // spinner, and a named outside agent instead of the initiating session. The
44
- // data attribute keeps the distinction machine-readable too.
45
- const external = execution.external === true
46
+ /**
47
+ * A compact action menu: one trigger on the panel's control track, the choices
48
+ * only while it is open, Escape or an outside press to close, and focus back on
49
+ * the trigger afterwards. The panel's dialog owns Escape on `document` in the
50
+ * capture phase, so the menu answers from the window leg of the same event —
51
+ * otherwise the press would close the whole detail view under the menu.
52
+ */
53
+ function ActionMenu({ label, items, disabled }: {
54
+ label: string
55
+ items: readonly ActionMenuItem[]
56
+ disabled: boolean
57
+ }) {
58
+ const [open, setOpen] = useState(false)
59
+ const rootRef = useRef<HTMLDivElement | null>(null)
60
+ const triggerRef = useRef<HTMLButtonElement | null>(null)
61
+ const menuRef = useRef<HTMLDivElement | null>(null)
62
+ const menuId = useId()
63
+
64
+ /** Close the menu; a keyboard user gets the trigger back instead of the document body. */
65
+ const close = useCallback((restoreFocus: boolean): void => {
66
+ setOpen(false)
67
+ if (restoreFocus) triggerRef.current?.focus()
68
+ }, [])
69
+
70
+ useEffect(() => {
71
+ if (!open) return
72
+ const onKeyDown = (event: KeyboardEvent): void => {
73
+ if (event.key !== 'Escape') return
74
+ event.stopPropagation()
75
+ setOpen(false)
76
+ triggerRef.current?.focus()
77
+ }
78
+ const onPointerDown = (event: Event): void => {
79
+ const root = rootRef.current
80
+ if (root !== null && event.target instanceof Node && root.contains(event.target)) return
81
+ setOpen(false)
82
+ }
83
+ window.addEventListener('keydown', onKeyDown, true)
84
+ document.addEventListener('mousedown', onPointerDown, true)
85
+ return () => {
86
+ window.removeEventListener('keydown', onKeyDown, true)
87
+ document.removeEventListener('mousedown', onPointerDown, true)
88
+ }
89
+ }, [open])
90
+
91
+ // Focus lands on the first usable choice, so the menu is usable without a
92
+ // mouse and Tab never has to walk the panel behind it.
93
+ useEffect(() => {
94
+ if (!open) return
95
+ menuRef.current?.querySelector<HTMLElement>('[role="menuitem"]:not([disabled])')?.focus()
96
+ }, [open])
97
+
46
98
  return (
47
- <li className={css.executionRow} data-result={result} data-external={external ? 'true' : undefined}>
48
- <span className={css.executionBadge} data-result={result}>
49
- {result === undefined ? t('detail.result.running') : t(RESULT_KEY[result])}
50
- </span>
51
- <span className={css.executionTimes}>
52
- {t('detail.executionStarted')} {formatTime(execution.startedAt, timeZone)}
53
- {execution.endedAt !== undefined && ` · ${t('detail.executionEnded')} ${formatTime(execution.endedAt, timeZone)}`}
54
- </span>
55
- {external && execution.initiatedBy !== undefined && (
56
- <span className={css.executionTimes} title={execution.initiatedBy}>
57
- {t('detail.execution.external', { agent: execution.initiatedBy })}
58
- </span>
59
- )}
60
- {!external && execution.initiatedBy !== undefined && (
61
- <span className={css.executionTimes} title={execution.initiatedBy}>
62
- {t('detail.execution.initiator', { session: execution.initiatedBy })}
63
- </span>
64
- )}
65
- {execution.verification !== undefined && <VerificationReport verification={execution.verification} />}
66
- {execution.sessionId !== undefined && (
67
- <button
68
- type="button"
69
- className={css.linkButton}
70
- onClick={() => { onOpen(execution.sessionId as string) }}
71
- title={execution.sessionId}
72
- >
73
- {t('detail.viewSession')}
74
- <IconSession size={13} />
75
- </button>
99
+ <div className={css.menuRoot} ref={rootRef}>
100
+ <button
101
+ ref={triggerRef}
102
+ type="button"
103
+ className={css.ghostButton}
104
+ aria-haspopup="menu"
105
+ aria-expanded={open}
106
+ aria-controls={menuId}
107
+ disabled={disabled}
108
+ onClick={() => { setOpen(!open) }}
109
+ >
110
+ {label}
111
+ <span className={css.menuChevron} data-open={open} aria-hidden="true" />
112
+ </button>
113
+ {open && (
114
+ <div ref={menuRef} id={menuId} className={css.menuPanel} role="menu" aria-label={label}>
115
+ {items.map(item => (
116
+ <button
117
+ key={item.key}
118
+ type="button"
119
+ role="menuitem"
120
+ className={css.menuItem}
121
+ disabled={item.disabled}
122
+ title={item.title}
123
+ onClick={() => { close(true); item.onSelect() }}
124
+ >
125
+ {item.label}
126
+ </button>
127
+ ))}
128
+ </div>
76
129
  )}
77
- {execution.error !== undefined && execution.error !== '' && (
78
- <span className={css.executionError}>{execution.error}</span>
130
+ </div>
131
+ )
132
+ }
133
+
134
+ /**
135
+ * One folded region of the detail panel.
136
+ *
137
+ * It reuses the task form's region contract verbatim — `.formSection`, the
138
+ * chevron drawn from borders, the one-line summary, `data-open`, the
139
+ * `data-dsh-part="form-section"` part the semantic-attribute contract already
140
+ * owns — and adds the two things a panel fold needs that a dialog region does
141
+ * not: an `aria-controls` target and a paired exit leg (`usePresence` keeps the
142
+ * body mounted until the close has run). The panel cannot reach into the form
143
+ * module to extend its copy, so the shape is mirrored here rather than forked
144
+ * into a third disclosure style.
145
+ */
146
+ function FoldSection({ title, summary, hint, children }: {
147
+ title: string
148
+ /** One-line echo of what the folded region holds, shown while it is closed. */
149
+ summary: string
150
+ /**
151
+ * The whole line, tooltip only. The row drops whatever does not fit, so what
152
+ * the summary had to give up — a rule's cron expression, a one-shot's instant
153
+ * — stays one hover away instead of being lost with the ellipsis.
154
+ */
155
+ hint?: string
156
+ children: ReactNode
157
+ }) {
158
+ const [open, setOpen] = useState(false)
159
+ const presence = usePresence(open)
160
+ const panelId = useId()
161
+ const headerRef = useRef<HTMLButtonElement | null>(null)
162
+ const fullLine = hint ?? summary
163
+ // Collapsing a region whose body holds the focus hands the focus back to the
164
+ // region row instead of dropping it on the document body.
165
+ const toggle = (): void => {
166
+ if (open) {
167
+ const body = panelId === '' ? null : document.getElementById(panelId)
168
+ if (body !== null && body.contains(document.activeElement)) headerRef.current?.focus()
169
+ }
170
+ setOpen(!open)
171
+ }
172
+ return (
173
+ <section className={css.formSection} data-dsh-part="form-section" data-open={open ? 'true' : undefined}>
174
+ <button
175
+ ref={headerRef}
176
+ type="button"
177
+ className={css.formSectionHeader}
178
+ aria-expanded={open}
179
+ aria-controls={panelId}
180
+ title={fullLine === '' ? undefined : fullLine}
181
+ onClick={toggle}
182
+ >
183
+ <span className={css.formSectionChevron} aria-hidden="true" />
184
+ <span className={css.formSectionTitle}>{title}</span>
185
+ {!open && summary !== '' && <span className={css.formSectionSummary}>{summary}</span>}
186
+ </button>
187
+ {presence.mounted && (
188
+ <div className={css.formSectionBody} id={panelId} data-state={presence.phase}>
189
+ {children}
190
+ </div>
79
191
  )}
80
- </li>
192
+ </section>
81
193
  )
82
194
  }
83
195
 
84
196
  /** The execution-target editor: workspace / mode / permission pickers. */
85
- function ExecutionSettingsSection({ controller, task, pending, executionOptions, teamRunAvailable, goalRunEnabled }: {
197
+ function ExecutionSettingsSection({ controller, task, pending, executionOptions, goalRunEnabled }: {
86
198
  controller: BoardController
87
199
  task: TaskRecord
88
200
  pending: boolean
89
201
  /** Picker option sets, owned by the detail overlay's snapshot. */
90
202
  executionOptions: ControllerSnapshot['executionOptions']
91
- /** Whether this deployment serves the Agent Teams service. */
92
- teamRunAvailable: boolean
93
203
  /**
94
204
  * Live GLOBAL native-/goal switch. It only decides whether the card's own
95
205
  * preference takes effect: the option stays operable while it is off, the
@@ -98,20 +208,28 @@ function ExecutionSettingsSection({ controller, task, pending, executionOptions,
98
208
  goalRunEnabled: boolean
99
209
  }) {
100
210
  const options = executionOptions
211
+ const models = options.models ?? []
101
212
  const workspaceId = task.workspaceId ?? ''
102
213
  const mode = task.mode ?? ''
103
214
  const permission = task.permission ?? ''
104
215
  const model = task.model ?? ''
216
+ const reasoningEffort = task.reasoningEffort ?? ''
105
217
  // A pinned target may disappear from the runtime (workspace deleted,
106
218
  // preset removed); keep it selectable as a stale row instead of silently
107
219
  // dropping it, so the user sees exactly what the task will ask for.
108
220
  const workspaceKnown = workspaceId === '' || options.workspaces.some(item => item.workspaceId === workspaceId)
109
221
  const modeKnown = mode === '' || options.presets.some(item => item.id === mode)
110
- const modelKnown = model === '' || (options.models ?? []).some(item => item.id === model)
222
+ const modelKnown = model === '' || models.some(item => item.id === model)
223
+ // One line for the closed fold: which switches are on.
224
+ const advancedOn: string[] = []
225
+ if (task.reuseSession === true) advancedOn.push(t('detail.settings.summary.reuseSession'))
226
+ if (task.goalRun === true) advancedOn.push(t('detail.settings.summary.goal'))
227
+ if (task.skipVerification === true) advancedOn.push(t('detail.settings.summary.skipVerification'))
228
+ const advancedSummary = advancedOn.length === 0 ? t('detail.settings.summary.none') : advancedOn.join(' · ')
111
229
  return (
112
230
  <section className={css.detailSection}>
113
231
  <h4>{t('detail.executionSettings')}</h4>
114
- <p className={css.detailText}>{t('exec.hint')}</p>
232
+ <p className={css.detailText} title={t('exec.hint')}>{t('exec.hint.short')}</p>
115
233
  <label className={css.field}>
116
234
  <span className={css.fieldLabel}>{t('new.workspace')}</span>
117
235
  <select
@@ -166,59 +284,73 @@ function ExecutionSettingsSection({ controller, task, pending, executionOptions,
166
284
  className={css.select}
167
285
  value={model}
168
286
  disabled={pending}
169
- onChange={event => { controller.updateTask(task.id, { model: event.target.value === '' ? undefined : event.target.value }) }}
287
+ onChange={event => {
288
+ // The effort is part of this pin: switching to a model that cannot
289
+ // honor the stored level clears it in the same action instead of
290
+ // leaving a value the next run would have to reject. The empty
291
+ // string carries a clear across the JSON transport, where an
292
+ // `undefined` value would lose the key entirely; the ledger
293
+ // normalizes blank targets back to "pinned nothing".
294
+ const next = event.target.value
295
+ const effort = reconcileReasoningEffort(models, next, reasoningEffort)
296
+ controller.updateTask(task.id, {
297
+ model: next,
298
+ ...(effort === reasoningEffort ? {} : { reasoningEffort: effort }),
299
+ })
300
+ }}
170
301
  >
171
302
  <option value="">{t('exec.model.default')}</option>
172
303
  {!modelKnown && <option value={model}>{model}{t('exec.model.unknown')}</option>}
173
- {options.models?.map(item => (
174
- <option key={item.id} value={item.id}>{item.name ?? item.id}</option>
304
+ {models.map(item => (
305
+ <option key={item.id} value={item.id}>{modelDisplayLabel(item)}</option>
175
306
  ))}
176
307
  </select>
177
308
  </label>
178
- <label className={css.scheduleToggle}>
179
- <input
180
- type="checkbox"
181
- checked={task.reuseSession === true}
182
- disabled={pending}
183
- onChange={event => { controller.updateTask(task.id, { reuseSession: event.target.checked }) }}
184
- />
185
- <span>{t('exec.reuseSession')}</span>
186
- </label>
187
- <p className={css.detailText}>{t('exec.reuseSessionHint')}</p>
188
- <label className={css.scheduleToggle}>
189
- <input
190
- type="checkbox"
191
- checked={task.goalRun === true}
192
- // Always operable (only a pending execution locks it): the global
193
- // switch decides whether the preference takes effect, never whether
194
- // the user may state it, and it never rewrites what is stored here.
195
- disabled={pending}
196
- onChange={event => { controller.updateTask(task.id, { goalRun: event.target.checked }) }}
197
- />
198
- <span>{t('exec.goalRun')}</span>
199
- </label>
200
- <p className={css.detailText}>{t('exec.goalRunHint')}</p>
201
- {!goalRunEnabled && <p className={css.detailText}>{t('settings.goalRunGlobalDisabledTaskOption')}</p>}
202
- <label className={css.scheduleToggle}>
203
- <input
204
- type="checkbox"
205
- checked={task.skipVerification === true}
206
- disabled={pending}
207
- onChange={event => { controller.updateTask(task.id, { skipVerification: event.target.checked }) }}
208
- />
209
- <span>{t('exec.skipVerification')}</span>
210
- </label>
211
- <p className={css.detailText}>{t('exec.skipVerificationHint')}</p>
212
- <label className={css.scheduleToggle}>
213
- <input
214
- type="checkbox"
215
- checked={task.teamRun === true}
216
- disabled={pending || !teamRunAvailable}
217
- onChange={event => { controller.updateTask(task.id, { teamRun: event.target.checked }) }}
218
- />
219
- <span>{t('exec.teamRun')}</span>
220
- </label>
221
- <p className={css.detailText}>{teamRunAvailable ? t('exec.teamRunHint') : t('exec.teamRunUnavailable')}</p>
309
+ <ReasoningEffortField
310
+ models={models}
311
+ modelId={model}
312
+ value={reasoningEffort}
313
+ pending={pending}
314
+ onChange={effort => { controller.updateTask(task.id, { reasoningEffort: effort }) }}
315
+ />
316
+ <FoldSection title={t('detail.settings.advanced')} summary={advancedSummary}>
317
+ <label className={css.scheduleToggle} title={t('exec.reuseSessionHint')}>
318
+ <input
319
+ type="checkbox"
320
+ checked={task.reuseSession === true}
321
+ disabled={pending}
322
+ onChange={event => { controller.updateTask(task.id, { reuseSession: event.target.checked }) }}
323
+ />
324
+ <span>{t('exec.reuseSession')}</span>
325
+ </label>
326
+ <p className={css.detailMeta}>{t('exec.reuseSessionHint.short')}</p>
327
+ <label className={css.scheduleToggle} title={t('exec.goalRunHint')}>
328
+ <input
329
+ type="checkbox"
330
+ checked={task.goalRun === true}
331
+ // Always operable (only a pending execution locks it): the global
332
+ // switch decides whether the preference takes effect, never whether
333
+ // the user may state it, and it never rewrites what is stored here.
334
+ disabled={pending}
335
+ onChange={event => { controller.updateTask(task.id, { goalRun: event.target.checked }) }}
336
+ />
337
+ <span>{t('exec.goalRun')}</span>
338
+ </label>
339
+ <p className={css.detailMeta}>{t('exec.goalRunHint.short')}</p>
340
+ {!goalRunEnabled && (
341
+ <p className={css.detailMeta} title={t('settings.goalRunGlobalDisabledTaskOption')}>{t('exec.goalRunGlobalOff')}</p>
342
+ )}
343
+ <label className={css.scheduleToggle} title={t('exec.skipVerificationHint')}>
344
+ <input
345
+ type="checkbox"
346
+ checked={task.skipVerification === true}
347
+ disabled={pending}
348
+ onChange={event => { controller.updateTask(task.id, { skipVerification: event.target.checked }) }}
349
+ />
350
+ <span>{t('exec.skipVerification')}</span>
351
+ </label>
352
+ <p className={css.detailMeta}>{t('exec.skipVerificationHint.short')}</p>
353
+ </FoldSection>
222
354
  </section>
223
355
  )
224
356
  }
@@ -416,10 +548,28 @@ function ScheduleSection({ controller, task, pending }: { controller: BoardContr
416
548
  const budget = schedule === undefined ? undefined : budgetLabel(schedule)
417
549
  const ended = schedule === undefined ? undefined : endedLabel(schedule)
418
550
  const skipped = schedule === undefined ? undefined : skippedLabel(schedule)
551
+ // One line for the closed fold: whether the rule is armed, what it will do,
552
+ // and when — or, when it already finished or was skipped, the ledger's own
553
+ // reason. The editor itself is unchanged inside the fold.
554
+ const plannedAt = mode === 'once' ? parseZonedInput(atText, effectiveZone) : undefined
555
+ const planLabel = mode === 'once'
556
+ ? t('detail.schedule.summary.planOnce', { time: plannedAt === undefined ? '—' : formatHostTimestamp(plannedAt, effectiveZone) })
557
+ : t('detail.schedule.summary.planCron', { cron: cron.trim() === '' ? '—' : cron.trim() })
558
+ // The row itself carries only the next instant; the rule that produced it is
559
+ // the fold's tooltip, so a narrow panel clips the row without losing the rule.
560
+ const scheduleHint = enabled && ended === undefined
561
+ ? t('detail.schedule.summary.onFull', { plan: planLabel, next: nextLabel })
562
+ : undefined
563
+ const scheduleSummary = ended !== undefined
564
+ ? t('detail.schedule.ended', { reason: ended })
565
+ : enabled
566
+ ? t('detail.schedule.summary.on', { next: nextLabel })
567
+ : skipped !== undefined
568
+ ? t('detail.schedule.skipped', { reason: skipped })
569
+ : t('detail.schedule.summary.off')
419
570
 
420
571
  return (
421
- <section className={css.detailSection}>
422
- <h4>{t('detail.schedule')}</h4>
572
+ <FoldSection title={t('detail.schedule')} summary={scheduleSummary} hint={scheduleHint}>
423
573
  <label className={css.scheduleToggle}>
424
574
  <input
425
575
  type="checkbox"
@@ -546,10 +696,26 @@ function ScheduleSection({ controller, task, pending }: { controller: BoardContr
546
696
  {t('detail.schedule.cancel')}
547
697
  </button>
548
698
  )}
549
- </section>
699
+ </FoldSection>
550
700
  )
551
701
  }
552
702
 
703
+ /**
704
+ * The read-only note under the subtask list. A card with unfinished descendants
705
+ * runs as ONE session — that card's own — which reads the subtasks and hands
706
+ * them off in dependency order, so the note states what the run does instead of
707
+ * promising a session per member. It counts the same members the run hands off
708
+ * (`joinsCascadeRun` leaves a finished subtask alone, and an archived card never
709
+ * runs at all), and stays a sentence: nothing here is a card field.
710
+ */
711
+ function subtaskDispatchNote(task: TaskRecord, tasks: readonly TaskRecord[], maxSubtaskDepth: number): string {
712
+ const pending = descendantTasks(tasks, task.id, maxSubtaskDepth)
713
+ .filter(descendant => descendant.archivedAt === undefined && joinsCascadeRun(descendant, task.id))
714
+ return pending.length > 0
715
+ ? t('detail.subtasks.runHint', { count: String(pending.length) })
716
+ : t('detail.subtasks.runHintSettled')
717
+ }
718
+
553
719
  /**
554
720
  * The subtask block: the parent link, the direct subtasks with their status,
555
721
  * and the actions that grow or prune the tree. Every gate here mirrors the
@@ -620,7 +786,7 @@ function SubtaskSection({ controller, task, pending, archived, snapshot }: {
620
786
  </ul>
621
787
  )}
622
788
  {children.length > 0 && (
623
- <p className={css.detailText}>{t('detail.subtasks.runHint', { count: String(children.length) })}</p>
789
+ <p className={css.detailText}>{subtaskDispatchNote(task, tasks, limit)}</p>
624
790
  )}
625
791
  {!archived && (canAddChild
626
792
  ? (controller.isHostBacked()
@@ -680,6 +846,7 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
680
846
  const timeZone = snapshot.host?.scheduler.timeZone
681
847
  const permissionPending = requiresPermissionConfirmation(current, snapshot.host?.sessionDefaultPermission)
682
848
  const subtaskChildren = directSubtasks(snapshot.tasks, current.id)
849
+ const subtaskDepthLimit = snapshot.host?.maxSubtaskDepth ?? DEFAULT_SUBTASK_DEPTH
683
850
  const dialog = useDialog<HTMLDivElement>(() => { controller.closeTask() }, phase)
684
851
  // One presence per nested overlay: the detail view sits under up to four of
685
852
  // them, and each has to run its own exit leg instead of the surface being
@@ -691,6 +858,37 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
691
858
  const editPresence = usePresence(editOpen)
692
859
  const tagsPresence = usePresence(tagsOpen)
693
860
  const duplicatePresence = usePresence(duplicateOpen)
861
+ // The closed history echoes its own ledger: how many runs, and what the latest
862
+ // one was and when — the panel then never repeats that per row.
863
+ const latestExecution = current.executions[current.executions.length - 1]
864
+ const historySummary = latestExecution === undefined
865
+ ? t('detail.noExecution')
866
+ : t('detail.execution.summary', {
867
+ count: String(current.executions.length),
868
+ time: formatTime(latestExecution.endedAt ?? latestExecution.startedAt, timeZone),
869
+ result: latestExecution.result === undefined
870
+ ? t('detail.result.running')
871
+ : t(EXECUTION_RESULT_KEY[latestExecution.result]),
872
+ })
873
+ // Secondary actions leave the footer so it holds exactly three controls on
874
+ // one primary-to-destructive track; they stay one press away in the header.
875
+ const headerActions: ActionMenuItem[] = []
876
+ if (!archived) {
877
+ headerActions.push({
878
+ key: 'duplicate',
879
+ label: canEditTaskContent(current) ? t('detail.duplicate') : t('detail.duplicateAndEdit'),
880
+ disabled: pending,
881
+ onSelect: () => { setShowDuplicate(true) },
882
+ })
883
+ if (current.status === 'done' || current.status === 'failed') {
884
+ headerActions.push({
885
+ key: 'archive',
886
+ label: t('detail.archive'),
887
+ disabled: pending,
888
+ onSelect: () => { controller.archiveTask(current.id) },
889
+ })
890
+ }
891
+ }
694
892
 
695
893
  return (
696
894
  <div className={css.modalBackdrop} data-state={phase} onMouseDown={dialog.onMouseDown}>
@@ -700,6 +898,9 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
700
898
  <span className={css.statusBadge} data-status={archived ? 'archived' : current.status}>
701
899
  {archived ? t('board.archive') : t(STATUS_KEY[current.status])}
702
900
  </span>
901
+ {headerActions.length > 0 && (
902
+ <ActionMenu label={t('detail.more')} items={headerActions} disabled={pending} />
903
+ )}
703
904
  <button
704
905
  type="button"
705
906
  className={css.iconButton}
@@ -720,139 +921,172 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
720
921
  </button>
721
922
  </div>
722
923
  )}
723
- <section className={css.detailSection}>
724
- <h4>{t('detail.description')}</h4>
725
- <ClampedMarkdown source={current.description !== '' ? current.description : '—'} />
726
- </section>
727
-
728
- <SubtaskSection controller={controller} task={current} pending={pending} archived={archived} snapshot={snapshot} />
729
-
730
- {current.tags !== undefined && current.tags.length > 0 && (
731
- <section className={css.detailSection} data-dsh-part="tags">
732
- <h4>{t('new.tags')}</h4>
733
- <div className={css.cardTags}>
734
- {current.tags.map(tag => (
735
- <span
736
- key={tag.name}
737
- className={css.cardTag}
738
- data-tag-tone={tagTone(tag.name)}
739
- data-dsh-part="tag-badge"
740
- data-tag-hint={tag.promptPrefix === undefined ? undefined : tag.promptPrefix}
741
- title={tag.promptPrefix === undefined ? tag.name : tag.promptPrefix}
742
- >
743
- {tag.name}
744
- </span>
745
- ))}
746
- </div>
747
- </section>
748
- )}
749
924
 
750
- {current.freeze !== undefined && (
751
- <section className={css.detailSection} data-dsh-part="freeze">
752
- <h4>{t('detail.freeze')}</h4>
753
- {current.freeze.redacted === true && <p className={css.formError}>{t('detail.freeze.redacted')}</p>}
754
- <p className={css.detailText}><strong>{t('detail.freeze.goal')}</strong></p>
755
- <pre className={css.promptBlock}>{current.freeze.goal}</pre>
756
- <p className={css.detailText}><strong>{t('detail.freeze.progress')}</strong></p>
757
- <pre className={css.promptBlock}>{current.freeze.progress}</pre>
758
- <p className={css.detailText}><strong>{t('detail.freeze.next')}</strong></p>
759
- <pre className={css.promptBlock}>{current.freeze.next}</pre>
760
- <p className={css.detailMeta}>{t('detail.freeze.frozenAt', { time: formatHostTimestamp(current.freeze.frozenAt, timeZone) })}</p>
761
- {current.freeze.frozenBy !== undefined && (
762
- <p className={css.detailMeta}>{t('detail.freeze.frozenBy', { session: current.freeze.frozenBy })}</p>
763
- )}
764
- </section>
765
- )}
925
+ {/* Two columns on a wide panel: what the card says on the left, what
926
+ the board does with it on the right. Both columns open on the same
927
+ baseline and share the 8px spacing rhythm; under 1024px the grid
928
+ collapses to the single reading column. */}
929
+ <div className={css.detailColumns} data-detail-layout="columns">
930
+ <div className={css.detailColumn} data-detail-column="content">
931
+ <section className={css.detailSection}>
932
+ <h4>{t('detail.description')}</h4>
933
+ <ClampedMarkdown source={current.description !== '' ? current.description : '—'} />
934
+ </section>
766
935
 
767
- {current.handover !== undefined && (
768
- <section className={css.detailSection} data-dsh-part="handover">
769
- <h4>{t('detail.handover')}</h4>
770
- <p className={css.detailText}>
771
- {t('new.workspace')}: {current.handover.workspaceId ?? t('exec.workspace.recent')}
772
- {' · '}{t('new.agentPreset')}: {current.handover.mode ?? t('exec.mode.inherit')}
773
- {' · '}{t('new.permission')}: {current.handover.permission === undefined ? t('exec.permission.default') : t(`exec.permission.${current.handover.permission}` as TaskBoardKey)}
774
- </p>
775
- <p className={css.detailText}><strong>{t('detail.handover.references')}</strong></p>
776
- <ul className={css.executionList}>
777
- {current.handover.references.map((reference, index) => (
778
- // References are free text from the freeze block, so the same
779
- // string can appear twice; the index keeps the key unique (#1492).
780
- <li key={`${reference}-${index}`} className={css.executionRow}><code>{reference}</code></li>
781
- ))}
782
- </ul>
783
- <p className={css.detailMeta}>{t('detail.handover.bundledAt', { time: formatHostTimestamp(current.handover.bundledAt, timeZone) })}</p>
784
- </section>
785
- )}
936
+ <section className={css.detailSection}>
937
+ <h4>{t('detail.prompt')}</h4>
938
+ <ClampedMarkdown source={current.prompt !== '' ? current.prompt : current.title} />
939
+ </section>
786
940
 
787
- {permissionPending && (
788
- <section className={css.detailSection} data-dsh-part="permission-gate">
789
- <p className={css.formError}>{t('detail.permissionPending', { permission: t(`exec.permission.${current.handover?.permission ?? current.permission}` as TaskBoardKey) })}</p>
790
- <button type="button" className={css.primaryButton} disabled={pending} onClick={() => { void controller.confirmPermission(current.id) }}>
791
- {t('detail.permissionConfirm')}
792
- </button>
793
- </section>
794
- )}
795
- {current.permissionConfirmedAt !== undefined && (
796
- <p className={css.detailMeta}>{t('detail.permissionConfirmed', { time: formatHostTimestamp(current.permissionConfirmedAt, timeZone) })}</p>
797
- )}
941
+ {current.tags !== undefined && current.tags.length > 0 && (
942
+ <section className={css.detailSection} data-dsh-part="tags">
943
+ <h4>{t('new.tags')}</h4>
944
+ <div className={css.cardTags}>
945
+ {current.tags.map(tag => (
946
+ <span
947
+ key={tag.name}
948
+ className={css.cardTag}
949
+ data-tag-tone={tagTone(tag.name)}
950
+ data-dsh-part="tag-badge"
951
+ data-tag-hint={tag.promptPrefix === undefined ? undefined : tag.promptPrefix}
952
+ title={tag.promptPrefix === undefined ? tag.name : tag.promptPrefix}
953
+ >
954
+ {tag.name}
955
+ </span>
956
+ ))}
957
+ </div>
958
+ </section>
959
+ )}
798
960
 
799
- {seats.detailSection({ task: current, dispatch })}
961
+ {current.attachments !== undefined && current.attachments.length > 0 && (
962
+ <section className={css.detailSection}>
963
+ <h4>{t('detail.attachments')}</h4>
964
+ <ul className={css.attachmentList}>
965
+ {current.attachments.map(attachment => (
966
+ <li className={css.attachmentRow} key={attachment.attachmentId}>
967
+ {attachment.kind === 'image'
968
+ ? <img className={css.attachmentThumb} src={attachmentImageUrl(attachment.attachmentId)} alt={attachment.name} />
969
+ : null}
970
+ <span className={css.attachmentName}>
971
+ {attachment.name}
972
+ <span className={css.attachmentMeta}>
973
+ {' '}
974
+ {formatAttachmentBytes(attachment.bytes)}
975
+ {attachment.kind === 'image' && attachment.width !== undefined && attachment.height !== undefined
976
+ ? ` · ${attachment.width}×${attachment.height}`
977
+ : ''}
978
+ </span>
979
+ </span>
980
+ </li>
981
+ ))}
982
+ </ul>
983
+ <p className={css.detailMeta}>{t('detail.attachments.removeHint')}</p>
984
+ </section>
985
+ )}
800
986
 
801
- <section className={css.detailSection}>
802
- <h4>{t('detail.prompt')}</h4>
803
- <ClampedMarkdown source={current.prompt !== '' ? current.prompt : current.title} />
804
- </section>
987
+ <SubtaskSection controller={controller} task={current} pending={pending} archived={archived} snapshot={snapshot} />
805
988
 
806
- {!archived && (
807
- <>
808
- <ExecutionSettingsSection
809
- controller={controller}
810
- task={current}
811
- pending={pending}
812
- executionOptions={snapshot.executionOptions}
813
- teamRunAvailable={snapshot.host?.teamRunAvailable === true}
814
- goalRunEnabled={snapshot.host?.goalRunEnabled === true}
815
- />
816
- <ScheduleSection controller={controller} task={current} pending={pending} />
817
- </>
818
- )}
989
+ {current.freeze !== undefined && (
990
+ <section className={css.detailSection} data-dsh-part="freeze">
991
+ <h4>{t('detail.freeze')}</h4>
992
+ {current.freeze.redacted === true && <p className={css.formError}>{t('detail.freeze.redacted')}</p>}
993
+ <p className={css.detailText}><strong>{t('detail.freeze.goal')}</strong></p>
994
+ <pre className={css.promptBlock}>{current.freeze.goal}</pre>
995
+ <p className={css.detailText}><strong>{t('detail.freeze.progress')}</strong></p>
996
+ <pre className={css.promptBlock}>{current.freeze.progress}</pre>
997
+ <p className={css.detailText}><strong>{t('detail.freeze.next')}</strong></p>
998
+ <pre className={css.promptBlock}>{current.freeze.next}</pre>
999
+ <p className={css.detailMeta}>{t('detail.freeze.frozenAt', { time: formatHostTimestamp(current.freeze.frozenAt, timeZone) })}</p>
1000
+ {current.freeze.frozenBy !== undefined && (
1001
+ <p className={css.detailMeta}>{t('detail.freeze.frozenBy', { session: current.freeze.frozenBy })}</p>
1002
+ )}
1003
+ </section>
1004
+ )}
819
1005
 
820
- <section className={css.detailSection}>
821
- <h4>{t('detail.execution')}</h4>
822
- {current.executions.length === 0 ? (
823
- <p className={css.detailText}>{t('detail.noExecution')}</p>
824
- ) : (
825
- <ul className={css.executionList}>
826
- {[...current.executions].reverse().map(execution => (
827
- <ExecutionRow
828
- key={execution.id}
829
- execution={execution}
830
- timeZone={timeZone}
831
- onOpen={sessionId => { controller.openSession(sessionId) }}
832
- />
833
- ))}
834
- </ul>
835
- )}
836
- </section>
1006
+ {current.handover !== undefined && (
1007
+ <section className={css.detailSection} data-dsh-part="handover">
1008
+ <h4>{t('detail.handover')}</h4>
1009
+ <p className={css.detailText}>
1010
+ {t('new.workspace')}: {current.handover.workspaceId ?? t('exec.workspace.recent')}
1011
+ {' · '}{t('new.agentPreset')}: {current.handover.mode ?? t('exec.mode.inherit')}
1012
+ {' · '}{t('new.permission')}: {current.handover.permission === undefined ? t('exec.permission.default') : t(`exec.permission.${current.handover.permission}` as TaskBoardKey)}
1013
+ </p>
1014
+ <p className={css.detailText}><strong>{t('detail.handover.references')}</strong></p>
1015
+ <ul className={css.referenceList}>
1016
+ {current.handover.references.map((reference, index) => (
1017
+ // References are free text from the freeze block, so the same
1018
+ // string can appear twice; the index keeps the key unique (#1492).
1019
+ <li key={`${reference}-${index}`} className={css.referenceRow}><code>{reference}</code></li>
1020
+ ))}
1021
+ </ul>
1022
+ <p className={css.detailMeta}>{t('detail.handover.bundledAt', { time: formatHostTimestamp(current.handover.bundledAt, timeZone) })}</p>
1023
+ </section>
1024
+ )}
837
1025
 
838
- {!archived && (
839
- <section className={css.detailSection}>
840
- <h4>{t('board.status')}</h4>
841
- <div className={css.moveRow}>
842
- {MANUAL_STATUSES.map(status => (
843
- <button
844
- key={status}
845
- type="button"
846
- className={css.ghostButton}
847
- disabled={pending || !canMoveTask(current, status)}
848
- onClick={() => { controller.moveTask(current.id, status) }}
849
- >
850
- {t(`status.move.${status}` as TaskBoardKey)}
1026
+ {seats.detailSection({ task: current, dispatch })}
1027
+ </div>
1028
+
1029
+ <div className={css.detailColumn} data-detail-column="execution">
1030
+ {permissionPending && (
1031
+ <section className={css.detailSection} data-dsh-part="permission-gate">
1032
+ <p className={css.formError}>{t('detail.permissionPending', { permission: t(`exec.permission.${current.handover?.permission ?? current.permission}` as TaskBoardKey) })}</p>
1033
+ <button type="button" className={css.primaryButton} disabled={pending} onClick={() => { void controller.confirmPermission(current.id) }}>
1034
+ {t('detail.permissionConfirm')}
851
1035
  </button>
852
- ))}
1036
+ </section>
1037
+ )}
1038
+ {current.permissionConfirmedAt !== undefined && (
1039
+ <p className={css.detailMeta}>{t('detail.permissionConfirmed', { time: formatHostTimestamp(current.permissionConfirmedAt, timeZone) })}</p>
1040
+ )}
1041
+
1042
+ {/* The three folds read as one list. The settings fold closes the
1043
+ section above it, so the group's 8px rhythm governs both the
1044
+ gap it trails and the gap before the history fold, while the
1045
+ blocks around the group keep the panel's 16px rhythm. */}
1046
+ <div className={css.detailFolds}>
1047
+ {!archived && (
1048
+ <>
1049
+ <ExecutionSettingsSection
1050
+ controller={controller}
1051
+ task={current}
1052
+ pending={pending}
1053
+ executionOptions={snapshot.executionOptions}
1054
+ goalRunEnabled={snapshot.host?.goalRunEnabled === true}
1055
+ />
1056
+ <ScheduleSection controller={controller} task={current} pending={pending} />
1057
+ </>
1058
+ )}
1059
+
1060
+ <FoldSection title={t('detail.execution')} summary={historySummary}>
1061
+ {current.executions.length === 0 ? (
1062
+ <p className={css.detailText}>{t('detail.noExecution')}</p>
1063
+ ) : (
1064
+ <ExecutionLog
1065
+ executions={current.executions}
1066
+ timeZone={timeZone}
1067
+ onOpenSession={sessionId => { controller.openSession(sessionId) }}
1068
+ />
1069
+ )}
1070
+ </FoldSection>
853
1071
  </div>
854
- </section>
855
- )}
1072
+
1073
+ {!archived && (
1074
+ <section className={css.detailSection}>
1075
+ <h4>{t('board.status')}</h4>
1076
+ <ActionMenu
1077
+ label={t('detail.moveTo')}
1078
+ disabled={pending}
1079
+ items={MANUAL_STATUSES.map(status => ({
1080
+ key: status,
1081
+ label: t(`status.move.${status}` as TaskBoardKey),
1082
+ disabled: !canMoveTask(current, status),
1083
+ onSelect: () => { controller.moveTask(current.id, status) },
1084
+ }))}
1085
+ />
1086
+ </section>
1087
+ )}
1088
+ </div>
1089
+ </div>
856
1090
  </div>
857
1091
 
858
1092
  <footer className={css.detailFooter}>
@@ -877,24 +1111,13 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
877
1111
  {t('detail.editTags')}
878
1112
  </button>
879
1113
  )}
880
- {!archived && (
881
- <button
882
- type="button"
883
- className={css.ghostButton}
884
- disabled={pending}
885
- onClick={() => { setShowDuplicate(true) }}
886
- title={canEditTaskContent(current) ? t('detail.duplicate') : t('detail.duplicateAndEdit')}
887
- >
888
- {canEditTaskContent(current) ? t('detail.duplicate') : t('detail.duplicateAndEdit')}
889
- </button>
890
- )}
891
1114
  {!archived && (
892
1115
  <button
893
1116
  type="button"
894
1117
  className={css.primaryButton}
895
1118
  disabled={busy || pending}
896
1119
  title={subtaskChildren.length > 0
897
- ? t('detail.subtasks.runHint', { count: String(subtaskChildren.length) })
1120
+ ? subtaskDispatchNote(current, snapshot.tasks, subtaskDepthLimit)
898
1121
  : undefined}
899
1122
  onClick={() => {
900
1123
  void controller.rerunTask(current.id).then(() => {
@@ -905,7 +1128,7 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
905
1128
  {current.executions.length === 0 ? t('detail.run') : t('detail.rerun')}
906
1129
  </button>
907
1130
  )}
908
- {archived ? (
1131
+ {archived && (
909
1132
  <button
910
1133
  type="button"
911
1134
  className={css.primaryButton}
@@ -916,20 +1139,11 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
916
1139
  >
917
1140
  {t('detail.restore')}
918
1141
  </button>
919
- ) : (
920
- (current.status === 'done' || current.status === 'failed') && (
921
- <button
922
- type="button"
923
- className={css.ghostButton}
924
- disabled={pending}
925
- onClick={() => {
926
- controller.archiveTask(current.id)
927
- }}
928
- >
929
- {t('detail.archive')}
930
- </button>
931
- )
932
1142
  )}
1143
+ <span className={`${css.detailMeta} ${css.detailStamp}`}>
1144
+ {t('board.created')} {formatTime(current.createdAt, timeZone)}
1145
+ {archived && ` · ${t('detail.archivedAt', { time: formatTime(current.archivedAt!, timeZone) })}`}
1146
+ </span>
933
1147
  <button
934
1148
  type="button"
935
1149
  className={css.dangerButton}
@@ -938,10 +1152,6 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
938
1152
  >
939
1153
  {t('detail.delete')}
940
1154
  </button>
941
- <span className={css.detailMeta}>
942
- {t('board.created')} {formatTime(current.createdAt, timeZone)}
943
- {archived && ` · ${t('detail.archivedAt', { time: formatTime(current.archivedAt!, timeZone) })}`}
944
- </span>
945
1155
  </footer>
946
1156
  </div>
947
1157