zidane-ui 9.2.2 → 9.3.1
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/adapters/browser-keybindings-host.js +3 -1
- package/dist/adapters/live.d.ts +6 -0
- package/dist/adapters/live.js +16 -8
- package/dist/adapters/server-composer-host.js +22 -9
- package/dist/adapters/server-host.js +143 -18
- package/dist/adapters/server-media.d.ts +9 -1
- package/dist/adapters/server-media.js +14 -1
- package/dist/adapters/server-settings-host.js +30 -3
- package/dist/adapters/server-settings-sections.js +23 -1
- package/dist/adapters/server-sidebar-host.d.ts +3 -1
- package/dist/adapters/server-sidebar-host.js +10 -1
- package/dist/app/ModalProvider.js +1 -1
- package/dist/approvals/ApprovalShell.js +1 -1
- package/dist/chat/DaemonOrb.d.ts +29 -1
- package/dist/chat/DaemonOrb.js +25 -12
- package/dist/chat/HostTranscript.d.ts +0 -12
- package/dist/chat/HostTranscript.js +6 -1
- package/dist/chat/SessionStreamsProvider.d.ts +8 -0
- package/dist/chat/SessionStreamsProvider.js +11 -2
- package/dist/chat/StatusDot.js +8 -2
- package/dist/chat/Transcript.d.ts +20 -11
- package/dist/chat/Transcript.js +335 -162
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/headless/host.d.ts +43 -7
- package/dist/chat/headless/index.d.ts +8 -6
- package/dist/chat/headless/index.js +11 -9
- package/dist/chat/headless/labels.d.ts +30 -0
- package/dist/chat/headless/labels.js +29 -0
- package/dist/chat/headless/markdown-chunks.d.ts +2 -1
- package/dist/chat/headless/markdown-chunks.js +12 -20
- package/dist/chat/headless/markdown-scan.d.ts +66 -0
- package/dist/chat/headless/markdown-scan.js +124 -0
- package/dist/chat/headless/markdown-stream.d.ts +64 -0
- package/dist/chat/headless/markdown-stream.js +143 -0
- package/dist/chat/headless/output-pager.d.ts +68 -0
- package/dist/chat/headless/output-pager.js +113 -0
- package/dist/chat/headless/session-list.d.ts +20 -0
- package/dist/chat/headless/sidebar/activity.d.ts +14 -0
- package/dist/chat/headless/sidebar/activity.js +32 -0
- package/dist/chat/headless/sidebar/directory.d.ts +17 -2
- package/dist/chat/headless/sidebar/directory.js +50 -54
- package/dist/chat/headless/sidebar/environment.d.ts +5 -2
- package/dist/chat/headless/sidebar/environment.js +11 -2
- package/dist/chat/headless/sidebar/host.d.ts +15 -0
- package/dist/chat/headless/sidebar/inbox.d.ts +12 -3
- package/dist/chat/headless/sidebar/inbox.js +18 -9
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/index.js +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +38 -2
- package/dist/chat/headless/sidebar/labels.js +16 -0
- package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
- package/dist/chat/headless/sidebar/prewarm.js +114 -0
- package/dist/chat/headless/streams/actions.d.ts +2 -0
- package/dist/chat/headless/streams/actions.js +1 -0
- package/dist/chat/headless/streams/event-bytes.d.ts +6 -0
- package/dist/chat/headless/streams/event-bytes.js +34 -0
- package/dist/chat/headless/streams/live-events.d.ts +25 -1
- package/dist/chat/headless/streams/live-events.js +53 -2
- package/dist/chat/headless/streams/selectors.d.ts +3 -0
- package/dist/chat/headless/streams/selectors.js +8 -1
- package/dist/chat/headless/streams/session-streams.d.ts +15 -3
- package/dist/chat/headless/streams/session-streams.js +31 -3
- package/dist/chat/headless/streams/store.d.ts +24 -1
- package/dist/chat/headless/streams/store.js +51 -26
- package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
- package/dist/chat/headless/streams/transcript-map.js +88 -0
- package/dist/chat/headless/streams/transcript.d.ts +4 -2
- package/dist/chat/headless/streams/transcript.js +19 -7
- package/dist/chat/headless/transcript/batch.js +5 -1
- package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
- package/dist/chat/headless/transcript/blob-media.js +23 -0
- package/dist/chat/headless/transcript/collapse.d.ts +10 -0
- package/dist/chat/headless/transcript/collapse.js +32 -6
- package/dist/chat/headless/transcript/derive.d.ts +98 -0
- package/dist/chat/headless/transcript/derive.js +89 -0
- package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
- package/dist/chat/headless/transcript/exchange-media.js +8 -5
- package/dist/chat/headless/transcript/fold-actions.d.ts +8 -3
- package/dist/chat/headless/transcript/fold-actions.js +16 -0
- package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
- package/dist/chat/headless/transcript/fold-attachments.js +3 -2
- package/dist/chat/headless/transcript/fold.d.ts +4 -2
- package/dist/chat/headless/transcript/fold.js +37 -7
- package/dist/chat/headless/transcript/incremental.d.ts +53 -0
- package/dist/chat/headless/transcript/incremental.js +181 -0
- package/dist/chat/headless/transcript/index.d.ts +2 -1
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/nesting.js +2 -1
- package/dist/chat/headless/transcript/rail.d.ts +142 -0
- package/dist/chat/headless/transcript/rail.js +290 -0
- package/dist/chat/headless/transcript/rows.d.ts +11 -1
- package/dist/chat/headless/transcript/run-failures.d.ts +4 -0
- package/dist/chat/headless/transcript/run-failures.js +31 -2
- package/dist/chat/headless/transcript/seams.d.ts +78 -0
- package/dist/chat/headless/transcript/seams.js +116 -0
- package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
- package/dist/chat/headless/transcript/tool-media.js +27 -9
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/headless/turn-labels.d.ts +1 -0
- package/dist/chat/headless/turn-labels.js +2 -1
- package/dist/chat/index.d.ts +10 -8
- package/dist/chat/index.js +9 -7
- package/dist/chat/interactions/ElicitationCard.js +1 -1
- package/dist/chat/interactions/InteractionCard.js +1 -1
- package/dist/chat/interactions/PlanCard.js +3 -3
- package/dist/chat/interactions/QuestionField.js +4 -4
- package/dist/chat/interactions/QuestionForm.js +3 -3
- package/dist/chat/interactions/SecretInput.js +1 -1
- package/dist/chat/sidebar/ProjectIcon.d.ts +1 -1
- package/dist/chat/sidebar/ProjectIcon.js +1 -1
- package/dist/chat/sidebar/RowChips.d.ts +3 -2
- package/dist/chat/sidebar/RowChips.js +6 -3
- package/dist/chat/sidebar/SessionSidebar.js +13 -14
- package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
- package/dist/chat/sidebar/SidebarFooter.js +6 -6
- package/dist/chat/sidebar/SidebarFrame.d.ts +2 -0
- package/dist/chat/sidebar/SidebarFrame.js +5 -2
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +3 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +3 -1
- package/dist/chat/sidebar/SpacesSection.d.ts +20 -1
- package/dist/chat/sidebar/SpacesSection.js +34 -13
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/sidebar/session-menu.d.ts +11 -2
- package/dist/chat/sidebar/session-menu.js +50 -5
- package/dist/chat/sidebar/sidebar-live.js +1 -1
- package/dist/chat/sidebar/useInboxRows.js +43 -2
- package/dist/chat/sidebar/useInboxTriage.js +19 -14
- package/dist/chat/testing/contract.d.ts +5 -3
- package/dist/chat/testing/contract.js +66 -1
- package/dist/chat/testing/fixture-sidebar-host.d.ts +7 -1
- package/dist/chat/testing/fixture-sidebar-host.js +12 -0
- package/dist/chat/testing/sidebar.contract.d.ts +6 -0
- package/dist/chat/testing/sidebar.contract.js +24 -0
- package/dist/chat/transcript/DiffLines.d.ts +6 -1
- package/dist/chat/transcript/DiffLines.js +35 -20
- package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
- package/dist/chat/transcript/EditDiffBlock.js +89 -30
- package/dist/chat/transcript/InteractionToolBody.js +1 -1
- package/dist/chat/transcript/LazyRow.d.ts +40 -40
- package/dist/chat/transcript/LazyRow.js +101 -149
- package/dist/chat/transcript/MermaidDiagram.js +2 -1
- package/dist/chat/transcript/SelectCursor.d.ts +11 -1
- package/dist/chat/transcript/SelectCursor.js +10 -5
- package/dist/chat/transcript/SubagentBlock.js +3 -2
- package/dist/chat/transcript/TranscriptRail.d.ts +109 -0
- package/dist/chat/transcript/TranscriptRail.js +579 -0
- package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
- package/dist/chat/transcript/TranscriptRow.js +9 -5
- package/dist/chat/transcript/actions.d.ts +43 -3
- package/dist/chat/transcript/actions.js +27 -1
- package/dist/chat/transcript/clipped-output.d.ts +58 -0
- package/dist/chat/transcript/clipped-output.js +131 -0
- package/dist/chat/transcript/fold-attachments.js +10 -5
- package/dist/chat/transcript/fold-worker.js +3 -2
- package/dist/chat/transcript/fold.js +21 -2
- package/dist/chat/transcript/index.d.ts +11 -9
- package/dist/chat/transcript/index.js +10 -8
- package/dist/chat/transcript/markdown-cache.d.ts +7 -1
- package/dist/chat/transcript/markdown-cache.js +12 -1
- package/dist/chat/transcript/markdown.js +116 -54
- package/dist/chat/transcript/media-gallery.d.ts +3 -2
- package/dist/chat/transcript/media-gallery.js +10 -7
- package/dist/chat/transcript/notices.d.ts +23 -1
- package/dist/chat/transcript/notices.js +110 -28
- package/dist/chat/transcript/prompt.js +6 -4
- package/dist/chat/transcript/prose.js +3 -1
- package/dist/chat/transcript/receipt-parts.d.ts +22 -0
- package/dist/chat/transcript/receipt-parts.js +87 -0
- package/dist/chat/transcript/root-items.d.ts +96 -0
- package/dist/chat/transcript/root-items.js +180 -0
- package/dist/chat/transcript/row-mount.d.ts +165 -0
- package/dist/chat/transcript/row-mount.js +498 -0
- package/dist/chat/transcript/row-parking.d.ts +125 -0
- package/dist/chat/transcript/row-parking.js +135 -0
- package/dist/chat/transcript/row-ui-state.d.ts +37 -0
- package/dist/chat/transcript/row-ui-state.js +53 -0
- package/dist/chat/transcript/run-rows.js +6 -78
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/scroll-clamp.js +1 -1
- package/dist/chat/transcript/tasks.js +3 -2
- package/dist/chat/transcript/tool-media.d.ts +4 -2
- package/dist/chat/transcript/tool-media.js +15 -7
- package/dist/chat/transcript/tool-parts.d.ts +27 -4
- package/dist/chat/transcript/tool-parts.js +31 -5
- package/dist/chat/transcript/tool-payload.js +26 -11
- package/dist/chat/transcript/tool-row.d.ts +2 -1
- package/dist/chat/transcript/tool-row.js +38 -19
- package/dist/chat/transcript/use-transcript-rows.d.ts +24 -7
- package/dist/chat/transcript/use-transcript-rows.js +28 -46
- package/dist/chat/transcript/useSettledReveal.js +15 -3
- package/dist/chat/transcript/useStickToBottom.js +4 -4
- package/dist/chat/transcript/useTranscriptSearch.js +30 -14
- package/dist/chat/transcript/view-scope.d.ts +26 -6
- package/dist/chat/transcript/view-scope.js +106 -20
- package/dist/components/ChoiceCards.js +1 -1
- package/dist/components/ConfirmDialog.js +1 -1
- package/dist/components/CopyValue.d.ts +33 -0
- package/dist/components/CopyValue.js +54 -0
- package/dist/components/Form.js +1 -1
- package/dist/components/HowItWorks.js +1 -1
- package/dist/components/Menu.js +1 -1
- package/dist/components/StepFrame.js +2 -2
- package/dist/components/SwatchPicker.js +1 -1
- package/dist/components/ToggleCard.js +1 -1
- package/dist/components/floating/HoverCard.js +2 -3
- package/dist/components/floating/hover-delay.d.ts +4 -0
- package/dist/components/floating/hover-delay.js +6 -0
- package/dist/core.css +14 -12
- package/dist/dist/{index-Betz0OWq.d.ts → index-C6-t1SS9.d.ts} +21 -2
- package/dist/dist/index-De9AbmxS.d.ts +1 -0
- package/dist/dist/index.d.ts +5 -5
- package/dist/dist/sandbox-CSUihARm.d.ts +2 -0
- package/dist/dist/{timeout-CyU7HLyz.d.ts → timeout-CmTx6V9y.d.ts} +1 -0
- package/dist/extensions/ExtensionDialogHost.js +1 -1
- package/dist/files/TreeColumn.js +3 -1
- package/dist/files/headless/host.d.ts +2 -2
- package/dist/git/ImportRepoDialog.js +1 -1
- package/dist/git/MoveSessionDialog.js +2 -2
- package/dist/git/SandboxManager.d.ts +42 -0
- package/dist/git/SandboxManager.js +297 -0
- package/dist/git/SyncChip.js +1 -1
- package/dist/git/headless/index.d.ts +2 -1
- package/dist/git/headless/index.js +2 -1
- package/dist/git/headless/labels.d.ts +29 -0
- package/dist/git/headless/labels.js +34 -1
- package/dist/git/headless/sandboxes.d.ts +43 -0
- package/dist/git/headless/sandboxes.js +52 -0
- package/dist/git/index.d.ts +2 -1
- package/dist/git/index.js +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +12 -0
- package/dist/machines/HostsSection.d.ts +1 -1
- package/dist/machines/headless/labels.js +2 -2
- package/dist/motion/flip-list.js +3 -10
- package/dist/motion/presence.d.ts +10 -0
- package/dist/motion/presence.js +20 -1
- package/dist/motion/swap.d.ts +8 -2
- package/dist/motion/swap.js +5 -2
- package/dist/onboarding/conversation.js +27 -15
- package/dist/onboarding/demos/how-it-works.js +1 -1
- package/dist/onboarding/skills/parts.js +4 -4
- package/dist/onboarding/sources/SourceBrowser.js +1 -1
- package/dist/onboarding/steps/ReadyStep.js +1 -1
- package/dist/onboarding/steps/connect/KeyForm.js +1 -1
- package/dist/palette/headless/app-sources.js +20 -0
- package/dist/palette/headless/labels.js +2 -0
- package/dist/session/PlanTracker.js +3 -3
- package/dist/session/SecretsPanel.js +1 -1
- package/dist/session/SessionHeader.d.ts +18 -6
- package/dist/session/SessionHeader.js +68 -12
- package/dist/session/SessionPlaceMenu.d.ts +35 -0
- package/dist/session/SessionPlaceMenu.js +299 -0
- package/dist/session/SessionShell.js +1 -1
- package/dist/session/TurnDetailsDialog.js +1 -1
- package/dist/session/headless/index.d.ts +2 -1
- package/dist/session/headless/index.js +2 -1
- package/dist/session/headless/labels.d.ts +73 -0
- package/dist/session/headless/labels.js +73 -0
- package/dist/session/headless/place.d.ts +49 -0
- package/dist/session/headless/place.js +57 -0
- package/dist/session/index.d.ts +2 -1
- package/dist/session/index.js +2 -1
- package/dist/settings/ConversationPresetsCard.js +1 -1
- package/dist/settings/SettingCard.js +2 -2
- package/dist/settings/SettingsRowsPage.js +1 -1
- package/dist/settings/headless/fixture-performance.js +4 -2
- package/dist/settings/headless/fixture-sections.js +7 -0
- package/dist/settings/headless/labels.d.ts +1 -1
- package/dist/settings/headless/labels.js +1 -1
- package/dist/settings/headless/layout.d.ts +4 -4
- package/dist/settings/headless/layout.js +1 -1
- package/dist/settings/headless/performance.d.ts +4 -0
- package/dist/settings/headless/search.d.ts +2 -2
- package/dist/settings/headless/sections-host.d.ts +20 -2
- package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
- package/dist/settings/sections/enabled-list/EnabledListSection.js +2 -2
- package/dist/settings/sections/environments/EnvironmentsSection.d.ts +9 -3
- package/dist/settings/sections/environments/EnvironmentsSection.js +292 -52
- package/dist/settings/sections/environments/labels.d.ts +15 -0
- package/dist/settings/sections/environments/labels.js +18 -3
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionSourceBrowser.js +1 -1
- package/dist/settings/sections/extensions/ExtensionsSection.d.ts +3 -2
- package/dist/settings/sections/extensions/ExtensionsSection.js +9 -3
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +15 -5
- package/dist/settings/sections/keybindings/labels.d.ts +2 -0
- package/dist/settings/sections/keybindings/labels.js +2 -0
- package/dist/settings/sections/keybindings/rows.js +8 -0
- package/dist/settings/sections/models/SpacesDefaultsSection.d.ts +7 -3
- package/dist/settings/sections/models/SpacesDefaultsSection.js +11 -5
- package/dist/settings/sections/performance/PerformanceSection.js +8 -1
- package/dist/settings/sections/performance/labels.d.ts +2 -0
- package/dist/settings/sections/performance/labels.js +2 -0
- package/dist/settings/sections/skills/SkillGroups.js +1 -1
- package/dist/settings/server-app.d.ts +4 -2
- package/dist/settings/server-app.js +7 -3
- package/dist/settings/testing/sections.contract.d.ts +7 -1
- package/dist/settings/testing/sections.contract.js +37 -0
- package/dist/styles.css +243 -19
- package/dist/terminal/TerminalDrawer.js +3 -1
- package/dist/views/headless/answers.d.ts +8 -2
- package/dist/views/headless/answers.js +58 -1
- package/dist/views/headless/placement.d.ts +78 -0
- package/dist/views/headless/placement.js +154 -44
- package/dist/workspace/SidePanel.js +3 -1
- package/package.json +2 -2
- package/src/styles/base.css +13 -0
- package/src/styles/chat.css +30 -0
- package/src/styles/components.css +0 -10
- package/src/styles/files.css +5 -0
- package/src/styles/sidebar.css +29 -7
- package/src/styles/terminal.css +6 -0
- package/src/styles/tokens.css +5 -0
- package/src/styles/transcript.css +138 -0
- package/src/styles/workspace.css +6 -0
- package/dist/dist/index-QcFzZlao.d.ts +0 -1
- package/dist/dist/sandbox-D0zsW8I1.d.ts +0 -2
- /package/dist/dist/{types-_Dtoq_No.d.ts → execution-failure-SREfl-EZ.d.ts} +0 -0
|
@@ -121,7 +121,7 @@ function QuestionField({ index, question, value, onChange, note, onNoteChange, r
|
|
|
121
121
|
}),
|
|
122
122
|
question.description && /* @__PURE__ */ jsx("span", {
|
|
123
123
|
id: `${inputId}-desc`,
|
|
124
|
-
className: "text-zg-meta leading-4 text-[var(--zg-text-muted)]
|
|
124
|
+
className: "text-zg-meta leading-4 text-[var(--zg-text-muted)]",
|
|
125
125
|
children: question.description
|
|
126
126
|
}),
|
|
127
127
|
question.type === "select" && question.multi && /* @__PURE__ */ jsx("span", {
|
|
@@ -137,7 +137,7 @@ function QuestionField({ index, question, value, onChange, note, onNoteChange, r
|
|
|
137
137
|
readOnly && (question.type === "text" || question.type === "textarea" || question.type === "number") && /* @__PURE__ */ jsx("div", {
|
|
138
138
|
...groupProps,
|
|
139
139
|
role: "group",
|
|
140
|
-
className: `text-zg-ui leading-5 whitespace-pre-wrap
|
|
140
|
+
className: `text-zg-ui leading-5 whitespace-pre-wrap ${answered.trim() !== "" ? "text-[var(--zg-text)]" : "text-[var(--zg-text-subtle)] italic"}`,
|
|
141
141
|
children: answered.trim() !== "" ? answered : labels.noAnswer
|
|
142
142
|
}),
|
|
143
143
|
!readOnly && question.type === "text" && /* @__PURE__ */ jsx("input", {
|
|
@@ -234,7 +234,7 @@ function QuestionField({ index, question, value, onChange, note, onNoteChange, r
|
|
|
234
234
|
className: "block text-zg-ui leading-5",
|
|
235
235
|
children: choice.label
|
|
236
236
|
}), choice.description && /* @__PURE__ */ jsx("span", {
|
|
237
|
-
className: "block text-zg-meta leading-4 text-[var(--zg-text-muted)] mt-0.5
|
|
237
|
+
className: "block text-zg-meta leading-4 text-[var(--zg-text-muted)] mt-0.5",
|
|
238
238
|
children: choice.description
|
|
239
239
|
})]
|
|
240
240
|
})]
|
|
@@ -268,7 +268,7 @@ function QuestionField({ index, question, value, onChange, note, onNoteChange, r
|
|
|
268
268
|
className: `zg-well text-zg-ui px-2.5 w-full placeholder:text-[var(--zg-text-subtle)] mt-1.5 min-h-8 py-1.5 resize-y`
|
|
269
269
|
}),
|
|
270
270
|
choiceQuestion && readOnly && hasNote && /* @__PURE__ */ jsx("div", {
|
|
271
|
-
className: "mt-1.5 text-zg-ui leading-5 text-[var(--zg-text)] whitespace-pre-wrap
|
|
271
|
+
className: "mt-1.5 text-zg-ui leading-5 text-[var(--zg-text)] whitespace-pre-wrap",
|
|
272
272
|
children: note
|
|
273
273
|
}),
|
|
274
274
|
shownProblem && /* @__PURE__ */ jsx("div", {
|
|
@@ -85,7 +85,7 @@ function QuestionForm({ request, autoFocus = false, onAnswer, onDismiss, Markdow
|
|
|
85
85
|
},
|
|
86
86
|
children: [
|
|
87
87
|
payload.intro && /* @__PURE__ */ jsx("div", {
|
|
88
|
-
className: "prose-styles text-zg-ui text-[var(--zg-text)]
|
|
88
|
+
className: "prose-styles text-zg-ui text-[var(--zg-text)]",
|
|
89
89
|
children: /* @__PURE__ */ jsx(Markdown, { children: payload.intro })
|
|
90
90
|
}),
|
|
91
91
|
payload.questions.map((q, index) => /* @__PURE__ */ jsx(QuestionField, {
|
|
@@ -179,7 +179,7 @@ function AnsweredQuestions({ payload, answers, instructions, notes, id, Markdown
|
|
|
179
179
|
style,
|
|
180
180
|
children: [
|
|
181
181
|
payload.intro && /* @__PURE__ */ jsx("div", {
|
|
182
|
-
className: "prose-styles text-zg-ui text-[var(--zg-text)]
|
|
182
|
+
className: "prose-styles text-zg-ui text-[var(--zg-text)]",
|
|
183
183
|
children: /* @__PURE__ */ jsx(Markdown, { children: payload.intro })
|
|
184
184
|
}),
|
|
185
185
|
payload.questions.map((q, index) => /* @__PURE__ */ jsx(QuestionField, {
|
|
@@ -199,7 +199,7 @@ function AnsweredQuestions({ payload, answers, instructions, notes, id, Markdown
|
|
|
199
199
|
className: "text-zg-label font-medium text-[var(--zg-text-muted)]",
|
|
200
200
|
children: labels.additionalInstructions
|
|
201
201
|
}), /* @__PURE__ */ jsx("div", {
|
|
202
|
-
className: "text-zg-ui leading-5 text-[var(--zg-text)] whitespace-pre-wrap
|
|
202
|
+
className: "text-zg-ui leading-5 text-[var(--zg-text)] whitespace-pre-wrap",
|
|
203
203
|
children: instructions
|
|
204
204
|
})]
|
|
205
205
|
})
|
|
@@ -53,7 +53,7 @@ function SecretInput({ id, ttl, onChange, describedBy, required = false, onSubmi
|
|
|
53
53
|
})]
|
|
54
54
|
}), /* @__PURE__ */ jsxs("span", {
|
|
55
55
|
id: noteId,
|
|
56
|
-
className: "flex items-start gap-1.5 text-zg-meta leading-4 text-[var(--zg-text-muted)]
|
|
56
|
+
className: "flex items-start gap-1.5 text-zg-meta leading-4 text-[var(--zg-text-muted)]",
|
|
57
57
|
children: [/* @__PURE__ */ jsx("span", {
|
|
58
58
|
"aria-hidden": true,
|
|
59
59
|
className: "i-ph-shield-check mt-px shrink-0"
|
|
@@ -102,7 +102,7 @@ export interface IconPickerProps {
|
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* The emoji / image picker body — directory icons here, space icons in
|
|
105
|
-
* Settings ›
|
|
105
|
+
* Settings › Workspace › Spaces. Hosts own the popover and the persistence.
|
|
106
106
|
*
|
|
107
107
|
* @param props - The {@link IconPickerProps}.
|
|
108
108
|
*/
|
|
@@ -176,7 +176,7 @@ function ProjectIconButton({ fullPath, label, icon, isGitRepo, defaultGlyph, tit
|
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
178
|
* The emoji / image picker body — directory icons here, space icons in
|
|
179
|
-
* Settings ›
|
|
179
|
+
* Settings › Workspace › Spaces. Hosts own the popover and the persistence.
|
|
180
180
|
*
|
|
181
181
|
* @param props - The {@link IconPickerProps}.
|
|
182
182
|
*/
|
|
@@ -17,8 +17,9 @@ export interface EnvironmentChipProps {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Where a non-local session runs: the kind's glyph and a short name (the branch for a worktree, else the
|
|
20
|
-
* kind or machine).
|
|
21
|
-
*
|
|
20
|
+
* kind or machine). Its state is the header dot's (`sessionPlaceTone`): a spinner while it sets up or
|
|
21
|
+
* reconnects, a red warning once it failed (setup, gone, not answering), dimmed while paused; the tooltip
|
|
22
|
+
* has the details.
|
|
22
23
|
*
|
|
23
24
|
* @param props - The `environment`, `className` and `style`.
|
|
24
25
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useTooltip } from "../../components/Tooltip.js";
|
|
2
2
|
import { environmentKindIcon } from "../../git/headless/environment.js";
|
|
3
|
+
import { sessionPlaceTone } from "../../session/headless/place.js";
|
|
3
4
|
import { environmentKindLabel, environmentSummaryText } from "../headless/sidebar/environment.js";
|
|
4
5
|
import { useSidebarLabels } from "./useSidebarLabels.js";
|
|
5
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -7,8 +8,9 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
8
|
const CHIP = "zg-row-badge text-zg-meta inline-flex items-center gap-1 h-[18px] px-1.5 rounded-zg-sm whitespace-nowrap";
|
|
8
9
|
/**
|
|
9
10
|
* Where a non-local session runs: the kind's glyph and a short name (the branch for a worktree, else the
|
|
10
|
-
* kind or machine).
|
|
11
|
-
*
|
|
11
|
+
* kind or machine). Its state is the header dot's (`sessionPlaceTone`): a spinner while it sets up or
|
|
12
|
+
* reconnects, a red warning once it failed (setup, gone, not answering), dimmed while paused; the tooltip
|
|
13
|
+
* has the details.
|
|
12
14
|
*
|
|
13
15
|
* @param props - The `environment`, `className` and `style`.
|
|
14
16
|
*/
|
|
@@ -16,7 +18,8 @@ function EnvironmentChip({ environment, className = "", style }) {
|
|
|
16
18
|
const labels = useSidebarLabels();
|
|
17
19
|
const tip = useTooltip(environment ? environmentSummaryText(environment, labels) : null);
|
|
18
20
|
if (!environment) return null;
|
|
19
|
-
const
|
|
21
|
+
const tone = sessionPlaceTone(environment, void 0);
|
|
22
|
+
const icon = tone === "busy" || tone === "reconnecting" || tone === "resuming" ? "i-ph-circle-notch animate-spin text-[var(--zg-text-muted)]" : tone === "failed" ? "i-ph-warning-circle text-[var(--zg-danger)]" : `${environmentKindIcon(environment.kind)} ${tone === "paused" || tone === "removed" ? "opacity-45" : ""}`;
|
|
20
23
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("span", {
|
|
21
24
|
...tip.anchorProps,
|
|
22
25
|
"data-testid": "row-badge-environment",
|
|
@@ -125,22 +125,20 @@ function NewSessionButton({ onNewSession, isActive, className = "", style }) {
|
|
|
125
125
|
onClick: onNewSession,
|
|
126
126
|
"data-active": isActive ? "true" : void 0,
|
|
127
127
|
className: "zg-press-subtle group w-full inline-flex items-center gap-1.5 pl-1 pr-2 py-1 rounded-zg-md bg-transparent hover:before:bg-[var(--zg-row-hover)] data-[active=true]:before:bg-[var(--zg-raised)] data-[active=true]:hover:before:bg-[var(--zg-raised)] data-[active=true]:before:[box-shadow:var(--zg-shadow-raised)] text-[var(--zg-text)] cursor-pointer border-0 transition-[background-color,box-shadow] zg-focus-ring",
|
|
128
|
-
children: [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
/* @__PURE__ */ jsx("span", {
|
|
135
|
-
className: "text-sm text-[var(--zg-sidebar-label-fg,var(--zg-text-muted))] group-data-[active=true]:text-[var(--zg-text)]",
|
|
128
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
129
|
+
"aria-hidden": true,
|
|
130
|
+
className: "inline-flex items-center justify-center w-[18px] shrink-0",
|
|
131
|
+
children: /* @__PURE__ */ jsx("span", { className: "i-ph-plus text-sm text-[var(--zg-text-muted)] group-data-[active=true]:text-[var(--zg-text)]" })
|
|
132
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
133
|
+
className: "flex-1 min-w-0 h-5 overflow-hidden flex flex-wrap items-center justify-between gap-x-1.5",
|
|
134
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
135
|
+
className: "min-w-0 truncate text-sm text-[var(--zg-sidebar-label-fg,var(--zg-text-muted))] group-data-[active=true]:text-[var(--zg-text)]",
|
|
136
136
|
children: labels.newSession
|
|
137
|
-
}),
|
|
138
|
-
/* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
139
|
-
/* @__PURE__ */ jsx(KeyHint, {
|
|
137
|
+
}), /* @__PURE__ */ jsx(KeyHint, {
|
|
140
138
|
spec: bindings.newSession,
|
|
141
|
-
className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 transition-opacity"
|
|
142
|
-
})
|
|
143
|
-
]
|
|
139
|
+
className: "h-5 opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 transition-opacity"
|
|
140
|
+
})]
|
|
141
|
+
})]
|
|
144
142
|
}), tip.tip]
|
|
145
143
|
});
|
|
146
144
|
}
|
|
@@ -561,6 +559,7 @@ function SessionSidebar(props) {
|
|
|
561
559
|
onSetArchived: onRowSetArchived,
|
|
562
560
|
onSetFavorite: onRowSetFavorite,
|
|
563
561
|
onRetryEnvironment: environment.retry,
|
|
562
|
+
...environment.wake ? { onWakeEnvironment: environment.wake } : {},
|
|
564
563
|
onRunEnvironmentAction: environment.run,
|
|
565
564
|
onMoveToSpace: onRowMoveToSpace,
|
|
566
565
|
...onMoveSession ? { onMoveSession } : {},
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* [status …] [spaces] [settings]
|
|
5
5
|
*
|
|
6
|
-
* The status side holds what the
|
|
7
|
-
*
|
|
6
|
+
* The status side holds what is the same in every space (the daemon dot), then
|
|
7
|
+
* what the app puts there (the sign-in prompt, the usage chip, the compacting
|
|
8
|
+
* indicator, each below), then what
|
|
8
9
|
* extensions put in `sidebar.footer` and `app.statusbar`; the spaces
|
|
9
10
|
* switcher sits at the TRUE center (equal `1fr` sides, each clipping rather
|
|
10
11
|
* than pushing it; without it the status side runs up to the gear, clipping
|
|
@@ -23,7 +24,9 @@ export interface SidebarSettingsNote {
|
|
|
23
24
|
}
|
|
24
25
|
/** Props of {@link SidebarFooter}. */
|
|
25
26
|
export interface SidebarFooterProps {
|
|
26
|
-
/** The status side
|
|
27
|
+
/** The status side's start: what is the same in every space (the daemon dot). It stays put on a space switch. */
|
|
28
|
+
pinned?: ReactNode;
|
|
29
|
+
/** The status side, after `pinned`: the app's indicators. They slide with the list on a space switch. */
|
|
27
30
|
status?: ReactNode;
|
|
28
31
|
/** The center: the spaces switcher (Spaces on). */
|
|
29
32
|
spaces?: ReactNode;
|
|
@@ -41,9 +44,9 @@ export interface SidebarFooterProps {
|
|
|
41
44
|
/**
|
|
42
45
|
* Renders the sidebar's footer strip.
|
|
43
46
|
*
|
|
44
|
-
* @param props - The status side, the spaces switcher, the settings gear, `className` and `style`.
|
|
47
|
+
* @param props - The pinned status, the status side, the spaces switcher, the settings gear, `className` and `style`.
|
|
45
48
|
*/
|
|
46
|
-
export declare function SidebarFooter({ status, spaces, onOpenSettings, settingsNote, sessionId, className, style }: SidebarFooterProps): import("react").JSX.Element;
|
|
49
|
+
export declare function SidebarFooter({ pinned, status, spaces, onOpenSettings, settingsNote, sessionId, className, style }: SidebarFooterProps): import("react").JSX.Element;
|
|
47
50
|
/** Props of {@link SidebarSignInPrompt}. */
|
|
48
51
|
export interface SidebarSignInPromptProps {
|
|
49
52
|
/** Opens the sign-in. */
|
|
@@ -11,18 +11,18 @@ import { activeSnapshotFor, compactingParts, formatUsagePercent, mostConstrained
|
|
|
11
11
|
/**
|
|
12
12
|
* Renders the sidebar's footer strip.
|
|
13
13
|
*
|
|
14
|
-
* @param props - The status side, the spaces switcher, the settings gear, `className` and `style`.
|
|
14
|
+
* @param props - The pinned status, the status side, the spaces switcher, the settings gear, `className` and `style`.
|
|
15
15
|
*/
|
|
16
|
-
function SidebarFooter({ status, spaces, onOpenSettings, settingsNote, sessionId, className = "", style }) {
|
|
16
|
+
function SidebarFooter({ pinned, status, spaces, onOpenSettings, settingsNote, sessionId, className = "", style }) {
|
|
17
17
|
const scoped = sessionId ? { sessionId } : {};
|
|
18
18
|
const labels = useSidebarLabels();
|
|
19
19
|
return /* @__PURE__ */ jsxs("div", {
|
|
20
20
|
className: `grid ${spaces ? "grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)]" : "grid-cols-[minmax(0,1fr)_auto]"} items-center gap-2 px-2 pt-[5px] pb-1 text-zg-meta text-[var(--zg-text-muted)] shrink-0${className ? ` ${className}` : ""}`,
|
|
21
21
|
style,
|
|
22
22
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
className: "relative flex items-center min-w-0 -mx-1.5 px-1.5 [overflow-x:clip]",
|
|
25
|
-
children: /* @__PURE__ */ jsxs(SpaceSlideRegion, {
|
|
23
|
+
/* @__PURE__ */ jsxs("div", {
|
|
24
|
+
className: "relative flex items-center gap-2 min-w-0 -mx-1.5 px-1.5 [overflow-x:clip]",
|
|
25
|
+
children: [pinned, /* @__PURE__ */ jsxs(SpaceSlideRegion, {
|
|
26
26
|
className: "flex items-center gap-2 min-w-0",
|
|
27
27
|
children: [
|
|
28
28
|
status,
|
|
@@ -35,7 +35,7 @@ function SidebarFooter({ status, spaces, onOpenSettings, settingsNote, sessionId
|
|
|
35
35
|
...scoped
|
|
36
36
|
})
|
|
37
37
|
]
|
|
38
|
-
})
|
|
38
|
+
})]
|
|
39
39
|
}),
|
|
40
40
|
spaces && /* @__PURE__ */ jsx("div", {
|
|
41
41
|
className: "flex items-center justify-center min-w-0",
|
|
@@ -41,6 +41,8 @@ export interface SidebarFrameState {
|
|
|
41
41
|
mounted: boolean;
|
|
42
42
|
/** Fully open (not entering or closing). */
|
|
43
43
|
open: boolean;
|
|
44
|
+
/** Open and done opening: the sheet follows the aside's width (`usePanelSettled`). */
|
|
45
|
+
settled: boolean;
|
|
44
46
|
/** Open over the chat: the window is too narrow to dock it (`LayoutBudget.sidebarPeek`). */
|
|
45
47
|
overlay: boolean;
|
|
46
48
|
/** Closes it when it is open over the chat. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_APPEARANCE, LIMITS } from "../../appearance/headless/prefs.js";
|
|
2
2
|
import { useResizeDrag } from "../../hooks/useResizeDrag.js";
|
|
3
|
-
import { readPanelMs, usePresence } from "../../motion/presence.js";
|
|
3
|
+
import { readPanelMs, usePanelSettled, usePresence } from "../../motion/presence.js";
|
|
4
4
|
import { useLayoutBudgetOptional } from "../../workspace/LayoutBudget.js";
|
|
5
5
|
import { useEffect, useRef } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -19,6 +19,7 @@ function useSidebarFrame(options) {
|
|
|
19
19
|
enter: true,
|
|
20
20
|
exitMs: readPanelMs
|
|
21
21
|
});
|
|
22
|
+
const settled = usePanelSettled(presence.state);
|
|
22
23
|
const width = overlay ? Math.min(wanted, Math.max(minWidth, (budget?.chatWidth ?? wanted) - 48)) : budget && budget.sidebarWidth > 0 ? budget.sidebarWidth : wanted;
|
|
23
24
|
const asideRef = useRef(null);
|
|
24
25
|
const max = budget ? Math.max(minWidth, budget.getCaps().sidebarMax) : maxWidth;
|
|
@@ -38,6 +39,7 @@ function useSidebarFrame(options) {
|
|
|
38
39
|
return {
|
|
39
40
|
mounted: presence.mounted,
|
|
40
41
|
open: presence.state === "open",
|
|
42
|
+
settled,
|
|
41
43
|
overlay,
|
|
42
44
|
closeOverlay,
|
|
43
45
|
width,
|
|
@@ -51,7 +53,7 @@ function useSidebarFrame(options) {
|
|
|
51
53
|
* @param props - The frame state, the chrome inset, the content, its name, `className` and `style`.
|
|
52
54
|
*/
|
|
53
55
|
function SidebarFrame({ frame, chromeInset, children, ariaLabel, className = "", style }) {
|
|
54
|
-
const { open, overlay, closeOverlay, width, asideRef, drag } = frame;
|
|
56
|
+
const { open, settled, overlay, closeOverlay, width, asideRef, drag } = frame;
|
|
55
57
|
useEffect(() => {
|
|
56
58
|
if (!overlay) return void 0;
|
|
57
59
|
const onKey = (event) => {
|
|
@@ -68,6 +70,7 @@ function SidebarFrame({ frame, chromeInset, children, ariaLabel, className = "",
|
|
|
68
70
|
ref: asideRef,
|
|
69
71
|
...ariaLabel ? { "aria-label": ariaLabel } : {},
|
|
70
72
|
"data-collapsed": !open,
|
|
73
|
+
"data-settled": settled || void 0,
|
|
71
74
|
"aria-hidden": !open,
|
|
72
75
|
"data-overlay": overlay || void 0,
|
|
73
76
|
className: `zg-sidebar ${overlay ? "fixed left-0 top-0 z-zg-overlay shadow-[var(--zg-shadow-float)]" : "relative z-[2]"} shrink-0 h-full bg-[var(--zg-tray)]${className ? ` ${className}` : ""}`,
|
|
@@ -36,6 +36,8 @@ export interface SidebarRowHandlers {
|
|
|
36
36
|
onSetFavorite: (sessionId: string, favorite: boolean) => void;
|
|
37
37
|
/** Sets its failed environment up again. */
|
|
38
38
|
onRetryEnvironment: (sessionId: string) => void;
|
|
39
|
+
/** Starts its paused environment now. Absent: no "Wake up". */
|
|
40
|
+
onWakeEnvironment?: (sessionId: string) => void;
|
|
39
41
|
/** Runs one of its environment's commands. */
|
|
40
42
|
onRunEnvironmentAction: (sessionId: string, actionId: string, label: string) => void;
|
|
41
43
|
/** Moves it to a space. */
|
|
@@ -122,4 +124,4 @@ export interface SidebarSessionRowProps extends SidebarRowHandlers {
|
|
|
122
124
|
style?: CSSProperties;
|
|
123
125
|
}
|
|
124
126
|
/** Renders one session of the sidebar list. Memoized: keep every prop stable. */
|
|
125
|
-
export declare const SidebarSessionRow: import("react").MemoExoticComponent<({ sessionId, title, cwd, hostId, hostBadge, spaceId, isMain, isActive, isRenaming, archived, favorite, scheduled, startedFromKey, renameValue, menuOpen, onSelect, onRenameValueChange, onRenameCommit, onRenameCancel, onStartRename, onDelete, onSetArchived, onSetFavorite, onRetryEnvironment, onRunEnvironmentAction, onMoveToSpace, onMoveSession, onOpenMenu, onCloseMenu, excerpt, excerptQuery, project, updatedAt, environment, runDetails, artifactBadges, spaces, live, decoration, inboxSection, inboxHandlers, snoozedUntil, woke, recede, selected, swept, className, style }: SidebarSessionRowProps) => import("react").JSX.Element | null>;
|
|
127
|
+
export declare const SidebarSessionRow: import("react").MemoExoticComponent<({ sessionId, title, cwd, hostId, hostBadge, spaceId, isMain, isActive, isRenaming, archived, favorite, scheduled, startedFromKey, renameValue, menuOpen, onSelect, onRenameValueChange, onRenameCommit, onRenameCancel, onStartRename, onDelete, onSetArchived, onSetFavorite, onRetryEnvironment, onWakeEnvironment, onRunEnvironmentAction, onMoveToSpace, onMoveSession, onOpenMenu, onCloseMenu, excerpt, excerptQuery, project, updatedAt, environment, runDetails, artifactBadges, spaces, live, decoration, inboxSection, inboxHandlers, snoozedUntil, woke, recede, selected, swept, className, style }: SidebarSessionRowProps) => import("react").JSX.Element | null>;
|
|
@@ -27,7 +27,7 @@ const ExcerptHighlight = memo(({ text, query }) => {
|
|
|
27
27
|
});
|
|
28
28
|
ExcerptHighlight.displayName = "ExcerptHighlight";
|
|
29
29
|
/** Renders one session of the sidebar list. Memoized: keep every prop stable. */
|
|
30
|
-
const SidebarSessionRow = memo(({ sessionId, title, cwd, hostId, hostBadge = true, spaceId, isMain, isActive, isRenaming, archived, favorite = false, scheduled = false, startedFromKey, renameValue, menuOpen, onSelect, onRenameValueChange, onRenameCommit, onRenameCancel, onStartRename, onDelete, onSetArchived, onSetFavorite, onRetryEnvironment, onRunEnvironmentAction, onMoveToSpace, onMoveSession, onOpenMenu, onCloseMenu, excerpt, excerptQuery, project, updatedAt, environment, runDetails, artifactBadges, spaces, live, decoration, inboxSection, inboxHandlers, snoozedUntil, woke = false, recede = false, selected = false, swept = false, className, style }) => {
|
|
30
|
+
const SidebarSessionRow = memo(({ sessionId, title, cwd, hostId, hostBadge = true, spaceId, isMain, isActive, isRenaming, archived, favorite = false, scheduled = false, startedFromKey, renameValue, menuOpen, onSelect, onRenameValueChange, onRenameCommit, onRenameCancel, onStartRename, onDelete, onSetArchived, onSetFavorite, onRetryEnvironment, onWakeEnvironment, onRunEnvironmentAction, onMoveToSpace, onMoveSession, onOpenMenu, onCloseMenu, excerpt, excerptQuery, project, updatedAt, environment, runDetails, artifactBadges, spaces, live, decoration, inboxSection, inboxHandlers, snoozedUntil, woke = false, recede = false, selected = false, swept = false, className, style }) => {
|
|
31
31
|
const { SessionStatusDot, RowMeta, RowArtifacts } = live;
|
|
32
32
|
const host = useSidebarHost();
|
|
33
33
|
const labels = useSidebarLabels();
|
|
@@ -56,6 +56,7 @@ const SidebarSessionRow = memo(({ sessionId, title, cwd, hostId, hostBadge = tru
|
|
|
56
56
|
setArchived: (next) => onSetArchived(sessionId, next),
|
|
57
57
|
remove: () => onDelete(sessionId, title, environment),
|
|
58
58
|
retryEnvironment: () => onRetryEnvironment(sessionId),
|
|
59
|
+
...onWakeEnvironment ? { wakeEnvironment: () => onWakeEnvironment(sessionId) } : {},
|
|
59
60
|
runEnvironmentAction: (actionId, label) => onRunEnvironmentAction(sessionId, actionId, label),
|
|
60
61
|
moveToSpace: (space) => onMoveToSpace(sessionId, space),
|
|
61
62
|
...onMoveSession ? { moveSession: () => onMoveSession(sessionId) } : {}
|
|
@@ -85,6 +86,7 @@ const SidebarSessionRow = memo(({ sessionId, title, cwd, hostId, hostBadge = tru
|
|
|
85
86
|
onSetArchived,
|
|
86
87
|
onSetFavorite,
|
|
87
88
|
onRetryEnvironment,
|
|
89
|
+
onWakeEnvironment,
|
|
88
90
|
onRunEnvironmentAction,
|
|
89
91
|
onMoveToSpace,
|
|
90
92
|
onMoveSession
|
|
@@ -9,11 +9,30 @@
|
|
|
9
9
|
* direction). The Default space can be renamed but not deleted; deleting
|
|
10
10
|
* another one moves its sessions back to Default (their stored id no longer
|
|
11
11
|
* resolves).
|
|
12
|
+
*
|
|
13
|
+
* With `home`, a row picks where the spaces come from: this computer, or a
|
|
14
|
+
* home server every device of the user shares (`Settings.spacesHome`). While
|
|
15
|
+
* that server is offline the list is read-only.
|
|
12
16
|
*/
|
|
13
17
|
import { CSSProperties, ReactNode } from "react";
|
|
14
18
|
import { Space } from "zidane/chat/pure";
|
|
19
|
+
/** Where the spaces come from: {@link SpacesSectionProps.home}. */
|
|
20
|
+
export interface SpacesHomeChoice {
|
|
21
|
+
/** `''` or `'local'` for this computer, else a saved server's id. */
|
|
22
|
+
value: string;
|
|
23
|
+
/** The saved servers that can be the home server. */
|
|
24
|
+
servers: readonly {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
offline?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
/** Picks a home (`'local'` or a server id). */
|
|
30
|
+
onChange: (value: string) => void;
|
|
31
|
+
}
|
|
15
32
|
/** Props of {@link SpacesSection}. */
|
|
16
33
|
export interface SpacesSectionProps {
|
|
34
|
+
/** Where the spaces come from (the desktop app, with saved servers). Absent: this app's own list, no row. */
|
|
35
|
+
home?: SpacesHomeChoice;
|
|
17
36
|
/**
|
|
18
37
|
* What a space shows under its name row (its defaults for new sessions). `update` patches the space in
|
|
19
38
|
* the list. Absent: nothing.
|
|
@@ -31,4 +50,4 @@ export interface SpacesSectionProps {
|
|
|
31
50
|
*
|
|
32
51
|
* @param props - The per-space rows, `className` and `style`.
|
|
33
52
|
*/
|
|
34
|
-
export declare function SpacesSection({ renderDefaults, media, className, style }: SpacesSectionProps): import("react").JSX.Element | null;
|
|
53
|
+
export declare function SpacesSection({ home, renderDefaults, media, className, style }: SpacesSectionProps): import("react").JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useConfirm } from "../../app/useConfirm.js";
|
|
2
2
|
import { FloatingSurface } from "../../components/floating/FloatingSurface.js";
|
|
3
3
|
import { usePopover } from "../../components/floating/usePopover.js";
|
|
4
|
-
import { FormSection, INPUT_CLASS, ROW_CLASS, SwitchRow } from "../../components/Form.js";
|
|
4
|
+
import { ErrorNote, FormSection, INPUT_CLASS, ROW_CLASS, SegmentedRow, SwitchRow } from "../../components/Form.js";
|
|
5
5
|
import { IconButton } from "../../components/IconButton.js";
|
|
6
6
|
import { useTooltip } from "../../components/Tooltip.js";
|
|
7
7
|
import { useSettingsDocument, useSettingsHost } from "../../settings/SettingsProvider.js";
|
|
@@ -17,7 +17,7 @@ import { DEFAULT_SPACE_ID, newSpaceId, normalizeSpaces } from "zidane/chat/pure"
|
|
|
17
17
|
*
|
|
18
18
|
* @param props - The per-space rows, `className` and `style`.
|
|
19
19
|
*/
|
|
20
|
-
function SpacesSection({ renderDefaults, media, className = "", style }) {
|
|
20
|
+
function SpacesSection({ home, renderDefaults, media, className = "", style }) {
|
|
21
21
|
const labels = useSidebarLabels();
|
|
22
22
|
const host = useSettingsHost();
|
|
23
23
|
const document = useSettingsDocument();
|
|
@@ -28,7 +28,11 @@ function SpacesSection({ renderDefaults, media, className = "", style }) {
|
|
|
28
28
|
const stored = normalizeSpaces(settings.spaceList);
|
|
29
29
|
const spaces = stored.filter((s) => !s.extensionId);
|
|
30
30
|
const placed = stored.filter((s) => s.extensionId);
|
|
31
|
-
const
|
|
31
|
+
const homeServer = home?.servers.find((s) => s.id === home.value);
|
|
32
|
+
const readOnly = homeServer?.offline === true;
|
|
33
|
+
const patch = (next) => {
|
|
34
|
+
if (!readOnly) host.update?.(next).catch(() => void 0);
|
|
35
|
+
};
|
|
32
36
|
const write = (next) => patch({ spaceList: normalizeSpaces([...next, ...placed]) });
|
|
33
37
|
const update = (id, change) => write(spaces.map((s) => s.id === id ? change(s) : s));
|
|
34
38
|
const move = (index, delta) => {
|
|
@@ -57,18 +61,35 @@ function SpacesSection({ renderDefaults, media, className = "", style }) {
|
|
|
57
61
|
style,
|
|
58
62
|
children: [/* @__PURE__ */ jsxs(FormSection, {
|
|
59
63
|
title: labels.spacesTitle,
|
|
60
|
-
children: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
children: [
|
|
65
|
+
media && /* @__PURE__ */ jsx("div", {
|
|
66
|
+
className: "zg-toggle-card-media",
|
|
67
|
+
children: media
|
|
68
|
+
}),
|
|
69
|
+
home && home.servers.length > 0 && /* @__PURE__ */ jsx(SegmentedRow, {
|
|
70
|
+
label: labels.spacesHome,
|
|
71
|
+
description: labels.spacesHomeDescription,
|
|
72
|
+
value: homeServer ? homeServer.id : "local",
|
|
73
|
+
onChange: home.onChange,
|
|
74
|
+
options: [{
|
|
75
|
+
value: "local",
|
|
76
|
+
label: labels.spacesHomeLocal
|
|
77
|
+
}, ...home.servers.map((s) => ({
|
|
78
|
+
value: s.id,
|
|
79
|
+
label: s.name
|
|
80
|
+
}))]
|
|
81
|
+
}),
|
|
82
|
+
readOnly && homeServer && /* @__PURE__ */ jsx(ErrorNote, { children: labels.spacesHomeOffline(homeServer.name) }),
|
|
83
|
+
/* @__PURE__ */ jsx(SwitchRow, {
|
|
84
|
+
label: labels.useSpaces,
|
|
85
|
+
description: labels.useSpacesDescription,
|
|
86
|
+
on,
|
|
87
|
+
onToggle: () => patch({ spaces: !on })
|
|
88
|
+
})
|
|
89
|
+
]
|
|
69
90
|
}), on && /* @__PURE__ */ jsx(FormSection, {
|
|
70
91
|
title: labels.yourSpaces,
|
|
71
|
-
trailing: /* @__PURE__ */ jsx(IconButton, {
|
|
92
|
+
trailing: readOnly ? void 0 : /* @__PURE__ */ jsx(IconButton, {
|
|
72
93
|
icon: "i-ph-plus",
|
|
73
94
|
label: labels.addSpace,
|
|
74
95
|
title: labels.addSpace,
|
|
@@ -17,7 +17,7 @@ import { SidebarRowView, SidebarRowViewProps } from "./SidebarRowView.js";
|
|
|
17
17
|
import { SidebarSearchRow, SidebarSearchRowProps } from "./SidebarSearchRow.js";
|
|
18
18
|
import { SidebarRowHandlers, SidebarSessionRow, SidebarSessionRowProps } from "./SidebarSessionRow.js";
|
|
19
19
|
import { SidebarToggleButton, SidebarToggleButtonProps } from "./SidebarToggleButton.js";
|
|
20
|
-
import { SpacesSection, SpacesSectionProps } from "./SpacesSection.js";
|
|
20
|
+
import { SpacesHomeChoice, SpacesSection, SpacesSectionProps } from "./SpacesSection.js";
|
|
21
21
|
import { SpaceGlyph, SpaceGlyphProps, SpaceSwitcher, SpaceSwitcherProps } from "./SpaceSwitcher.js";
|
|
22
22
|
import { useMainSession } from "./use-main-session.js";
|
|
23
23
|
import { useCompactionProgress } from "./useCompactionProgress.js";
|
|
@@ -29,4 +29,4 @@ import { SessionDirectoryView, useSessionDirectoryView } from "./useSessionDirec
|
|
|
29
29
|
import { SessionContentSearch, useSessionSearch } from "./useSessionSearch.js";
|
|
30
30
|
import { SidebarKeyboardNavOptions, useSidebarKeyboardNav } from "./useSidebarKeyboardNav.js";
|
|
31
31
|
import { useSidebarLabels } from "./useSidebarLabels.js";
|
|
32
|
-
export { ARRIVAL_MS, type BadgeCardPlacement, EnvironmentChip, type EnvironmentChipProps, ICON_PICKER_WIDTH, IconPicker, type IconPickerProps, MainSessionRow, type MainSessionRowProps, NewSessionButton, type NewSessionButtonProps, ProjectChip, type ProjectChipProps, ProjectIconButton, type ProjectIconButtonProps, ProjectIconGlyph, type ProjectIconGlyphProps, type RowProject, type SessionContentSearch, type SessionDirectoryView, type SessionMenuActions, type SessionMenuContext, type SessionMenuSurfaceActions, type SessionMenuTarget, SessionSidebar, type SessionSidebarProps, type SidebarBadgeFocus, SidebarChip, type SidebarChipProps, type SidebarChromeInset, type SidebarCollapsedStore, SidebarCompactingIndicator, type SidebarCompactingIndicatorProps, SidebarDecoration, type SidebarDecorationProps, SidebarFilterMenu, type SidebarFilterMenuProps, SidebarFooter, type SidebarFooterProps, SidebarFrame, type SidebarFrameOptions, type SidebarFrameProps, type SidebarFrameState, SidebarGroupHeader, type SidebarGroupHeaderProps, type SidebarHeaderRow, SidebarHostProvider, type SidebarHostProviderProps, type SidebarKeyboardNavOptions, type SidebarLive, type SidebarLiveOptions, type SidebarNotify, SidebarPreview, type SidebarPreviewProps, type SidebarProject, type SidebarProjectRef, type SidebarRowArtifactsProps, type SidebarRowHandlers, type SidebarRowMetaProps, type SidebarRowSession, SidebarRowView, type SidebarRowViewProps, SidebarSearchRow, type SidebarSearchRowProps, SidebarSessionRow, type SidebarSessionRowProps, type SidebarSettingsNote, SidebarSignInPrompt, type SidebarSignInPromptProps, type SidebarSpaceSlide, SidebarToggleButton, type SidebarToggleButtonProps, SidebarUsageIndicator, type SidebarUsageIndicatorProps, SpaceGlyph, type SpaceGlyphProps, SpaceSwitcher, type SpaceSwitcherProps, SpacesSection, type SpacesSectionProps, archiveProjectPrompt, createSidebarCollapsed, createSidebarLive, deleteProjectPrompt, sessionMenuItems, spaceRows, useArrival, useCompactionProgress, useConfirmDeleteSession, useEnvironmentActions, useEnvironmentCommands, useMainSession, usePendingRemoval, usePinnedProjects, useProjectIcons, useProjectSessionActions, useSaveViewAsSpace, useSessionActivity, useSessionBadges, useSessionDirectoryView, useSessionMenuItems, useSessionSearch, useSidebarFrame, useSidebarHost, useSidebarKeyboardNav, useSidebarLabels, useSidebarNotice };
|
|
32
|
+
export { ARRIVAL_MS, type BadgeCardPlacement, EnvironmentChip, type EnvironmentChipProps, ICON_PICKER_WIDTH, IconPicker, type IconPickerProps, MainSessionRow, type MainSessionRowProps, NewSessionButton, type NewSessionButtonProps, ProjectChip, type ProjectChipProps, ProjectIconButton, type ProjectIconButtonProps, ProjectIconGlyph, type ProjectIconGlyphProps, type RowProject, type SessionContentSearch, type SessionDirectoryView, type SessionMenuActions, type SessionMenuContext, type SessionMenuSurfaceActions, type SessionMenuTarget, SessionSidebar, type SessionSidebarProps, type SidebarBadgeFocus, SidebarChip, type SidebarChipProps, type SidebarChromeInset, type SidebarCollapsedStore, SidebarCompactingIndicator, type SidebarCompactingIndicatorProps, SidebarDecoration, type SidebarDecorationProps, SidebarFilterMenu, type SidebarFilterMenuProps, SidebarFooter, type SidebarFooterProps, SidebarFrame, type SidebarFrameOptions, type SidebarFrameProps, type SidebarFrameState, SidebarGroupHeader, type SidebarGroupHeaderProps, type SidebarHeaderRow, SidebarHostProvider, type SidebarHostProviderProps, type SidebarKeyboardNavOptions, type SidebarLive, type SidebarLiveOptions, type SidebarNotify, SidebarPreview, type SidebarPreviewProps, type SidebarProject, type SidebarProjectRef, type SidebarRowArtifactsProps, type SidebarRowHandlers, type SidebarRowMetaProps, type SidebarRowSession, SidebarRowView, type SidebarRowViewProps, SidebarSearchRow, type SidebarSearchRowProps, SidebarSessionRow, type SidebarSessionRowProps, type SidebarSettingsNote, SidebarSignInPrompt, type SidebarSignInPromptProps, type SidebarSpaceSlide, SidebarToggleButton, type SidebarToggleButtonProps, SidebarUsageIndicator, type SidebarUsageIndicatorProps, SpaceGlyph, type SpaceGlyphProps, SpaceSwitcher, type SpaceSwitcherProps, type SpacesHomeChoice, SpacesSection, type SpacesSectionProps, archiveProjectPrompt, createSidebarCollapsed, createSidebarLive, deleteProjectPrompt, sessionMenuItems, spaceRows, useArrival, useCompactionProgress, useConfirmDeleteSession, useEnvironmentActions, useEnvironmentCommands, useMainSession, usePendingRemoval, usePinnedProjects, useProjectIcons, useProjectSessionActions, useSaveViewAsSpace, useSessionActivity, useSessionBadges, useSessionDirectoryView, useSessionMenuItems, useSessionSearch, useSidebarFrame, useSidebarHost, useSidebarKeyboardNav, useSidebarLabels, useSidebarNotice };
|
|
@@ -48,6 +48,8 @@ export interface SessionMenuActions {
|
|
|
48
48
|
remove: () => void;
|
|
49
49
|
/** Set a failed environment up again. */
|
|
50
50
|
retryEnvironment: () => void;
|
|
51
|
+
/** Start a paused environment now. Absent: no row. */
|
|
52
|
+
wakeEnvironment?: () => void;
|
|
51
53
|
/** Run one of the environment's commands. */
|
|
52
54
|
runEnvironmentAction: (actionId: string, label: string) => void;
|
|
53
55
|
/** Move to another space. */
|
|
@@ -92,13 +94,20 @@ export declare function useEnvironmentActions(sessionId: string, enabled: boolea
|
|
|
92
94
|
/**
|
|
93
95
|
* Running an environment command (open what it returns, else say what happened) and setting a failed
|
|
94
96
|
* environment up again, worded through the labels and told with the provider's `notify`. Stable identities.
|
|
97
|
+
* `retry` settles once the host took the request (a failure is told, never thrown), so a caller can send
|
|
98
|
+
* what waited for it after. `wake` starts a paused environment now, told the same way; absent when the host
|
|
99
|
+
* can't (no "Wake up"). `pause` pauses an idle one now, the same way; absent when the host can't (no "Pause"). `remove` deletes its
|
|
100
|
+
* sandbox, the same way; absent when the host can't.
|
|
95
101
|
*/
|
|
96
102
|
export declare function useEnvironmentCommands(): {
|
|
97
103
|
run: (sessionId: string, actionId: string, label: string) => void;
|
|
98
|
-
retry: (sessionId: string) => void
|
|
104
|
+
retry: (sessionId: string) => Promise<void>;
|
|
105
|
+
wake: ((sessionId: string) => Promise<void>) | undefined;
|
|
106
|
+
pause: ((sessionId: string) => Promise<void>) | undefined;
|
|
107
|
+
remove: ((sessionId: string) => Promise<void>) | undefined;
|
|
99
108
|
};
|
|
100
109
|
/** Which actions {@link useSessionMenuItems} needs from its surface; the environment rows come from the host. */
|
|
101
|
-
export type SessionMenuSurfaceActions = Omit<SessionMenuActions, 'retryEnvironment' | 'runEnvironmentAction'>;
|
|
110
|
+
export type SessionMenuSurfaceActions = Omit<SessionMenuActions, 'retryEnvironment' | 'wakeEnvironment' | 'runEnvironmentAction'>;
|
|
102
111
|
/**
|
|
103
112
|
* A conversation's menu rows for a surface that shows one session (the session header): the environment's
|
|
104
113
|
* commands are asked for while the menu is `open`, and the platform rows follow the {@link SidebarHost}.
|
|
@@ -2,6 +2,7 @@ import { toast } from "../../app/toast.js";
|
|
|
2
2
|
import { useConfirm } from "../../app/useConfirm.js";
|
|
3
3
|
import { errorMessage } from "../../components/report-error.js";
|
|
4
4
|
import { useLinkRouter } from "../../extensions/links.js";
|
|
5
|
+
import { isExternalEnvironment } from "../../session/headless/place.js";
|
|
5
6
|
import { deleteSessionPrompt, runsInRemoteSandbox } from "../headless/sidebar/environment.js";
|
|
6
7
|
import { deferRemoval } from "./pending-removals.js";
|
|
7
8
|
import { useSidebarHost, useSidebarNotice } from "./SidebarHostProvider.js";
|
|
@@ -94,6 +95,12 @@ function sessionMenuItems(session, context, actions, labels) {
|
|
|
94
95
|
onSelect: () => void openWindow(id, "panels").catch(ignore)
|
|
95
96
|
}
|
|
96
97
|
] : [],
|
|
98
|
+
...actions.wakeEnvironment && environment === "ready" && !session.environment?.resuming && isExternalEnvironment(session.environment) ? [{
|
|
99
|
+
id: "wake-environment",
|
|
100
|
+
label: labels.menuWakeEnvironment,
|
|
101
|
+
group: "environment",
|
|
102
|
+
onSelect: actions.wakeEnvironment
|
|
103
|
+
}] : [],
|
|
97
104
|
...environment === "failed" ? [{
|
|
98
105
|
id: "retry-environment",
|
|
99
106
|
label: labels.menuRetryEnvironment,
|
|
@@ -158,6 +165,10 @@ function useEnvironmentActions(sessionId, enabled) {
|
|
|
158
165
|
/**
|
|
159
166
|
* Running an environment command (open what it returns, else say what happened) and setting a failed
|
|
160
167
|
* environment up again, worded through the labels and told with the provider's `notify`. Stable identities.
|
|
168
|
+
* `retry` settles once the host took the request (a failure is told, never thrown), so a caller can send
|
|
169
|
+
* what waited for it after. `wake` starts a paused environment now, told the same way; absent when the host
|
|
170
|
+
* can't (no "Wake up"). `pause` pauses an idle one now, the same way; absent when the host can't (no "Pause"). `remove` deletes its
|
|
171
|
+
* sandbox, the same way; absent when the host can't.
|
|
161
172
|
*/
|
|
162
173
|
function useEnvironmentCommands() {
|
|
163
174
|
const environment = useSidebarHost().environment;
|
|
@@ -179,17 +190,50 @@ function useEnvironmentCommands() {
|
|
|
179
190
|
labels,
|
|
180
191
|
links
|
|
181
192
|
]);
|
|
182
|
-
const retry = useCallback((sessionId) => {
|
|
183
|
-
environment?.retry(sessionId).catch((err) => notify(labels.retryEnvironmentFailed(errorMessage(err))));
|
|
193
|
+
const retry = useCallback(async (sessionId) => {
|
|
194
|
+
await environment?.retry(sessionId).catch((err) => notify(labels.retryEnvironmentFailed(errorMessage(err))));
|
|
184
195
|
}, [
|
|
185
196
|
environment,
|
|
186
197
|
notify,
|
|
187
198
|
labels
|
|
188
199
|
]);
|
|
200
|
+
const hostWake = environment?.wake;
|
|
201
|
+
const wake = useMemo(() => hostWake ? async (sessionId) => {
|
|
202
|
+
await hostWake(sessionId).catch((err) => notify(labels.wakeEnvironmentFailed(errorMessage(err))));
|
|
203
|
+
} : void 0, [
|
|
204
|
+
hostWake,
|
|
205
|
+
notify,
|
|
206
|
+
labels
|
|
207
|
+
]);
|
|
208
|
+
const hostPause = environment?.pause;
|
|
209
|
+
const pause = useMemo(() => hostPause ? async (sessionId) => {
|
|
210
|
+
await hostPause(sessionId).catch((err) => notify(labels.pauseEnvironmentFailed(errorMessage(err))));
|
|
211
|
+
} : void 0, [
|
|
212
|
+
hostPause,
|
|
213
|
+
notify,
|
|
214
|
+
labels
|
|
215
|
+
]);
|
|
216
|
+
const hostRemove = environment?.remove;
|
|
217
|
+
const remove = useMemo(() => hostRemove ? async (sessionId) => {
|
|
218
|
+
await hostRemove(sessionId).catch((err) => notify(labels.deleteEnvironmentFailed(errorMessage(err))));
|
|
219
|
+
} : void 0, [
|
|
220
|
+
hostRemove,
|
|
221
|
+
notify,
|
|
222
|
+
labels
|
|
223
|
+
]);
|
|
189
224
|
return useMemo(() => ({
|
|
190
225
|
run,
|
|
191
|
-
retry
|
|
192
|
-
|
|
226
|
+
retry,
|
|
227
|
+
wake,
|
|
228
|
+
pause,
|
|
229
|
+
remove
|
|
230
|
+
}), [
|
|
231
|
+
run,
|
|
232
|
+
retry,
|
|
233
|
+
wake,
|
|
234
|
+
pause,
|
|
235
|
+
remove
|
|
236
|
+
]);
|
|
193
237
|
}
|
|
194
238
|
/**
|
|
195
239
|
* A conversation's menu rows for a surface that shows one session (the session header): the environment's
|
|
@@ -210,7 +254,8 @@ function useSessionMenuItems(session, spaces, open, actions) {
|
|
|
210
254
|
host
|
|
211
255
|
}, {
|
|
212
256
|
...actions,
|
|
213
|
-
retryEnvironment: () => commands.retry(session.id),
|
|
257
|
+
retryEnvironment: () => void commands.retry(session.id),
|
|
258
|
+
...commands.wake ? { wakeEnvironment: () => void commands.wake(session.id) } : {},
|
|
214
259
|
runEnvironmentAction: (actionId, label) => commands.run(session.id, actionId, label)
|
|
215
260
|
}, labels);
|
|
216
261
|
}
|
|
@@ -277,7 +277,7 @@ function BadgeLine({ sessionId, startedFromKey, entry, host, project, environmen
|
|
|
277
277
|
className: "zg-row-extra",
|
|
278
278
|
"data-grow": growIn ? "" : void 0,
|
|
279
279
|
children: /* @__PURE__ */ jsxs("div", {
|
|
280
|
-
className: "zg-badge-strip pt-1",
|
|
280
|
+
className: "zg-badge-strip zg-scroll-fade-x pt-1",
|
|
281
281
|
"data-testid": "row-artifacts",
|
|
282
282
|
children: [
|
|
283
283
|
project && /* @__PURE__ */ jsx(ProjectChip, { project }),
|