@kabmo-labs/kabmo 0.24.0 → 0.26.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 +585 -512
- package/dist/client/static/js/{index-jcr5twtp.js → index-95b3n20k.js} +1105 -1207
- package/dist/client/static/js/index-p2yw9ywf.css +1 -0
- package/package.json +2 -4
- package/src/cli/lib/args.js +24 -1
- package/src/cli/lib/args.test.js +16 -0
- package/src/cli/lib/commands/session.js +233 -0
- package/src/cli/lib/commands/session.test.js +103 -0
- package/src/cli/main.js +1 -1
- package/src/client/components/common/ComposerPicker.tsx +3 -0
- package/src/client/components/common/code-surface/shiki.test.ts +82 -0
- package/src/client/components/common/code-surface/shiki.ts +28 -7
- package/src/client/components/common/session-actions-menu/index.tsx +59 -2
- 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 +17 -5
- package/src/client/components/common/session-row/index.tsx +28 -3
- 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/resizer/separator-drag.ts +3 -3
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +70 -61
- 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 +35 -7
- package/src/client/components/layout/session-sidebar/about-modal/HarnessRow.tsx +261 -0
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.tsx +39 -198
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTableLog.test.tsx +114 -0
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogDialog.test.tsx +130 -0
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogDialog.tsx +128 -0
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogLine.tsx +56 -0
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +44 -36
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +62 -47
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +63 -50
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.test.ts +5 -0
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +37 -12
- 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/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/ComposerDock.tsx +64 -70
- package/src/client/components/workspace/chat-timeline/ComposerDockFrame.tsx +35 -0
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +128 -122
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +22 -1
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +11 -5
- package/src/client/components/workspace/chat-timeline/PendingChatView.tsx +10 -0
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +12 -3
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +3 -0
- 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/composer-dock-frame.test.tsx +155 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +11 -20
- package/src/client/components/workspace/chat-timeline/target-picker/DraftTargetRow.tsx +115 -0
- package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +173 -0
- package/src/client/components/workspace/chat-timeline/target-picker/parent-session-options.test.ts +49 -0
- package/src/client/components/workspace/terminal-panel/KeyBar.tsx +10 -8
- package/src/client/components/workspace/terminal-panel/{RealtimeXtermView.tsx → RealtimeTerminalView.tsx} +51 -58
- package/src/client/components/workspace/terminal-panel/fit.test.ts +37 -0
- package/src/client/components/workspace/terminal-panel/fit.ts +64 -0
- package/src/client/components/workspace/terminal-panel/fonts.test.ts +161 -0
- package/src/client/components/workspace/terminal-panel/fonts.ts +164 -0
- package/src/client/components/workspace/terminal-panel/grid.test.ts +52 -0
- package/src/client/components/workspace/terminal-panel/grid.ts +118 -0
- package/src/client/components/workspace/terminal-panel/index.tsx +25 -21
- package/src/client/components/workspace/terminal-panel/mount.ts +247 -223
- package/src/client/components/workspace/terminal-panel/navigation.test.ts +54 -0
- package/src/client/components/workspace/terminal-panel/navigation.ts +47 -0
- package/src/client/data/settings/omp-schema.json +1 -1
- package/src/client/data/theme/terminal.test.ts +25 -0
- package/src/client/data/theme/terminal.ts +96 -79
- package/src/client/hooks/chat/composer/items.test.ts +31 -26
- package/src/client/hooks/chat/composer/pick-mapping.test.ts +42 -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/prompt-send.test.ts +7 -7
- package/src/client/hooks/chat/omp/prompt-send.ts +26 -14
- package/src/client/hooks/chat/omp/run-switch.ts +1 -1
- package/src/client/hooks/chat/omp/session-list.tsx +4 -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-request.test.ts +54 -0
- package/src/client/hooks/chat/timeline/fork-request.ts +43 -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 +205 -0
- package/src/client/hooks/chat/timeline/pending-dispatch.ts +253 -0
- package/src/client/hooks/chat/timeline/prompt-text.test.ts +34 -1
- package/src/client/hooks/chat/timeline/prompt-text.ts +47 -20
- package/src/client/hooks/chat/timeline/send-execute.test.ts +39 -0
- package/src/client/hooks/chat/timeline/send-helpers.ts +30 -1
- package/src/client/hooks/chat/timeline/send-steer.test.ts +3 -1
- package/src/client/hooks/chat/timeline/send.test-util.ts +7 -1
- package/src/client/hooks/chat/timeline/send.test.ts +3 -1
- package/src/client/hooks/chat/timeline/send.ts +48 -133
- 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 +58 -0
- package/src/client/hooks/models/use-harness-update.test.ts +286 -0
- package/src/client/hooks/models/use-harness-update.ts +250 -0
- 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/expanded-sessions.ts +36 -7
- package/src/client/hooks/workspace/terminal/index.ts +17 -3
- package/src/client/hooks/workspace/terminal/socket.ts +9 -4
- 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/session-tree.test.ts +50 -0
- package/src/client/lib/session-tree.ts +59 -0
- package/src/client/lib/signals.ts +5 -1
- package/src/client/main.tsx +6 -0
- package/src/client/tailwind.css +17 -11
- package/src/server/index.ts +2 -0
- package/src/server/lib/auth/guard.ts +10 -0
- package/src/server/lib/btw/session-copy.server.ts +6 -44
- package/src/server/lib/btw/session-copy.test.ts +2 -1
- package/src/server/lib/db/schema.ts +5 -0
- package/src/server/lib/db/seed-terminal.test.ts +1 -1
- package/src/server/lib/db/seed.test.ts +1 -1
- package/src/server/lib/harness/acp/background-work.test.ts +262 -0
- package/src/server/lib/harness/acp/background-work.ts +320 -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 +33 -23
- 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/gateway-env.test.ts +64 -0
- package/src/server/lib/harness/acp/gateway-env.ts +70 -0
- 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/prompt.test.ts +20 -0
- package/src/server/lib/harness/acp/prompt.ts +19 -3
- package/src/server/lib/harness/acp/protocol.ts +41 -2
- package/src/server/lib/harness/acp/session-background.test.ts +129 -0
- package/src/server/lib/harness/acp/session-exit.ts +31 -0
- package/src/server/lib/harness/acp/session-facts.ts +1 -1
- package/src/server/lib/harness/acp/session-handshake.test.ts +197 -0
- package/src/server/lib/harness/acp/session-handshake.ts +110 -7
- package/src/server/lib/harness/acp/session-idle.ts +7 -6
- package/src/server/lib/harness/acp/session-listeners.ts +31 -0
- 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 +89 -0
- package/src/server/lib/harness/acp/session-turns.ts +28 -8
- 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 +42 -2
- package/src/server/lib/harness/acp/session.ts +115 -115
- package/src/server/lib/harness/acp/tool-calls.ts +223 -0
- package/src/server/lib/harness/acp/turn.test.ts +183 -0
- package/src/server/lib/harness/acp/turn.ts +102 -10
- 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 +58 -8
- package/src/server/lib/harness/launch.test.ts +25 -0
- package/src/server/lib/harness/launch.ts +24 -10
- package/src/server/lib/harness/session.ts +3 -0
- package/src/server/lib/harness/spawn.server.ts +15 -2
- package/src/server/lib/harness/update-job-store.test.ts +151 -0
- package/src/server/lib/harness/update-job-store.ts +115 -0
- package/src/server/lib/harness/update-job.server.ts +94 -0
- 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.test.ts +153 -0
- package/src/server/lib/harness/update-worker.ts +202 -0
- package/src/server/lib/lifecycle/after-listen.ts +9 -0
- package/src/server/lib/lifecycle/paths.ts +28 -0
- package/src/server/lib/omp/rpc/manager.ts +5 -5
- package/src/server/lib/omp/rpc/prewarm-pool.ts +12 -3
- package/src/server/lib/omp/rpc/run-settle.server.ts +10 -1
- package/src/server/lib/omp/rpc/session-registry.ts +14 -2
- package/src/server/lib/omp/rpc/subagent-liveness.ts +5 -5
- package/src/server/lib/omp/rpc/terminal-settle.ts +58 -6
- package/src/server/lib/omp/session/delete-flow.server.ts +48 -0
- package/src/server/lib/omp/session/delete.server.ts +5 -0
- package/src/server/lib/omp/session/rewind-file.ts +39 -21
- package/src/server/lib/omp/session/sidebar-data.server.ts +16 -18
- package/src/server/lib/omp/session/transcript-copy.ts +123 -0
- package/src/server/lib/sessions/agent-token.server.test.ts +64 -0
- package/src/server/lib/sessions/agent-token.server.ts +134 -0
- package/src/server/lib/sessions/answers.server.test.ts +33 -0
- package/src/server/lib/sessions/answers.server.ts +37 -0
- package/src/server/lib/sessions/dispatch.server.test.ts +143 -0
- package/src/server/lib/sessions/dispatch.server.ts +128 -0
- package/src/server/lib/sessions/fork.server.test.ts +277 -0
- package/src/server/lib/sessions/fork.server.ts +329 -0
- package/src/server/lib/sessions/lifecycle.server.test.ts +75 -0
- package/src/server/lib/sessions/lifecycle.server.ts +71 -0
- package/src/server/lib/sessions/notify.server.test.ts +112 -0
- package/src/server/lib/sessions/notify.server.ts +212 -0
- package/src/server/lib/sessions/relation-types.ts +76 -0
- package/src/server/lib/sessions/relations.server.test.ts +207 -0
- package/src/server/lib/sessions/relations.server.ts +337 -0
- package/src/server/lib/sessions/resolve.server.ts +106 -0
- package/src/server/lib/sessions/schema.server.ts +82 -0
- package/src/server/lib/sessions/sidebar-relations.server.test.ts +61 -0
- package/src/server/lib/sessions/sidebar-relations.server.ts +47 -0
- package/src/server/lib/sessions/spawn.server.test.ts +237 -0
- package/src/server/lib/sessions/spawn.server.ts +335 -0
- package/src/server/lib/terminal/attach-replay.test.ts +2 -2
- package/src/server/lib/terminal/output.test.ts +2 -2
- package/src/server/lib/terminal/output.ts +1 -1
- package/src/server/lib/terminal/resize.test.ts +99 -0
- package/src/server/lib/terminal/runtime.server.ts +26 -6
- package/src/server/lib/terminal/send-result.test.ts +18 -1
- package/src/server/lib/terminal/send-result.ts +26 -2
- package/src/server/lib/terminal/session.server.ts +6 -6
- package/src/server/lib/usage/new-api.test.ts +92 -0
- package/src/server/lib/usage/new-api.ts +131 -0
- package/src/server/lib/usage/provider-endpoint.test.ts +106 -0
- package/src/server/lib/usage/provider-key.ts +33 -0
- package/src/server/lib/usage/providers.server.ts +10 -3
- package/src/server/lib/usage/vendor-balance.server.ts +4 -53
- package/src/server/lib/usage/vendor-http.ts +41 -0
- package/src/server/lib/usage/window.ts +55 -0
- package/src/server/routes/agent/command.ts +14 -1
- package/src/server/routes/agent/harness-command.ts +12 -5
- package/src/server/routes/agent/new.ts +15 -0
- package/src/server/routes/chat/stream.ts +7 -2
- package/src/server/routes/harness/add-provider.test.ts +9 -1
- package/src/server/routes/harness/import-action.ts +4 -0
- package/src/server/routes/harness/import.test.ts +1 -1
- package/src/server/routes/harness/index.ts +5 -1
- package/src/server/routes/harness/update-status.ts +32 -0
- package/src/server/routes/harness/update.test.ts +156 -0
- package/src/server/routes/harness/update.ts +64 -147
- package/src/server/routes/sessions/answer.ts +24 -0
- package/src/server/routes/sessions/batch-delete.ts +11 -5
- package/src/server/routes/sessions/body-readers.ts +43 -0
- package/src/server/routes/sessions/delete.ts +4 -2
- package/src/server/routes/sessions/fork.ts +89 -0
- package/src/server/routes/sessions/index.ts +14 -0
- package/src/server/routes/sessions/relations.ts +85 -0
- package/src/server/routes/sessions/routes.test.ts +1 -2
- package/src/server/routes/sessions/session.ts +23 -0
- package/src/server/routes/sessions/spawn.ts +137 -0
- package/src/server/routes/terminal/ws.ts +3 -3
- package/src/shared/lib/chat/composer/client.ts +31 -2
- package/src/shared/lib/chat/composer/delegation.test.ts +93 -0
- package/src/shared/lib/chat/composer/delegation.ts +206 -0
- package/src/shared/lib/chat/notice-text.ts +1 -1
- 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/tool/summary-wait.test.ts +11 -0
- package/src/shared/lib/code/ansi.ts +1 -1
- package/src/shared/lib/fonts/nerd-symbols.css +4 -3
- package/src/shared/lib/fonts/nerd-symbols.test.ts +9 -9
- package/src/shared/lib/harness/mode-signal.ts +20 -0
- package/src/shared/lib/harness/provider-facts.test.ts +27 -0
- package/src/shared/lib/harness/providers.ts +35 -1
- package/src/shared/lib/harness/session-modes.ts +24 -0
- package/src/shared/lib/harness/update-job.ts +80 -0
- package/src/shared/lib/harness/update-plan.test.ts +21 -6
- package/src/shared/lib/harness/update-plan.ts +12 -4
- 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/omp/session/wait-idle.test.ts +11 -0
- package/src/shared/lib/omp/session/wait-idle.ts +12 -2
- package/src/shared/lib/settings/defaults.ts +3 -0
- package/src/shared/lib/theme/catalog.test.ts +13 -9
- package/src/shared/lib/theme/color.test.ts +2 -2
- package/src/shared/lib/theme/color.ts +4 -4
- package/src/shared/lib/theme/theme.test.ts +1 -1
- package/src/shared/lib/workspace/terminal/input.test.ts +27 -0
- package/src/shared/lib/workspace/terminal/input.ts +33 -0
- package/src/shared/lib/workspace/terminal/keys.test.ts +1 -1
- package/src/shared/lib/workspace/terminal/keys.ts +7 -7
- package/src/shared/types/chat.ts +1 -1
- package/src/shared/types/harness-update.ts +89 -0
- package/src/shared/types/omp/agent.ts +19 -2
- package/src/shared/types/realtime.ts +2 -0
- package/src/shared/types/settings/state.ts +10 -0
- package/src/shared/types/workspace.ts +8 -0
- package/src/test-support/fake-omp-fork.ts +16 -2
- package/src/test-support/harness-table.test-util.ts +31 -1
- package/dist/client/static/js/index-z3w7n85q.css +0 -1
- package/src/client/components/common/subagent-list/index.tsx +0 -165
- package/src/client/components/workspace/terminal-panel/webgl.test.ts +0 -75
- package/src/client/components/workspace/terminal-panel/webgl.ts +0 -108
|
@@ -50,12 +50,25 @@ import { useSessionRenaming } from '@/client/hooks/workspace/renaming-sessions';
|
|
|
50
50
|
import { SessionActionsMenu, useRowMenu } from '@/client/components/common/session-actions-menu';
|
|
51
51
|
import { StatusSlot } from '@/client/components/common/session-row/StatusSlot';
|
|
52
52
|
import { HarnessGlyph, HARNESS_GLYPH_SIZE } from '@/client/components/common/harness-glyph';
|
|
53
|
+
import type { BranchRowStyle } from '@/client/components/common/session-branch/style';
|
|
53
54
|
import { TrailingSlot } from '@/client/components/common/session-row/TrailingSlot';
|
|
54
55
|
import { WorktreeBadge } from '@/client/components/layout/session-sidebar/WorktreeBadge';
|
|
55
56
|
import type { SessionWorktreeInfo } from '@/shared/lib/workspace/worktree/types';
|
|
56
57
|
|
|
57
58
|
export type SessionRowDensity = 'compact' | 'touch';
|
|
58
59
|
|
|
60
|
+
/** What a subagent row under this chrome's rows borrows from it. */
|
|
61
|
+
export function sessionRowBranchStyle(touch: boolean): BranchRowStyle {
|
|
62
|
+
return {
|
|
63
|
+
inset: 'pl-1 pr-1',
|
|
64
|
+
insetPx: 4,
|
|
65
|
+
slotWidth: touch ? 18 : 16,
|
|
66
|
+
markGap: 8,
|
|
67
|
+
padding: touch ? 'py-0.5' : 'py-[7px]',
|
|
68
|
+
glyph: touch ? HARNESS_GLYPH_SIZE.touch : HARNESS_GLYPH_SIZE.compact,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
59
72
|
export interface SessionRowProps {
|
|
60
73
|
sessionId: string | number;
|
|
61
74
|
title: string;
|
|
@@ -70,9 +83,15 @@ export interface SessionRowProps {
|
|
|
70
83
|
worktree?: SessionWorktreeInfo;
|
|
71
84
|
/** The row's prompt is held until another session finishes. */
|
|
72
85
|
waitingFor?: { title: string | null };
|
|
73
|
-
|
|
86
|
+
/** Whether this row can expand its branch (child sessions and subagents). */
|
|
87
|
+
expandable?: boolean;
|
|
74
88
|
isExpanded?: boolean;
|
|
75
89
|
onToggleExpand?: (event: TargetedMouseEvent<HTMLElement>) => void;
|
|
90
|
+
/** Drawn inside a parent's branch; a leaf child gets a child mark in its slot. */
|
|
91
|
+
isChild?: boolean;
|
|
92
|
+
/** The folder the row belongs to, so a child spawned from its menu lands in
|
|
93
|
+
* the right list before the server answers. */
|
|
94
|
+
folderId?: number | string;
|
|
76
95
|
onClick?: () => void;
|
|
77
96
|
onRename?: (name: string) => void;
|
|
78
97
|
onRenameWithAi?: () => void;
|
|
@@ -97,9 +116,11 @@ export function SessionRow({
|
|
|
97
116
|
timeAgo,
|
|
98
117
|
worktree,
|
|
99
118
|
waitingFor,
|
|
100
|
-
|
|
119
|
+
expandable = false,
|
|
101
120
|
isExpanded = false,
|
|
102
121
|
onToggleExpand,
|
|
122
|
+
isChild = false,
|
|
123
|
+
folderId,
|
|
103
124
|
onClick,
|
|
104
125
|
onRename,
|
|
105
126
|
onRenameWithAi,
|
|
@@ -176,9 +197,10 @@ export function SessionRow({
|
|
|
176
197
|
awaitingInput={awaitingInput}
|
|
177
198
|
renaming={renaming}
|
|
178
199
|
waitingFor={waitingFor}
|
|
179
|
-
expandable={
|
|
200
|
+
expandable={expandable}
|
|
180
201
|
isExpanded={isExpanded}
|
|
181
202
|
onToggleExpand={onToggleExpand}
|
|
203
|
+
child={isChild}
|
|
182
204
|
selectable={selectable}
|
|
183
205
|
selected={selected}
|
|
184
206
|
onToggleSelect={onToggleSelect}
|
|
@@ -218,6 +240,9 @@ export function SessionRow({
|
|
|
218
240
|
{menu.anchor && (
|
|
219
241
|
<SessionActionsMenu
|
|
220
242
|
anchor={menu.anchor}
|
|
243
|
+
sessionId={sessionId}
|
|
244
|
+
{...(harness ? { harness } : {})}
|
|
245
|
+
{...(folderId !== undefined ? { folderId } : {})}
|
|
221
246
|
isArchived={isArchived}
|
|
222
247
|
onRename={onRename ? startRename : undefined}
|
|
223
248
|
onRenameWithAi={onRenameWithAi}
|
|
@@ -107,6 +107,17 @@ describe('modern session row', () => {
|
|
|
107
107
|
expect(el.querySelector('[role="status"]')?.getAttribute('aria-label')).toBe('Generating a name…');
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
+
test('a leaf child fills its empty slot with the child mark', async () => {
|
|
111
|
+
const el = await mount({ isChild: true });
|
|
112
|
+
expect(el.querySelector('[data-testid="child-indicator"] svg')).not.toBeNull();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('a child with a branch keeps the chevron, not the mark', async () => {
|
|
116
|
+
const el = await mount({ isChild: true, expandable: true, onToggleExpand: () => {} });
|
|
117
|
+
expect(el.querySelector('[data-testid="child-indicator"]')).toBeNull();
|
|
118
|
+
expect(el.querySelector('button[aria-expanded]')).not.toBeNull();
|
|
119
|
+
});
|
|
120
|
+
|
|
110
121
|
test('the actions trigger is drawn and named, and is not hidden from the keyboard', async () => {
|
|
111
122
|
const el = await mount({ onRename: () => {} });
|
|
112
123
|
const trigger = el.querySelector('[aria-label="Session actions"]');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
|
|
2
2
|
import type { ReactNode } from 'preact/compat';
|
|
3
3
|
import { flushSession, loadSession, migrateSessionState, recordSessionOpen } from '@/shared/lib/workspace/session-state/store';
|
|
4
|
-
import { consumeAdoption } from '@/client/hooks/chat/omp/pending-
|
|
4
|
+
import { consumeAdoption } from '@/client/hooks/chat/omp/pending-adoption';
|
|
5
5
|
import { SessionStateContext } from '@/client/hooks/workspace/session-state/context';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -18,9 +18,9 @@ export interface SeparatorDrag {
|
|
|
18
18
|
*
|
|
19
19
|
* A ghost guide line follows the pointer, and the real width is re-applied at
|
|
20
20
|
* most every `RESIZE_FOLLOW_INTERVAL_MS`. Applying it on every pointermove
|
|
21
|
-
* re-renders both panels per frame and reflows whatever they contain —
|
|
22
|
-
* buffer, a CodeMirror document, a browser iframe — for a width the
|
|
23
|
-
* still choosing. The panel's own width transition smooths the steps that land.
|
|
21
|
+
* re-renders both panels per frame and reflows whatever they contain — a
|
|
22
|
+
* terminal buffer, a CodeMirror document, a browser iframe — for a width the
|
|
23
|
+
* user is still choosing. The panel's own width transition smooths the steps that land.
|
|
24
24
|
*
|
|
25
25
|
* Kept out of `index.tsx` so the components stay inside the repo's file-size
|
|
26
26
|
* ceiling.
|
|
@@ -6,15 +6,18 @@ import { useShowMore } from '@/client/hooks/ui/show-more';
|
|
|
6
6
|
import { useWorkspaceFolderActions } from '@/client/hooks/workspace/workspace-folder-actions';
|
|
7
7
|
import { useSessionDelete } from '@/client/hooks/workspace/session-delete';
|
|
8
8
|
import { SessionDeleteModal } from '@/client/components/common/session-delete-modal';
|
|
9
|
-
import { SessionItem } from '@/client/components/layout/session-sidebar/SessionItem';
|
|
9
|
+
import { SessionItem, SESSION_ITEM_BRANCH_STYLE } from '@/client/components/layout/session-sidebar/SessionItem';
|
|
10
10
|
import { CategoryHeader } from '@/client/components/layout/session-sidebar/CategoryHeader';
|
|
11
|
-
import {
|
|
11
|
+
import { SessionBranch, branchControlFor } from '@/client/components/common/session-branch';
|
|
12
|
+
import type { BranchControl } from '@/client/components/common/session-branch';
|
|
13
|
+
import { buildSessionTree } from '@/client/lib/session-tree';
|
|
12
14
|
import { useExpandedSessions } from '@/client/hooks/workspace/expanded-sessions';
|
|
13
15
|
import { relativeTimeAgo } from '@/shared/lib/workspace/relative-time';
|
|
16
|
+
import { isPendingSessionId } from '@/shared/lib/omp/session/default-title';
|
|
14
17
|
import { useSidebarData } from '@/client/hooks/chat/omp/session-list';
|
|
15
18
|
import type { BatchBinding } from '@/client/components/common/batch-selection/types';
|
|
16
19
|
import { folderBatchState } from '@/client/components/common/batch-selection/folder-state';
|
|
17
|
-
import type { WorkspaceFolderData } from '@/shared/types';
|
|
20
|
+
import type { SessionItemData, WorkspaceFolderData } from '@/shared/types';
|
|
18
21
|
|
|
19
22
|
export { SessionItem };
|
|
20
23
|
|
|
@@ -55,8 +58,8 @@ export function Category({
|
|
|
55
58
|
const urlSubagentId = searchParams.get('subagent');
|
|
56
59
|
const urlSessionId = searchParams.get('sessionId');
|
|
57
60
|
|
|
58
|
-
//
|
|
59
|
-
//
|
|
61
|
+
// ONE expansion set for the whole branch: child sessions and the subagent
|
|
62
|
+
// roster are the same disclosure now, so they cannot disagree.
|
|
60
63
|
const { expandedSessionIds, toggleSession } = useExpandedSessions();
|
|
61
64
|
|
|
62
65
|
useEffect(() => {
|
|
@@ -100,10 +103,6 @@ export function Category({
|
|
|
100
103
|
);
|
|
101
104
|
};
|
|
102
105
|
|
|
103
|
-
const handleToggleSessionExpand = (sessionId: string) => {
|
|
104
|
-
toggleSession(sessionId);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
106
|
const onPin = () => {
|
|
108
107
|
handlePin();
|
|
109
108
|
setShowMenu(false);
|
|
@@ -148,12 +147,60 @@ export function Category({
|
|
|
148
147
|
activeSessionId,
|
|
149
148
|
sessionStatus,
|
|
150
149
|
});
|
|
150
|
+
const tree = buildSessionTree(renderedSessions);
|
|
151
151
|
// A session selection opens every folder: a checkbox on a collapsed workspace
|
|
152
152
|
// would let the user select rows they cannot see or unselect. The WORKSPACE
|
|
153
153
|
// mode leaves the expansion alone — it selects folders, not rows.
|
|
154
154
|
const listOpen = isActuallyOpen || sessionCheckboxes;
|
|
155
155
|
const hasMore = hiddenCount > 0;
|
|
156
156
|
|
|
157
|
+
// One row renderer for roots and for every descendant: a child session is
|
|
158
|
+
// the same row as a root, so a rule fixed on one is fixed on both.
|
|
159
|
+
const renderSessionRow = (session: SessionItemData, control: BranchControl) => {
|
|
160
|
+
const sessionKey = String(session.id);
|
|
161
|
+
const isActive = activeSessionId !== null
|
|
162
|
+
? String(activeSessionId) === sessionKey
|
|
163
|
+
: session.is_active === 1;
|
|
164
|
+
// While one of its subagents is being viewed, the row dims so the
|
|
165
|
+
// highlighted leaf reads as the active one.
|
|
166
|
+
const isViewingSubagent = isActive && urlSessionId === sessionKey && Boolean(urlSubagentId);
|
|
167
|
+
const pending = isPendingSessionId(sessionKey);
|
|
168
|
+
return (
|
|
169
|
+
<SessionItem
|
|
170
|
+
sessionId={session.id}
|
|
171
|
+
title={session.title}
|
|
172
|
+
harness={session.harness}
|
|
173
|
+
folderId={session.folder_id}
|
|
174
|
+
isActive={isActive && !isViewingSubagent}
|
|
175
|
+
isArchived={session.is_archived === 1}
|
|
176
|
+
status={sessionStatus[sessionKey]}
|
|
177
|
+
awaitingInput={Boolean(session.awaitingInput)}
|
|
178
|
+
worktree={session.worktree}
|
|
179
|
+
timeAgo={relativeTimeAgo(session.updated_at ?? session.created_at)}
|
|
180
|
+
onClick={() => onSelectSession(session.id)}
|
|
181
|
+
onArchive={() => handleArchive(session)}
|
|
182
|
+
// A pending `new-…` chat has no transcript anywhere yet — there is
|
|
183
|
+
// nothing to delete, and the server refuses it.
|
|
184
|
+
onDelete={pending ? undefined : () => sessionDelete.requestDelete(session)}
|
|
185
|
+
onRename={pending ? undefined : (name) => void handleRename(session, name)}
|
|
186
|
+
onRenameWithAi={pending ? undefined : () => void handleRenameWithAi(session)}
|
|
187
|
+
expandable={control.expandable} isChild={control.isChild}
|
|
188
|
+
isExpanded={control.isExpanded}
|
|
189
|
+
onToggleExpand={control.onToggleExpand}
|
|
190
|
+
waitingFor={session.waitingFor ? { title: session.waitingFor.title } : undefined}
|
|
191
|
+
onCancelWait={
|
|
192
|
+
session.waitingFor ? () => onCancelWait?.(session.waitingFor!.waitId) : undefined
|
|
193
|
+
}
|
|
194
|
+
selectable={sessionCheckboxes}
|
|
195
|
+
selected={Boolean(batch?.selected.includes(sessionKey))}
|
|
196
|
+
onToggleSelect={batch ? () => batch.toggle(sessionKey) : undefined}
|
|
197
|
+
/>
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const controlFor = (session: SessionItemData): BranchControl =>
|
|
202
|
+
branchControlFor(session, tree.childrenOf, expandedSessionIds, toggleSession);
|
|
203
|
+
|
|
157
204
|
return (
|
|
158
205
|
<div className="space-y-1">
|
|
159
206
|
<CategoryHeader
|
|
@@ -192,61 +239,23 @@ export function Category({
|
|
|
192
239
|
{/* Sessions List */}
|
|
193
240
|
{listOpen && (
|
|
194
241
|
<div className="space-y-0.5">
|
|
195
|
-
{
|
|
242
|
+
{tree.roots.map((session) => {
|
|
196
243
|
const sessionKey = String(session.id);
|
|
197
|
-
const
|
|
198
|
-
? String(activeSessionId) === sessionKey
|
|
199
|
-
: session.is_active === 1;
|
|
200
|
-
// While one of its subagents is being viewed, the parent session
|
|
201
|
-
// row dims so the highlighted roster entry reads as the active one.
|
|
202
|
-
const isViewingSubagent = isActive && urlSessionId === sessionKey && Boolean(urlSubagentId);
|
|
203
|
-
const canExpandActive = activeSessionId !== null && sessionKey === String(activeSessionId);
|
|
204
|
-
// Chevron gate comes straight from the omp-side loader flag
|
|
205
|
-
// (disk scan + transcript recovery); the client never overrides it.
|
|
206
|
-
const hasSubagents = Boolean(session.hasSubagents);
|
|
207
|
-
const isExpanded = hasSubagents && expandedSessionIds.has(sessionKey);
|
|
208
|
-
|
|
244
|
+
const control = controlFor(session);
|
|
209
245
|
return (
|
|
210
246
|
<div key={session.id} className="space-y-0.5">
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
onDelete={
|
|
224
|
-
// A pending `new-…` chat has no transcript anywhere yet —
|
|
225
|
-
// there is nothing to delete, and the server refuses it.
|
|
226
|
-
String(session.id).startsWith('new-')
|
|
227
|
-
? undefined
|
|
228
|
-
: () => sessionDelete.requestDelete(session)
|
|
229
|
-
}
|
|
230
|
-
onRename={String(session.id).startsWith('new-') ? undefined : (name) => void handleRename(session, name)}
|
|
231
|
-
onRenameWithAi={
|
|
232
|
-
String(session.id).startsWith('new-') ? undefined : () => void handleRenameWithAi(session)
|
|
233
|
-
}
|
|
234
|
-
expandable={hasSubagents}
|
|
235
|
-
hasSubagents={hasSubagents}
|
|
236
|
-
isExpanded={isExpanded}
|
|
237
|
-
onToggleExpand={() => handleToggleSessionExpand(sessionKey)}
|
|
238
|
-
waitingFor={session.waitingFor ? { title: session.waitingFor.title } : undefined}
|
|
239
|
-
onCancelWait={
|
|
240
|
-
session.waitingFor
|
|
241
|
-
? () => onCancelWait?.(session.waitingFor!.waitId)
|
|
242
|
-
: undefined
|
|
243
|
-
}
|
|
244
|
-
selectable={sessionCheckboxes}
|
|
245
|
-
selected={Boolean(batch?.selected.includes(sessionKey))}
|
|
246
|
-
onToggleSelect={batch ? () => batch.toggle(sessionKey) : undefined}
|
|
247
|
-
/>
|
|
248
|
-
{hasSubagents && isExpanded && (
|
|
249
|
-
<SubagentList sessionId={session.id} isActiveSession={canExpandActive} />
|
|
247
|
+
{renderSessionRow(session, control)}
|
|
248
|
+
{control.isExpanded && (
|
|
249
|
+
<SessionBranch
|
|
250
|
+
parentId={sessionKey}
|
|
251
|
+
hasSubagents={Boolean(session.hasSubagents)}
|
|
252
|
+
childrenOf={tree.childrenOf}
|
|
253
|
+
expandedIds={expandedSessionIds}
|
|
254
|
+
onToggle={toggleSession}
|
|
255
|
+
activeSessionId={activeSessionId === null ? null : String(activeSessionId)}
|
|
256
|
+
renderSession={renderSessionRow}
|
|
257
|
+
style={SESSION_ITEM_BRANCH_STYLE}
|
|
258
|
+
/>
|
|
250
259
|
)}
|
|
251
260
|
</div>
|
|
252
261
|
);
|
|
@@ -153,10 +153,10 @@ describe('mobile row batch mode', () => {
|
|
|
153
153
|
expect(calls.select).toBe(0);
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
test('hides the row actions and the
|
|
157
|
-
const { el } = await mountMobile({ selectable: true,
|
|
156
|
+
test('hides the row actions and the branch chevron in select mode', async () => {
|
|
157
|
+
const { el } = await mountMobile({ selectable: true, expandable: true, onToggleExpand: () => {} });
|
|
158
158
|
expect(el.querySelector('button[aria-label="Session actions"]')).toBeNull();
|
|
159
|
-
expect(el.querySelector('button[aria-label*="subagents"]')).toBeNull();
|
|
159
|
+
expect(el.querySelector('button[aria-label*="sessions and subagents"]')).toBeNull();
|
|
160
160
|
expect(checkbox(el)?.getAttribute('aria-label')).toBe('Select hello world');
|
|
161
161
|
});
|
|
162
162
|
});
|
|
@@ -68,6 +68,30 @@ function renameCue(el: HTMLElement): Element | null {
|
|
|
68
68
|
return el.querySelector('[role="status"]');
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
describe('child session mark', () => {
|
|
72
|
+
test('a leaf child fills the empty slot with the child mark', async () => {
|
|
73
|
+
const el = await mount({ isChild: true });
|
|
74
|
+
expect(el.querySelector('[data-testid="child-indicator"] svg')).not.toBeNull();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('a child with a branch keeps its chevron instead', async () => {
|
|
78
|
+
const el = await mount({ isChild: true, expandable: true, onToggleExpand: () => {} });
|
|
79
|
+
expect(el.querySelector('[data-testid="child-indicator"]')).toBeNull();
|
|
80
|
+
expect(el.querySelector('button[aria-expanded]')).not.toBeNull();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('a running child shows the run cue, not the mark', async () => {
|
|
84
|
+
const el = await mount({ isChild: true, status: 'stream' });
|
|
85
|
+
expect(el.querySelector('[data-testid="child-indicator"]')).toBeNull();
|
|
86
|
+
expect(el.querySelector('[role="status"]')?.getAttribute('aria-label')).toBe('Running');
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test('a root row draws no child mark', async () => {
|
|
90
|
+
const el = await mount();
|
|
91
|
+
expect(el.querySelector('[data-testid="child-indicator"]')).toBeNull();
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
71
95
|
describe('desktop session row rename cue', () => {
|
|
72
96
|
test('draws a labelled spinner while the rename is in flight', async () => {
|
|
73
97
|
setSessionRenaming('s1', true);
|
|
@@ -82,10 +106,9 @@ describe('desktop session row rename cue', () => {
|
|
|
82
106
|
expect(renameCue(el)).toBeNull();
|
|
83
107
|
});
|
|
84
108
|
|
|
85
|
-
test('takes the slot from
|
|
109
|
+
test('takes the slot from the branch chevron, which is hidden until hover', async () => {
|
|
86
110
|
setSessionRenaming('s1', true);
|
|
87
111
|
const el = await mount({
|
|
88
|
-
hasSubagents: true,
|
|
89
112
|
expandable: true,
|
|
90
113
|
onToggleExpand: () => {},
|
|
91
114
|
});
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import type { TargetedMouseEvent } from 'preact';
|
|
2
|
-
import { Check, ChevronDown, ChevronRight, CircleQuestionMark, Hourglass, Loader2, MoreHorizontal } from 'lucide-preact';
|
|
2
|
+
import { Check, ChevronDown, ChevronRight, CircleQuestionMark, GitBranch, Hourglass, Loader2, MoreHorizontal } from 'lucide-preact';
|
|
3
3
|
import { useInlineRename } from '@/client/hooks/ui/inline-rename';
|
|
4
4
|
import { useSessionRenaming } from '@/client/hooks/workspace/renaming-sessions';
|
|
5
5
|
import { SessionActionsMenu, useRowMenu } from '@/client/components/common/session-actions-menu';
|
|
6
6
|
import { SelectionCheckbox } from '@/client/components/common/batch-selection/SelectionCheckbox';
|
|
7
7
|
import { HarnessGlyph, HARNESS_GLYPH_SIZE } from '@/client/components/common/harness-glyph';
|
|
8
|
+
import type { BranchRowStyle } from '@/client/components/common/session-branch/style';
|
|
8
9
|
import { WorktreeBadge } from '@/client/components/layout/session-sidebar/WorktreeBadge';
|
|
9
10
|
import type { SessionWorktreeInfo } from '@/shared/lib/workspace/worktree/types';
|
|
10
11
|
|
|
12
|
+
/** What a subagent row under this chrome's rows borrows from it. */
|
|
13
|
+
export const SESSION_ITEM_BRANCH_STYLE: BranchRowStyle = {
|
|
14
|
+
inset: 'px-2',
|
|
15
|
+
insetPx: 8,
|
|
16
|
+
slotWidth: 16,
|
|
17
|
+
markGap: 8,
|
|
18
|
+
padding: 'py-1.5',
|
|
19
|
+
glyph: HARNESS_GLYPH_SIZE.compact,
|
|
20
|
+
};
|
|
21
|
+
|
|
11
22
|
export interface SessionItemProps {
|
|
12
23
|
/** The session this row draws; the key its in-flight rename is tracked under. */
|
|
13
24
|
sessionId: string | number;
|
|
@@ -34,8 +45,12 @@ export interface SessionItemProps {
|
|
|
34
45
|
onRenameWithAi?: () => void;
|
|
35
46
|
expandable?: boolean;
|
|
36
47
|
isExpanded?: boolean;
|
|
37
|
-
hasSubagents?: boolean;
|
|
38
48
|
onToggleExpand?: (e: TargetedMouseEvent<HTMLElement>) => void;
|
|
49
|
+
/** Drawn inside a parent's branch; a leaf child gets a child mark in its slot. */
|
|
50
|
+
isChild?: boolean;
|
|
51
|
+
/** The folder the row belongs to, so a child spawned from its menu lands in
|
|
52
|
+
* the right list before the server answers. */
|
|
53
|
+
folderId?: number | string;
|
|
39
54
|
/**
|
|
40
55
|
* The row's prompt is held until another session finishes. A pending row has
|
|
41
56
|
* no transcript and no omp id, so this cue is the only thing on screen saying
|
|
@@ -72,8 +87,9 @@ export function SessionItem({
|
|
|
72
87
|
onRenameWithAi,
|
|
73
88
|
expandable = false,
|
|
74
89
|
isExpanded = false,
|
|
75
|
-
hasSubagents = false,
|
|
76
90
|
onToggleExpand,
|
|
91
|
+
isChild = false,
|
|
92
|
+
folderId,
|
|
77
93
|
waitingFor,
|
|
78
94
|
onCancelWait,
|
|
79
95
|
worktree,
|
|
@@ -86,12 +102,12 @@ export function SessionItem({
|
|
|
86
102
|
// outranks the run cue: the server refuses a rename mid-run, so the two can
|
|
87
103
|
// only overlap for the instant the refusal is in flight.
|
|
88
104
|
const renaming = useSessionRenaming(sessionId);
|
|
89
|
-
const showChevron = Boolean(expandable &&
|
|
105
|
+
const showChevron = Boolean(expandable && onToggleExpand);
|
|
90
106
|
// The slot shows one glyph, never two side by side. A live run signal owns
|
|
91
107
|
// it at rest — the spinner, or the blocked-on-a-question cue, which says it
|
|
92
108
|
// is YOUR turn. With nothing live to report the chevron is PINNED, collapsed
|
|
93
109
|
// or expanded: it is the only affordance left worth showing, and making it
|
|
94
|
-
// hover-only would leave the
|
|
110
|
+
// hover-only would leave the branch reachable only by hovering exactly the
|
|
95
111
|
// right 16px.
|
|
96
112
|
const waiting = Boolean(waitingFor);
|
|
97
113
|
const liveRun = awaitingInput || status === 'stream' || waiting;
|
|
@@ -144,7 +160,7 @@ export function SessionItem({
|
|
|
144
160
|
{/* One 16px slot owns both icons — never two side by side. A live run
|
|
145
161
|
signal (blocked question, run spinner) holds the slot; otherwise the
|
|
146
162
|
chevron is pinned, collapsed or expanded. While the signal holds it,
|
|
147
|
-
hovering hands the slot to the chevron so the
|
|
163
|
+
hovering hands the slot to the chevron so the branch stays reachable
|
|
148
164
|
mid-run.
|
|
149
165
|
Both layers are pointer-inert for the opposite state: the toggle
|
|
150
166
|
while hidden, the status glyph ALWAYS (it is painted after the
|
|
@@ -159,7 +175,7 @@ export function SessionItem({
|
|
|
159
175
|
e.stopPropagation();
|
|
160
176
|
onToggleExpand(e);
|
|
161
177
|
}}
|
|
162
|
-
title={isExpanded ? 'Collapse subagents' : 'Expand subagents'}
|
|
178
|
+
title={isExpanded ? 'Collapse sessions and subagents' : 'Expand sessions and subagents'}
|
|
163
179
|
aria-expanded={isExpanded}
|
|
164
180
|
className={`peer absolute inset-0 flex items-center justify-center rounded cursor-pointer transition-opacity ${
|
|
165
181
|
chevronPinned
|
|
@@ -206,6 +222,15 @@ export function SessionItem({
|
|
|
206
222
|
)}
|
|
207
223
|
</span>
|
|
208
224
|
)}
|
|
225
|
+
{isChild && !showChevron && !showStatus && (
|
|
226
|
+
<span
|
|
227
|
+
data-testid="child-indicator"
|
|
228
|
+
aria-hidden="true"
|
|
229
|
+
className="pointer-events-none absolute inset-0 flex items-center justify-center text-ink/35"
|
|
230
|
+
>
|
|
231
|
+
<GitBranch size={12} aria-hidden="true" />
|
|
232
|
+
</span>
|
|
233
|
+
)}
|
|
209
234
|
</span>
|
|
210
235
|
|
|
211
236
|
{/* Gap between icon and text */}
|
|
@@ -290,6 +315,9 @@ export function SessionItem({
|
|
|
290
315
|
{menu.anchor && (
|
|
291
316
|
<SessionActionsMenu
|
|
292
317
|
anchor={menu.anchor}
|
|
318
|
+
sessionId={sessionId}
|
|
319
|
+
{...(harness ? { harness } : {})}
|
|
320
|
+
{...(folderId !== undefined ? { folderId } : {})}
|
|
293
321
|
isArchived={isArchived}
|
|
294
322
|
onRename={onRename ? startRename : undefined}
|
|
295
323
|
onRenameWithAi={onRenameWithAi}
|