@kabmo-labs/kabmo 0.25.0 → 0.27.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.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +448 -444
- package/dist/client/static/js/index-32rpkj6b.css +1 -0
- package/dist/client/static/js/{index-ga8cbpt4.js → index-e3qh2yps.js} +950 -950
- package/package.json +1 -1
- package/src/client/components/common/Toast.test.tsx +28 -2
- package/src/client/components/common/Toast.tsx +21 -9
- package/src/client/components/common/session-actions-menu/index.tsx +38 -12
- package/src/client/components/common/session-branch/BranchGuides.tsx +93 -0
- package/src/client/components/common/session-branch/SubagentRow.tsx +77 -0
- package/src/client/components/common/session-branch/index.tsx +169 -0
- package/src/client/components/common/session-branch/session-branch.test.tsx +240 -0
- package/src/client/components/common/session-branch/style.ts +29 -0
- package/src/client/components/common/session-row/StatusSlot.tsx +15 -3
- package/src/client/components/common/session-row/index.tsx +24 -25
- package/src/client/components/common/session-row/session-row.test.tsx +11 -0
- package/src/client/components/common/session-state-provider/index.tsx +1 -1
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +2 -1
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +66 -69
- package/src/client/components/layout/session-sidebar/SessionItem.batch.test.ts +3 -3
- package/src/client/components/layout/session-sidebar/SessionItem.test.ts +25 -2
- package/src/client/components/layout/session-sidebar/SessionItem.tsx +33 -30
- package/src/client/components/layout/session-sidebar/SessionList.tsx +2 -1
- package/src/client/components/layout/session-sidebar/about-modal/HarnessRow.tsx +261 -0
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.tsx +35 -225
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTableLog.test.tsx +36 -16
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogDialog.tsx +11 -3
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogLine.tsx +13 -4
- package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +3 -2
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +30 -14
- package/src/client/components/layout/session-sidebar/modern/RevealRow.tsx +56 -0
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +69 -85
- package/src/client/components/layout/session-sidebar/modern/reveal-row.test.tsx +104 -0
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +2 -1
- package/src/client/components/layout/session-sidebar/variant-props.ts +2 -1
- package/src/client/components/mobile/SessionSidebar.tsx +2 -1
- package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +2 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +59 -62
- package/src/client/components/mobile/mobile-session-sidebar/List.tsx +2 -1
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.test.ts +5 -0
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +33 -30
- package/src/client/components/settings/Modal.tsx +1 -1
- package/src/client/components/settings/Sidebar.tsx +1 -1
- package/src/client/components/settings/categories/NotificationSettings.test.tsx +92 -0
- package/src/client/components/settings/categories/NotificationSettings.tsx +112 -2
- package/src/client/components/settings/categories/harness-settings/HarnessCard.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/WorktreeSettings.tsx +2 -1
- package/src/client/components/settings/categories/usage-settings/LimitsSection.tsx +39 -19
- package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +1 -0
- package/src/client/components/settings/categories/usage-settings/limit-groups.test.ts +94 -0
- package/src/client/components/settings/categories/usage-settings/limit-groups.ts +118 -0
- package/src/client/components/settings/categories/usage-settings/limits-section.test.tsx +118 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.fork.test.ts +94 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +31 -5
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +86 -93
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +7 -5
- package/src/client/components/workspace/chat-timeline/PendingChatView.tsx +21 -1
- package/src/client/components/workspace/chat-timeline/PendingTranscript.tsx +130 -0
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +12 -3
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +2 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +15 -1
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +85 -0
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +84 -0
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +2 -0
- package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +5 -0
- package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +141 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +16 -22
- package/src/client/components/workspace/chat-timeline/target-picker/DraftTargetRow.tsx +116 -0
- package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +173 -0
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +5 -4
- package/src/client/components/workspace/chat-timeline/target-picker/parent-session-options.test.ts +49 -0
- package/src/client/components/workspace/git-panel/index.tsx +2 -2
- package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +8 -5
- package/src/client/components/workspace/terminal-panel/index.tsx +3 -0
- package/src/client/hooks/chat/composer/items.test.ts +19 -0
- package/src/client/hooks/chat/omp/folder-auto-expand.ts +1 -1
- package/src/client/hooks/chat/omp/pending-adoption.ts +51 -0
- package/src/client/hooks/chat/omp/pending-child.test.ts +73 -0
- package/src/client/hooks/chat/omp/pending-entry.ts +59 -0
- package/src/client/hooks/chat/omp/pending-rows.ts +6 -2
- package/src/client/hooks/chat/omp/pending-sessions.test.ts +1 -2
- package/src/client/hooks/chat/omp/pending-sessions.ts +45 -69
- package/src/client/hooks/chat/omp/pending-waiting.ts +1 -1
- package/src/client/hooks/chat/omp/run-switch.ts +1 -1
- package/src/client/hooks/chat/omp/session-list.tsx +9 -0
- package/src/client/hooks/chat/omp/sidebar-reload.test.ts +85 -0
- package/src/client/hooks/chat/omp/sidebar-reload.ts +30 -0
- package/src/client/hooks/chat/subagents/roster.ts +122 -0
- package/src/client/hooks/chat/timeline/child-spawn.test.ts +55 -0
- package/src/client/hooks/chat/timeline/child-spawn.ts +45 -0
- package/src/client/hooks/chat/timeline/fork-preview.test.ts +148 -0
- package/src/client/hooks/chat/timeline/fork-preview.ts +104 -0
- package/src/client/hooks/chat/timeline/fork-request.test.ts +54 -0
- package/src/client/hooks/chat/timeline/fork-request.ts +43 -0
- package/src/client/hooks/chat/timeline/fork-send.test.ts +139 -0
- package/src/client/hooks/chat/timeline/mode-availability.test.ts +1 -1
- package/src/client/hooks/chat/timeline/mode-availability.ts +33 -0
- package/src/client/hooks/chat/timeline/mode-markers.ts +7 -1
- package/src/client/hooks/chat/timeline/mode-post.ts +15 -3
- package/src/client/hooks/chat/timeline/modes-contract.ts +9 -4
- package/src/client/hooks/chat/timeline/modes.test.ts +56 -18
- package/src/client/hooks/chat/timeline/modes.ts +42 -29
- package/src/client/hooks/chat/timeline/pending-branch.ts +214 -0
- package/src/client/hooks/chat/timeline/pending-dispatch.ts +302 -0
- package/src/client/hooks/chat/timeline/send.ts +17 -103
- package/src/client/hooks/chat/timeline/session-harness.ts +6 -0
- package/src/client/hooks/chat/timeline/stop-with-queue.ts +42 -0
- package/src/client/hooks/chat/timeline/use-fork-session.ts +40 -31
- package/src/client/hooks/chat/waiting/cancel.ts +2 -1
- package/src/client/hooks/chat/waiting/dispatch.ts +5 -4
- package/src/client/hooks/chat/waiting/held.ts +2 -1
- package/src/client/hooks/models/use-harness-update.test.ts +137 -44
- package/src/client/hooks/models/use-harness-update.ts +133 -85
- package/src/client/hooks/settings/providers/actions.ts +3 -2
- package/src/client/hooks/settings/providers/messages.ts +9 -7
- package/src/client/hooks/settings/providers/model-actions.ts +2 -1
- package/src/client/hooks/ui/editor-error-toast.ts +2 -1
- package/src/client/hooks/ui/input-required-alert.ts +12 -5
- package/src/client/hooks/ui/notifications.ts +45 -0
- package/src/client/hooks/ui/run-outcome-alert.ts +48 -0
- package/src/client/hooks/workspace/batch-archive.test.ts +2 -2
- package/src/client/hooks/workspace/batch-archive.ts +4 -2
- package/src/client/hooks/workspace/expanded-sessions.ts +36 -7
- package/src/client/hooks/workspace/git-action-outcome.ts +4 -3
- package/src/client/hooks/workspace/navbar-session-actions.ts +2 -1
- package/src/client/hooks/workspace/session-actions.test.ts +2 -1
- package/src/client/hooks/workspace/session-actions.ts +2 -1
- package/src/client/hooks/workspace/terminal/connection.test.ts +63 -0
- package/src/client/hooks/workspace/terminal/connection.ts +47 -0
- package/src/client/hooks/workspace/terminal/index.ts +35 -4
- package/src/client/hooks/workspace/workspace-folder-actions.ts +2 -1
- package/src/client/lib/native/open-session.ts +33 -0
- package/src/client/lib/notifications/os.test.ts +125 -0
- package/src/client/lib/notifications/os.ts +130 -0
- package/src/client/lib/plugins/sidebar-bridge.ts +2 -20
- package/src/client/lib/router/open-session.test.ts +75 -0
- package/src/client/lib/router/open-session.ts +34 -0
- package/src/client/lib/signals.ts +5 -1
- package/src/client/main.tsx +6 -0
- package/src/server/lib/db/schema.ts +1 -0
- package/src/server/lib/harness/acp/calls.ts +15 -1
- package/src/server/lib/harness/acp/client-capabilities.test.ts +55 -0
- package/src/server/lib/harness/acp/client-capabilities.ts +61 -0
- package/src/server/lib/harness/acp/client-fs.test.ts +135 -0
- package/src/server/lib/harness/acp/client-fs.ts +131 -0
- package/src/server/lib/harness/acp/client-initialize.test.ts +70 -0
- package/src/server/lib/harness/acp/client-initialize.ts +84 -0
- package/src/server/lib/harness/acp/client.ts +31 -21
- package/src/server/lib/harness/acp/commands.test.ts +5 -5
- package/src/server/lib/harness/acp/commands.ts +14 -2
- package/src/server/lib/harness/acp/frames-timing.test.ts +68 -0
- package/src/server/lib/harness/acp/frames-v2.test.ts +85 -0
- package/src/server/lib/harness/acp/frames.ts +71 -158
- package/src/server/lib/harness/acp/mapper.test.ts +40 -0
- package/src/server/lib/harness/acp/mapper.ts +12 -0
- package/src/server/lib/harness/acp/permissions.ts +6 -0
- package/src/server/lib/harness/acp/protocol.ts +41 -2
- package/src/server/lib/harness/acp/session-facts.ts +1 -1
- package/src/server/lib/harness/acp/session-handshake.test.ts +90 -1
- package/src/server/lib/harness/acp/session-handshake.ts +83 -6
- package/src/server/lib/harness/acp/session-idle.ts +7 -6
- package/src/server/lib/harness/acp/session-notifications.ts +41 -2
- package/src/server/lib/harness/acp/session-observers.test.ts +63 -0
- package/src/server/lib/harness/acp/session-permissions.test.ts +29 -0
- package/src/server/lib/harness/acp/session-permissions.ts +36 -0
- package/src/server/lib/harness/acp/session-requests.test.ts +92 -0
- package/src/server/lib/harness/acp/session-requests.ts +48 -6
- package/src/server/lib/harness/acp/session-turns.ts +8 -3
- package/src/server/lib/harness/acp/session-usage.ts +4 -0
- package/src/server/lib/harness/acp/session-web-state.ts +30 -2
- package/src/server/lib/harness/acp/session.test-util.ts +19 -1
- package/src/server/lib/harness/acp/session.ts +60 -60
- package/src/server/lib/harness/acp/tool-calls.ts +223 -0
- package/src/server/lib/harness/acp/turn.test.ts +102 -0
- package/src/server/lib/harness/acp/turn.ts +81 -6
- package/src/server/lib/harness/acp/v2.test.ts +144 -0
- package/src/server/lib/harness/acp/v2.ts +220 -0
- package/src/server/lib/harness/acp/verbs.ts +46 -6
- package/src/server/lib/harness/launch.test.ts +25 -0
- package/src/server/lib/harness/launch.ts +21 -9
- package/src/server/lib/harness/session.ts +3 -0
- package/src/server/lib/harness/update-job-store.test.ts +37 -12
- package/src/server/lib/harness/update-job-store.ts +22 -16
- package/src/server/lib/harness/update-job.server.ts +66 -175
- package/src/server/lib/harness/update-queue.server.ts +292 -0
- package/src/server/lib/harness/update-queue.test.ts +265 -0
- package/src/server/lib/harness/update-spawn.server.ts +96 -0
- package/src/server/lib/harness/update-worker.ts +8 -3
- package/src/server/lib/lifecycle/after-listen.ts +9 -0
- package/src/server/lib/lifecycle/paths.ts +14 -9
- package/src/server/lib/omp/rpc/run-settle.server.ts +10 -1
- package/src/server/lib/omp/rpc/subagent-liveness.ts +5 -5
- package/src/server/lib/omp/rpc/terminal-settle.ts +5 -1
- package/src/server/lib/omp/session/delete-flow.server.ts +1 -0
- package/src/server/lib/omp/session/sidebar-data.server.ts +10 -12
- package/src/server/lib/sessions/fork.server.test.ts +68 -0
- package/src/server/lib/sessions/fork.server.ts +31 -6
- package/src/server/lib/sessions/spawn.server.test.ts +41 -0
- package/src/server/lib/sessions/spawn.server.ts +27 -2
- package/src/server/lib/usage/report.server.ts +57 -0
- package/src/server/routes/agent/harness-command.ts +6 -5
- package/src/server/routes/chat/stream.ts +7 -2
- package/src/server/routes/harness/update-status.ts +18 -12
- package/src/server/routes/harness/update.test.ts +53 -16
- package/src/server/routes/harness/update.ts +13 -8
- package/src/server/routes/sessions/body-readers.ts +43 -0
- package/src/server/routes/sessions/fork.ts +19 -4
- package/src/server/routes/sessions/routes.test.ts +1 -2
- package/src/server/routes/sessions/session.ts +19 -0
- package/src/server/routes/sessions/spawn.ts +16 -13
- package/src/shared/lib/chat/omp/agent-events.ts +11 -0
- package/src/shared/lib/chat/omp/session-modes-signal.test.ts +41 -0
- package/src/shared/lib/chat/timeline/fork-preview.test.ts +62 -0
- package/src/shared/lib/chat/timeline/fork-preview.ts +36 -0
- package/src/shared/lib/harness/mode-signal.ts +20 -0
- package/src/shared/lib/harness/session-modes.ts +24 -0
- package/src/shared/lib/harness/update-job.ts +53 -6
- package/src/shared/lib/icons/tint-hues.generated.ts +34 -34
- package/src/shared/lib/notifications/outcomes.test.ts +96 -0
- package/src/shared/lib/notifications/outcomes.ts +64 -0
- package/src/shared/lib/notifications/settings.test.ts +49 -0
- package/src/shared/lib/notifications/settings.ts +34 -0
- package/src/shared/lib/omp/session/default-title.ts +5 -4
- package/src/shared/lib/omp/session/prewarm-misc.test.ts +3 -2
- package/src/shared/lib/omp/session/schema-migrations.ts +4 -0
- package/src/shared/lib/omp/session/stream-state.server.test.ts +19 -0
- package/src/shared/lib/omp/session/stream-state.server.ts +24 -4
- package/src/shared/lib/settings/defaults.ts +3 -0
- package/src/shared/lib/ui/toast-duration.test.ts +25 -1
- package/src/shared/lib/ui/toast-duration.ts +22 -4
- package/src/shared/lib/workspace/session-state/store.ts +4 -0
- package/src/shared/types/harness-update.ts +24 -0
- package/src/shared/types/realtime.ts +2 -0
- package/src/shared/types/settings/state.ts +10 -0
- package/src/shared/types/workspace.ts +4 -0
- package/src/test-support/harness-table.test-util.ts +25 -9
- package/dist/client/static/js/index-bc9aa4mx.css +0 -1
- package/src/client/components/common/session-actions-menu/NewChildSessionDialog.tsx +0 -113
- package/src/client/components/common/subagent-list/index.tsx +0 -165
- package/src/client/components/layout/session-sidebar/ChildSessionList.tsx +0 -66
- package/src/client/hooks/workspace/child-expansion.ts +0 -33
package/package.json
CHANGED
|
@@ -18,8 +18,10 @@
|
|
|
18
18
|
* - **Two live toasts were painted in the same place.** Each card used to be its
|
|
19
19
|
* own `fixed bottom-4 right-4` portal; the stack is one column, so a second
|
|
20
20
|
* card pushes the first up instead of covering it.
|
|
21
|
-
* - **An error drew a check mark.** The tone picks
|
|
22
|
-
* region — `alert` for a failure.
|
|
21
|
+
* - **An error drew a check mark.** The tone picks the icon, its tint, the
|
|
22
|
+
* card's border and the live region — `alert` for a failure. A third tone
|
|
23
|
+
* (`warning`) covers the partial outcomes, so an operation that stopped on a
|
|
24
|
+
* conflict cannot be painted as either a success or a failure.
|
|
23
25
|
*/
|
|
24
26
|
|
|
25
27
|
import { afterAll, afterEach, beforeAll, describe, expect, jest, test } from 'bun:test';
|
|
@@ -244,6 +246,30 @@ describe('Toast', () => {
|
|
|
244
246
|
expect(dismissed).toEqual([11]);
|
|
245
247
|
});
|
|
246
248
|
|
|
249
|
+
test('each tone draws its own glyph and tint', async () => {
|
|
250
|
+
const cases = [
|
|
251
|
+
{ type: 'success' as const, tint: 'text-success-text' },
|
|
252
|
+
{ type: 'warning' as const, tint: 'text-warning-text' },
|
|
253
|
+
{ type: 'error' as const, tint: 'text-error-text' },
|
|
254
|
+
];
|
|
255
|
+
|
|
256
|
+
for (const { type, tint } of cases) {
|
|
257
|
+
if (container) render(null, container);
|
|
258
|
+
document.body.replaceChildren();
|
|
259
|
+
mount(
|
|
260
|
+
h(Toast, {
|
|
261
|
+
toast: { id: 12, message: 'Tone check', type, duration: 3000 },
|
|
262
|
+
onDismiss: () => {},
|
|
263
|
+
}),
|
|
264
|
+
);
|
|
265
|
+
await settle();
|
|
266
|
+
|
|
267
|
+
expect(card().getAttribute('data-tone')).toBe(type);
|
|
268
|
+
const glyph = card().querySelector('svg');
|
|
269
|
+
expect(glyph?.getAttribute('class')).toContain(tint);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
|
|
247
273
|
test('a failure is an alert, a confirmation is a status', async () => {
|
|
248
274
|
mountCard(3000);
|
|
249
275
|
expect(card().getAttribute('role')).toBe('status');
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
|
|
2
|
-
import { AlertCircle, CheckCircle2, X } from 'lucide-preact';
|
|
2
|
+
import { AlertCircle, AlertTriangle, CheckCircle2, X, type LucideIcon } from 'lucide-preact';
|
|
3
3
|
import { TOAST_EXIT_MS } from '@/shared/lib/ui/toast-duration';
|
|
4
4
|
import type { ToastTone } from '@/shared/lib/ui/toast-duration';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* What each tone looks like.
|
|
8
|
+
*
|
|
9
|
+
* The tone owns ALL three signals — the icon, its colour and the card's border —
|
|
10
|
+
* so a success cannot draw an alert, and the tint is never decided at a call
|
|
11
|
+
* site. `text-*-text` (not the raw fill token) is the contrast-solved half of
|
|
12
|
+
* the palette: the raw signal colours drop under 2:1 on the light themes.
|
|
13
|
+
*/
|
|
14
|
+
const TONES: Record<ToastTone, { Icon: LucideIcon; icon: string; border: string }> = {
|
|
15
|
+
success: { Icon: CheckCircle2, icon: 'text-success-text', border: 'border-success/35' },
|
|
16
|
+
warning: { Icon: AlertTriangle, icon: 'text-warning-text', border: 'border-warning/40' },
|
|
17
|
+
error: { Icon: AlertCircle, icon: 'text-error-text', border: 'border-error/40' },
|
|
18
|
+
};
|
|
19
|
+
|
|
6
20
|
export interface ToastData {
|
|
7
21
|
id: number;
|
|
8
22
|
message: string;
|
|
@@ -90,11 +104,13 @@ export function Toast({ toast, onDismiss }: ToastProps) {
|
|
|
90
104
|
const hold = useCallback(() => setPaused(true), []);
|
|
91
105
|
const release = useCallback(() => setPaused(false), []);
|
|
92
106
|
|
|
107
|
+
const tone = TONES[toast.type];
|
|
93
108
|
const isError = toast.type === 'error';
|
|
94
109
|
return (
|
|
95
110
|
<div
|
|
96
111
|
role={isError ? 'alert' : 'status'}
|
|
97
112
|
aria-live={isError ? 'assertive' : 'polite'}
|
|
113
|
+
data-tone={toast.type}
|
|
98
114
|
onPointerEnter={hold}
|
|
99
115
|
onPointerLeave={release}
|
|
100
116
|
onFocus={hold}
|
|
@@ -106,16 +122,12 @@ export function Toast({ toast, onDismiss }: ToastProps) {
|
|
|
106
122
|
if (next instanceof Node && event.currentTarget.contains(next)) return;
|
|
107
123
|
release();
|
|
108
124
|
}}
|
|
109
|
-
className={`pointer-events-auto flex items-start gap-2 rounded-lg border bg-paper px-3.5 py-2.5 text-xs font-sans shadow-xl transition-all ${
|
|
110
|
-
|
|
111
|
-
}
|
|
125
|
+
className={`pointer-events-auto flex items-start gap-2 rounded-lg border bg-paper px-3.5 py-2.5 text-xs font-sans shadow-xl transition-all ${tone.border} ${
|
|
126
|
+
entered && !leaving ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-2'
|
|
127
|
+
}`}
|
|
112
128
|
style={{ transitionDuration: `${TOAST_EXIT_MS}ms` }}
|
|
113
129
|
>
|
|
114
|
-
{
|
|
115
|
-
<AlertCircle size={15} className="mt-px text-error flex-shrink-0" />
|
|
116
|
-
) : (
|
|
117
|
-
<CheckCircle2 size={15} className="mt-0.5 text-success flex-shrink-0" />
|
|
118
|
-
)}
|
|
130
|
+
<tone.Icon size={15} className={`mt-px flex-shrink-0 ${tone.icon}`} aria-hidden="true" />
|
|
119
131
|
<span className="min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed text-ink">
|
|
120
132
|
{toast.message}
|
|
121
133
|
</span>
|
|
@@ -29,7 +29,11 @@ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'preac
|
|
|
29
29
|
import type { TargetedMouseEvent } from 'preact';
|
|
30
30
|
import { createPortal } from 'preact/compat';
|
|
31
31
|
import { Archive, ArchiveRestore, GitBranch, Hourglass, Pencil, Trash2, WandSparkles } from 'lucide-preact';
|
|
32
|
-
import {
|
|
32
|
+
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
33
|
+
import { startPendingSession } from '@/client/hooks/chat/omp/pending-sessions';
|
|
34
|
+
import { expandSessionBranch } from '@/client/hooks/workspace/expanded-sessions';
|
|
35
|
+
import { setHarnessPick } from '@/client/hooks/chat/timeline/session-harness';
|
|
36
|
+
import { formatNewSessionTitle } from '@/shared/lib/omp/session/default-title';
|
|
33
37
|
|
|
34
38
|
/** Viewport coordinates the menu hangs off, plus which edge it aligns to. */
|
|
35
39
|
export interface MenuAnchor {
|
|
@@ -85,6 +89,10 @@ export interface SessionActionsMenuProps {
|
|
|
85
89
|
anchor: MenuAnchor;
|
|
86
90
|
/** The row's id; enables "New child session". Absent on a synthetic row. */
|
|
87
91
|
sessionId?: string | number;
|
|
92
|
+
/** The row's harness, so the child dialog starts on the agent that ran it. */
|
|
93
|
+
harness?: string;
|
|
94
|
+
/** The row's folder, so a pending child lands in the right workspace. */
|
|
95
|
+
folderId?: number | string;
|
|
88
96
|
isArchived?: boolean;
|
|
89
97
|
/** Omitted when the row cannot be renamed (a pending `new-…` chat). */
|
|
90
98
|
onRename?: () => void;
|
|
@@ -106,6 +114,8 @@ export interface SessionActionsMenuProps {
|
|
|
106
114
|
export function SessionActionsMenu({
|
|
107
115
|
anchor,
|
|
108
116
|
sessionId,
|
|
117
|
+
harness,
|
|
118
|
+
folderId,
|
|
109
119
|
isArchived = false,
|
|
110
120
|
onRename,
|
|
111
121
|
onRenameWithAi,
|
|
@@ -116,12 +126,37 @@ export function SessionActionsMenu({
|
|
|
116
126
|
}: SessionActionsMenuProps) {
|
|
117
127
|
const menuRef = useRef<HTMLDivElement>(null);
|
|
118
128
|
const [pos, setPos] = useState<{ top: number; left: number } | null>(null);
|
|
119
|
-
const [
|
|
129
|
+
const [, setSearchParams] = useSearchParams();
|
|
120
130
|
const canSpawnChild =
|
|
121
131
|
sessionId !== undefined &&
|
|
122
132
|
!String(sessionId).startsWith('new-') &&
|
|
123
133
|
!isArchived;
|
|
124
134
|
|
|
135
|
+
/**
|
|
136
|
+
* "New child session" opens the SAME pending-chat composer as New Session,
|
|
137
|
+
* with the parent recorded on the row. A modal would have hid the workspace,
|
|
138
|
+
* worktree and parent pickers the composer already owns.
|
|
139
|
+
*/
|
|
140
|
+
const startChildSession = () => {
|
|
141
|
+
if (sessionId === undefined) return;
|
|
142
|
+
const parentId = String(sessionId);
|
|
143
|
+
const pendingId = startPendingSession(folderId ?? null, {
|
|
144
|
+
parentSessionId: parentId,
|
|
145
|
+
...(harness ? { harness } : {}),
|
|
146
|
+
title: formatNewSessionTitle(new Date(), 'New Child'),
|
|
147
|
+
});
|
|
148
|
+
// The picker's first tab is the parent's agent, not omp's default.
|
|
149
|
+
if (harness) setHarnessPick(pendingId, harness);
|
|
150
|
+
expandSessionBranch(parentId);
|
|
151
|
+
setSearchParams((prev) => {
|
|
152
|
+
const next = new URLSearchParams(prev);
|
|
153
|
+
next.set('sessionId', pendingId);
|
|
154
|
+
next.set('parentSessionId', parentId);
|
|
155
|
+
if (folderId !== undefined) next.set('folderId', String(folderId));
|
|
156
|
+
return next;
|
|
157
|
+
}, { replace: true });
|
|
158
|
+
};
|
|
159
|
+
|
|
125
160
|
useLayoutEffect(() => {
|
|
126
161
|
const el = menuRef.current;
|
|
127
162
|
if (!el) return;
|
|
@@ -184,10 +219,7 @@ export function SessionActionsMenu({
|
|
|
184
219
|
<button
|
|
185
220
|
type="button"
|
|
186
221
|
role="menuitem"
|
|
187
|
-
onClick={(
|
|
188
|
-
event.stopPropagation();
|
|
189
|
-
setChildOpen(true);
|
|
190
|
-
}}
|
|
222
|
+
onClick={run(startChildSession)}
|
|
191
223
|
className="w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center gap-2 transition-colors cursor-pointer"
|
|
192
224
|
>
|
|
193
225
|
<GitBranch size={12} className="text-ink/60" />
|
|
@@ -260,12 +292,6 @@ export function SessionActionsMenu({
|
|
|
260
292
|
)}
|
|
261
293
|
</div>
|
|
262
294
|
</div>
|
|
263
|
-
{childOpen && sessionId !== undefined && (
|
|
264
|
-
<NewChildSessionDialog
|
|
265
|
-
parentSessionId={String(sessionId)}
|
|
266
|
-
onClose={() => setChildOpen(false)}
|
|
267
|
-
/>
|
|
268
|
-
)}
|
|
269
295
|
</>,
|
|
270
296
|
document.body,
|
|
271
297
|
);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tree lines in front of one row.
|
|
3
|
+
*
|
|
4
|
+
* One level is as wide as the distance from a row's leading-slot centre to its
|
|
5
|
+
* harness mark centre, so the child row's indicator slot lands exactly under
|
|
6
|
+
* the parent's harness icon. The line itself stays on the parent's chevron
|
|
7
|
+
* column; what separates the two is VERTICAL — the first row of a branch starts
|
|
8
|
+
* its stem `STEM_GAP` below the row (below the chevron ink) instead of running
|
|
9
|
+
* up into the glyph.
|
|
10
|
+
*
|
|
11
|
+
* The strokes are 2px, the chevron's own ink weight, and each segment ABUTS the
|
|
12
|
+
* next instead of overlapping it: a translucent `bg-ink/40` painted twice by
|
|
13
|
+
* overlapping stems read as alternating dark bands ("belang") down a two-child
|
|
14
|
+
* branch. The list's 2px row gap is covered by the segment above (bottom:-2px),
|
|
15
|
+
* and the next row starts at its own top edge, so the line is continuous and
|
|
16
|
+
* one-ply everywhere.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import type { BranchRowStyle } from '@/client/components/common/session-branch/style';
|
|
20
|
+
|
|
21
|
+
export interface BranchGuidesProps {
|
|
22
|
+
/** For each ancestor level, whether THAT ancestor was the last sibling. */
|
|
23
|
+
ancestors: readonly boolean[];
|
|
24
|
+
/** Whether this row is the last sibling at its own level. */
|
|
25
|
+
isLast: boolean;
|
|
26
|
+
/** The first row of the branch: the stem starts below the parent chevron. */
|
|
27
|
+
first: boolean;
|
|
28
|
+
style: BranchRowStyle;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The list's space-y gap, bridged by the segment above. */
|
|
32
|
+
const GAP = 2;
|
|
33
|
+
/** Vertical breathing room between the parent chevron and the stem. */
|
|
34
|
+
const STEM_GAP = 6;
|
|
35
|
+
|
|
36
|
+
export function BranchGuides({ ancestors, isLast, first, style }: BranchGuidesProps) {
|
|
37
|
+
// Where the row's leading slot sits inside its box, and the pitch to its
|
|
38
|
+
// harness mark: the next level's indicator targets that mark's centre.
|
|
39
|
+
const slotCenter = style.insetPx + style.slotWidth / 2;
|
|
40
|
+
const pitch = style.slotWidth / 2 + style.markGap + style.glyph / 2;
|
|
41
|
+
// From the line to the child slot's left edge: the arm crosses the row inset.
|
|
42
|
+
const arm = pitch + style.insetPx - slotCenter;
|
|
43
|
+
// 2px matches the chevron's ink weight; offset by half its width to sit on
|
|
44
|
+
// the icon's exact integer centre.
|
|
45
|
+
const STROKE = 2;
|
|
46
|
+
const line = slotCenter - STROKE / 2;
|
|
47
|
+
|
|
48
|
+
const stem = first
|
|
49
|
+
? isLast
|
|
50
|
+
// From below the chevron to THIS row's centre.
|
|
51
|
+
? { left: line, top: -STEM_GAP, height: `calc(50% + ${STEM_GAP}px)` }
|
|
52
|
+
: { left: line, top: -STEM_GAP, bottom: -GAP }
|
|
53
|
+
: isLast
|
|
54
|
+
? { left: line, top: 0, height: '50%' }
|
|
55
|
+
: { left: line, top: 0, bottom: -GAP };
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
{ancestors.map((ancestorIsLast, level) => (
|
|
60
|
+
<span
|
|
61
|
+
key={level}
|
|
62
|
+
data-guide="ancestor"
|
|
63
|
+
data-continues={ancestorIsLast ? undefined : 'true'}
|
|
64
|
+
aria-hidden="true"
|
|
65
|
+
className="relative shrink-0"
|
|
66
|
+
style={{ width: pitch }}
|
|
67
|
+
>
|
|
68
|
+
{!ancestorIsLast && (
|
|
69
|
+
<span
|
|
70
|
+
className="absolute z-10 bg-ink/40"
|
|
71
|
+
style={{ left: line, top: 0, bottom: -GAP, width: STROKE }}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
</span>
|
|
75
|
+
))}
|
|
76
|
+
<span
|
|
77
|
+
data-guide="connector"
|
|
78
|
+
data-last={isLast ? 'true' : undefined}
|
|
79
|
+
data-first={first ? 'true' : undefined}
|
|
80
|
+
aria-hidden="true"
|
|
81
|
+
className="relative shrink-0"
|
|
82
|
+
style={{ width: pitch }}
|
|
83
|
+
>
|
|
84
|
+
<span className="absolute z-10 bg-ink/40" style={{ width: STROKE, ...stem }} />
|
|
85
|
+
{/* Above the row's background: the arm crosses its inset padding. */}
|
|
86
|
+
<span
|
|
87
|
+
className="absolute z-10 bg-ink/40"
|
|
88
|
+
style={{ left: line, top: 'calc(50% - 1px)', width: arm + 1, height: STROKE }}
|
|
89
|
+
/>
|
|
90
|
+
</span>
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One subagent in a session's branch.
|
|
8
|
+
*
|
|
9
|
+
* A subagent is a leaf: it is a tool call, not a session, and it opens the
|
|
10
|
+
* subagent transcript rather than `/sessions/:id`. The robot mark replaces the
|
|
11
|
+
* harness mark in the same column every session row puts it, and the leading
|
|
12
|
+
* 16px slot is the SHARED slot rule — one glyph there, and for a leaf that
|
|
13
|
+
* glyph is the run state, exactly as a parent row shows a status when it has
|
|
14
|
+
* no branch to disclose.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Bot, Square } from 'lucide-preact';
|
|
18
|
+
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
19
|
+
import { SubagentStatusIcon } from '@/client/components/common/SubagentStatusIcon';
|
|
20
|
+
import type { BranchRowStyle } from '@/client/components/common/session-branch/style';
|
|
21
|
+
import { subagentRowLabel } from '@/shared/lib/omp/subagent/label';
|
|
22
|
+
import { cancelSubagent } from '@/shared/lib/omp/subagent/control';
|
|
23
|
+
import type { SubagentInfo } from '@/shared/types';
|
|
24
|
+
|
|
25
|
+
export interface SubagentRowProps {
|
|
26
|
+
subagent: SubagentInfo;
|
|
27
|
+
/** The session that owns the roster; the view event and cancel address it. */
|
|
28
|
+
sessionId: string;
|
|
29
|
+
style: BranchRowStyle;
|
|
30
|
+
/** A live run this process can stop (and show as pulsing). */
|
|
31
|
+
running: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function SubagentRow({ subagent, sessionId, style, running }: SubagentRowProps) {
|
|
35
|
+
const [searchParams] = useSearchParams();
|
|
36
|
+
const viewed = subagent.id === searchParams.get('subagent');
|
|
37
|
+
const label = subagentRowLabel(subagent);
|
|
38
|
+
const brief = subagent.task ?? subagent.assignment ?? subagent.description ?? label;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div className="group/subagent-row flex items-center">
|
|
42
|
+
<button
|
|
43
|
+
type="button"
|
|
44
|
+
title={brief}
|
|
45
|
+
onClick={() => window.dispatchEvent(
|
|
46
|
+
new CustomEvent('omp:view-subagent', { detail: { sessionId, subagent } }),
|
|
47
|
+
)}
|
|
48
|
+
className={`flex-1 min-w-0 flex items-center text-left text-xs rounded-md ${style.inset} ${style.padding} cursor-pointer transition-colors select-none ${
|
|
49
|
+
viewed ? 'bg-ink/10 font-medium text-ink' : 'text-ink/70 hover:text-ink hover:bg-ink/5'
|
|
50
|
+
}`}
|
|
51
|
+
>
|
|
52
|
+
<span
|
|
53
|
+
data-testid="subagent-status-slot"
|
|
54
|
+
className="w-4 h-4 flex items-center justify-center shrink-0"
|
|
55
|
+
>
|
|
56
|
+
<SubagentStatusIcon status={subagent.status} live={running} size={11} />
|
|
57
|
+
</span>
|
|
58
|
+
<span className="w-2 shrink-0" />
|
|
59
|
+
<span data-testid="subagent-mark" className="mr-1.5 flex shrink-0 items-center text-ink/55">
|
|
60
|
+
<Bot size={style.glyph} aria-hidden="true" />
|
|
61
|
+
</span>
|
|
62
|
+
<span className="flex-1 min-w-0 truncate leading-snug">{label}</span>
|
|
63
|
+
</button>
|
|
64
|
+
{running && (
|
|
65
|
+
<button
|
|
66
|
+
type="button"
|
|
67
|
+
title="Stop this subagent"
|
|
68
|
+
aria-label="Stop this subagent"
|
|
69
|
+
onClick={() => void cancelSubagent(sessionId, subagent.id)}
|
|
70
|
+
className="touch-visible shrink-0 mr-1 w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-error hover:bg-error/5 opacity-0 group-hover/subagent-row:opacity-100 transition-opacity cursor-pointer"
|
|
71
|
+
>
|
|
72
|
+
<Square size={10} />
|
|
73
|
+
</button>
|
|
74
|
+
)}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The branch under ONE session row: its child sessions first, then its
|
|
8
|
+
* subagents, drawn as one tree.
|
|
9
|
+
*
|
|
10
|
+
* A session has exactly one disclosure. Before this, children and the subagent
|
|
11
|
+
* roster were two lists behind two controls (a chevron and a `Boxes` badge),
|
|
12
|
+
* which is why a row could be open in one sense and closed in the other. Now
|
|
13
|
+
* the chevron opens this branch, and the branch is the union of the two.
|
|
14
|
+
*
|
|
15
|
+
* Ordering is the order the lists already had: child sessions (the sidebar's
|
|
16
|
+
* own sort), then the roster (its own batch/index order). A child session can
|
|
17
|
+
* itself have a branch, so the renderer recurses one level per child — the
|
|
18
|
+
* guide cells carry the depth, not a second row style.
|
|
19
|
+
*
|
|
20
|
+
* The chrome owns the row component (classic, modern, mobile), so it supplies
|
|
21
|
+
* `renderSession`; everything below that is shared, including the subagent
|
|
22
|
+
* rows and the tree lines.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { Fragment } from 'preact';
|
|
26
|
+
import type { ComponentChild } from 'preact';
|
|
27
|
+
import { BranchGuides } from '@/client/components/common/session-branch/BranchGuides';
|
|
28
|
+
import { SubagentRow } from '@/client/components/common/session-branch/SubagentRow';
|
|
29
|
+
import type { BranchRowStyle } from '@/client/components/common/session-branch/style';
|
|
30
|
+
import { useSubagentRoster } from '@/client/hooks/chat/subagents/roster';
|
|
31
|
+
import type { SessionItemData } from '@/shared/types';
|
|
32
|
+
|
|
33
|
+
/** What the chrome's row needs to know about its branch. */
|
|
34
|
+
export interface BranchControl {
|
|
35
|
+
/** The row has child sessions, subagents, or both. */
|
|
36
|
+
expandable: boolean;
|
|
37
|
+
isExpanded: boolean;
|
|
38
|
+
onToggleExpand: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* This row is a CHILD session (it is drawn inside a branch). A leaf child
|
|
41
|
+
* has no chevron and no run cue, so its leading slot is otherwise empty; the
|
|
42
|
+
* row draws a child mark there instead of leaving a hole.
|
|
43
|
+
*/
|
|
44
|
+
isChild: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The control a session row gets from its own subtree and the one expansion
|
|
49
|
+
* set. Shared by all three chromes: a row that is expandable in one layout and
|
|
50
|
+
* not in another is the same defect as two different branch lists.
|
|
51
|
+
*/
|
|
52
|
+
export function branchControlFor(
|
|
53
|
+
session: SessionItemData,
|
|
54
|
+
childrenOf: Map<string, SessionItemData[]>,
|
|
55
|
+
expandedIds: ReadonlySet<string>,
|
|
56
|
+
onToggle: (sessionId: string) => void,
|
|
57
|
+
isChild = false,
|
|
58
|
+
): BranchControl {
|
|
59
|
+
const key = String(session.id);
|
|
60
|
+
return {
|
|
61
|
+
expandable: (childrenOf.get(key)?.length ?? 0) > 0 || Boolean(session.hasSubagents),
|
|
62
|
+
isExpanded: expandedIds.has(key),
|
|
63
|
+
onToggleExpand: () => onToggle(key),
|
|
64
|
+
isChild,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface SessionBranchProps {
|
|
69
|
+
/** The session whose branch this is. */
|
|
70
|
+
parentId: string;
|
|
71
|
+
/** That session's own `hasSubagents` flag; false skips the roster read. */
|
|
72
|
+
hasSubagents: boolean;
|
|
73
|
+
childrenOf: Map<string, SessionItemData[]>;
|
|
74
|
+
/** One set for both halves of the branch. */
|
|
75
|
+
expandedIds: ReadonlySet<string>;
|
|
76
|
+
onToggle: (sessionId: string) => void;
|
|
77
|
+
/** The session the URL has open, so its roster can take live frames. */
|
|
78
|
+
activeSessionId: string | null;
|
|
79
|
+
renderSession: (session: SessionItemData, control: BranchControl) => ComponentChild;
|
|
80
|
+
style: BranchRowStyle;
|
|
81
|
+
/** `isLast` of each ancestor row, outermost first. */
|
|
82
|
+
ancestors?: readonly boolean[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function SessionBranch({
|
|
86
|
+
parentId,
|
|
87
|
+
hasSubagents,
|
|
88
|
+
childrenOf,
|
|
89
|
+
expandedIds,
|
|
90
|
+
onToggle,
|
|
91
|
+
activeSessionId,
|
|
92
|
+
renderSession,
|
|
93
|
+
style,
|
|
94
|
+
ancestors = [],
|
|
95
|
+
}: SessionBranchProps) {
|
|
96
|
+
const children = childrenOf.get(parentId) ?? [];
|
|
97
|
+
const { subagents, isLoading } = useSubagentRoster(parentId, activeSessionId === parentId, hasSubagents);
|
|
98
|
+
const rows = [
|
|
99
|
+
...children.map((session) => ({ kind: 'session' as const, session })),
|
|
100
|
+
...subagents.map((subagent) => ({ kind: 'subagent' as const, subagent })),
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
if (rows.length === 0) {
|
|
104
|
+
if (!isLoading) return null;
|
|
105
|
+
return (
|
|
106
|
+
<div data-testid="session-branch" className="space-y-0.5">
|
|
107
|
+
<div className="flex items-stretch">
|
|
108
|
+
<BranchGuides ancestors={ancestors} isLast first style={style} />
|
|
109
|
+
<div className={`flex min-w-0 flex-1 items-center text-xs italic text-ink/40 ${style.inset} ${style.padding}`}>
|
|
110
|
+
Loading subagents…
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<div data-testid="session-branch" className="space-y-0.5">
|
|
119
|
+
{rows.map((row, index) => {
|
|
120
|
+
const isLast = index === rows.length - 1;
|
|
121
|
+
if (row.kind === 'subagent') {
|
|
122
|
+
return (
|
|
123
|
+
<div key={`subagent:${row.subagent.id}`} className="flex items-stretch">
|
|
124
|
+
<BranchGuides ancestors={ancestors} isLast={isLast} first={index === 0} style={style} />
|
|
125
|
+
<div className="min-w-0 flex-1">
|
|
126
|
+
<SubagentRow
|
|
127
|
+
subagent={row.subagent}
|
|
128
|
+
sessionId={parentId}
|
|
129
|
+
style={style}
|
|
130
|
+
running={activeSessionId === parentId && row.subagent.status === 'started'}
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const key = String(row.session.id);
|
|
138
|
+
const childCount = childrenOf.get(key)?.length ?? 0;
|
|
139
|
+
const control: BranchControl = {
|
|
140
|
+
expandable: childCount > 0 || Boolean(row.session.hasSubagents),
|
|
141
|
+
isExpanded: expandedIds.has(key),
|
|
142
|
+
onToggleExpand: () => onToggle(key),
|
|
143
|
+
isChild: true,
|
|
144
|
+
};
|
|
145
|
+
return (
|
|
146
|
+
<Fragment key={key}>
|
|
147
|
+
<div className="flex items-stretch">
|
|
148
|
+
<BranchGuides ancestors={ancestors} isLast={isLast} first={index === 0} style={style} />
|
|
149
|
+
<div className="min-w-0 flex-1">{renderSession(row.session, control)}</div>
|
|
150
|
+
</div>
|
|
151
|
+
{control.isExpanded && (
|
|
152
|
+
<SessionBranch
|
|
153
|
+
parentId={key}
|
|
154
|
+
hasSubagents={Boolean(row.session.hasSubagents)}
|
|
155
|
+
childrenOf={childrenOf}
|
|
156
|
+
expandedIds={expandedIds}
|
|
157
|
+
onToggle={onToggle}
|
|
158
|
+
activeSessionId={activeSessionId}
|
|
159
|
+
renderSession={renderSession}
|
|
160
|
+
style={style}
|
|
161
|
+
ancestors={[...ancestors, isLast]}
|
|
162
|
+
/>
|
|
163
|
+
)}
|
|
164
|
+
</Fragment>
|
|
165
|
+
);
|
|
166
|
+
})}
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
}
|