zidane-ui 9.2.3 → 9.4.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/adapters/live.d.ts +8 -0
- package/dist/adapters/live.js +19 -8
- package/dist/adapters/server-composer-host.js +22 -9
- package/dist/adapters/server-git-host.js +5 -2
- package/dist/adapters/server-host.js +158 -27
- package/dist/adapters/server-machines-host.js +7 -0
- package/dist/adapters/server-media.d.ts +9 -1
- package/dist/adapters/server-media.js +14 -1
- package/dist/adapters/server-session-host.js +49 -0
- package/dist/adapters/server-settings-sections.js +4 -1
- package/dist/adapters/sse-host.js +3 -0
- package/dist/adapters/sse-protocol.d.ts +10 -0
- package/dist/appearance/ZoomIndicator.js +5 -8
- package/dist/chat/HostTranscript.d.ts +0 -12
- package/dist/chat/HostTranscript.js +20 -1
- package/dist/chat/SessionStreamsProvider.d.ts +9 -1
- package/dist/chat/SessionStreamsProvider.js +11 -2
- package/dist/chat/Transcript.d.ts +21 -11
- package/dist/chat/Transcript.js +346 -161
- package/dist/chat/composer/ModelOptionsPicker.js +6 -2
- package/dist/chat/composer/ModelPicker.d.ts +1 -1
- package/dist/chat/composer/PlacePicker.d.ts +3 -1
- package/dist/chat/composer/PlacePicker.js +5 -1
- package/dist/chat/composer/use-draft-target.js +15 -3
- package/dist/chat/headless/block-runs.js +26 -1
- package/dist/chat/headless/chip-views.js +1 -1
- package/dist/chat/headless/draft-target.d.ts +28 -1
- package/dist/chat/headless/draft-target.js +22 -1
- package/dist/chat/headless/host.d.ts +43 -7
- package/dist/chat/headless/hosts.d.ts +4 -0
- package/dist/chat/headless/index.d.ts +27 -26
- package/dist/chat/headless/index.js +15 -14
- package/dist/chat/headless/labels.d.ts +17 -0
- package/dist/chat/headless/labels.js +17 -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 +64 -0
- package/dist/chat/headless/markdown-scan.js +119 -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/prompt-origin.d.ts +2 -0
- package/dist/chat/headless/prompt-origin.js +6 -2
- package/dist/chat/headless/session-list.d.ts +10 -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 +19 -2
- package/dist/chat/headless/sidebar/directory.js +19 -51
- package/dist/chat/headless/sidebar/environment.d.ts +15 -4
- package/dist/chat/headless/sidebar/environment.js +27 -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 +19 -2
- package/dist/chat/headless/sidebar/labels.js +8 -1
- 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 +4 -2
- package/dist/chat/headless/streams/actions.js +2 -1
- package/dist/chat/headless/streams/event-bytes.d.ts +17 -0
- package/dist/chat/headless/streams/event-bytes.js +46 -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 +45 -6
- package/dist/chat/headless/streams/store.js +85 -31
- package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
- package/dist/chat/headless/streams/transcript-map.js +85 -0
- package/dist/chat/headless/streams/transcript.d.ts +4 -2
- package/dist/chat/headless/streams/transcript.js +19 -7
- package/dist/chat/headless/streams/types.d.ts +2 -1
- 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 +35 -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-attachments.d.ts +2 -0
- package/dist/chat/headless/transcript/fold-attachments.js +3 -2
- package/dist/chat/headless/transcript/fold.d.ts +2 -1
- package/dist/chat/headless/transcript/fold.js +16 -6
- 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 -2
- package/dist/chat/headless/transcript/index.js +2 -2
- package/dist/chat/headless/transcript/nesting.js +2 -1
- package/dist/chat/headless/transcript/rail.d.ts +50 -1
- package/dist/chat/headless/transcript/rail.js +165 -23
- package/dist/chat/headless/transcript/rows.d.ts +5 -1
- package/dist/chat/headless/transcript/run-failures.js +2 -1
- 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/index.d.ts +9 -8
- package/dist/chat/index.js +18 -17
- package/dist/chat/sidebar/ProjectIcon.js +1 -1
- package/dist/chat/sidebar/RowChips.js +2 -2
- package/dist/chat/sidebar/SessionSidebar.d.ts +6 -0
- package/dist/chat/sidebar/SessionSidebar.js +23 -16
- package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
- package/dist/chat/sidebar/SidebarFold.js +17 -16
- package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
- package/dist/chat/sidebar/SidebarFooter.js +6 -6
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +7 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +11 -8
- package/dist/chat/sidebar/session-menu.d.ts +4 -0
- package/dist/chat/sidebar/session-menu.js +14 -2
- package/dist/chat/sidebar/sidebar-live.js +28 -4
- package/dist/chat/sidebar/useInboxRows.js +6 -6
- package/dist/chat/sidebar/useInboxTriage.js +50 -47
- package/dist/chat/sidebar/useSessionSearch.js +19 -18
- package/dist/chat/testing/contract.d.ts +5 -3
- package/dist/chat/testing/contract.js +66 -1
- 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/FileChip.js +28 -0
- package/dist/chat/transcript/LazyRow.d.ts +40 -40
- package/dist/chat/transcript/LazyRow.js +100 -149
- package/dist/chat/transcript/MermaidDiagram.js +2 -1
- package/dist/chat/transcript/PromptEcho.js +3 -11
- package/dist/chat/transcript/SessionChip.d.ts +11 -0
- package/dist/chat/transcript/SessionChip.js +34 -0
- package/dist/chat/transcript/SubagentBlock.js +3 -2
- package/dist/chat/transcript/TranscriptRail.d.ts +25 -2
- package/dist/chat/transcript/TranscriptRail.js +175 -17
- package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
- package/dist/chat/transcript/TranscriptRow.js +4 -3
- package/dist/chat/transcript/actions.d.ts +37 -1
- package/dist/chat/transcript/actions.js +27 -1
- package/dist/chat/transcript/chip-details.d.ts +11 -0
- package/dist/chat/transcript/chip-details.js +17 -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 +5 -3
- package/dist/chat/transcript/fold.js +13 -4
- package/dist/chat/transcript/index.d.ts +11 -10
- package/dist/chat/transcript/index.js +10 -9
- package/dist/chat/transcript/markdown-cache.d.ts +17 -2
- package/dist/chat/transcript/markdown-cache.js +48 -4
- package/dist/chat/transcript/markdown.js +110 -55
- package/dist/chat/transcript/media-gallery.d.ts +3 -2
- package/dist/chat/transcript/media-gallery.js +19 -19
- package/dist/chat/transcript/messages.js +5 -4
- package/dist/chat/transcript/notices.js +2 -1
- package/dist/chat/transcript/prompt.d.ts +1 -1
- package/dist/chat/transcript/prompt.js +6 -4
- package/dist/chat/transcript/prose.js +2 -1
- 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 +184 -0
- package/dist/chat/transcript/row-mount.js +532 -0
- package/dist/chat/transcript/row-parking.d.ts +152 -0
- package/dist/chat/transcript/row-parking.js +171 -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 +3 -2
- package/dist/chat/transcript/script-input.d.ts +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 -6
- 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 +25 -8
- package/dist/chat/transcript/use-transcript-rows.js +28 -46
- package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
- package/dist/chat/transcript/useHistoryBackfill.js +170 -0
- package/dist/chat/transcript/useStickToBottom.js +2 -3
- package/dist/chat/transcript/useTranscriptFind.js +2 -4
- package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
- package/dist/chat/transcript/useTranscriptScroll.js +12 -1
- package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
- package/dist/chat/transcript/useTranscriptSearch.js +35 -19
- package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
- package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
- package/dist/chat/transcript/view-scope.d.ts +26 -6
- package/dist/chat/transcript/view-scope.js +106 -20
- package/dist/code/editor/FileTree.d.ts +2 -0
- package/dist/code/editor/FileTree.js +1 -1
- package/dist/code/editor/FileView.js +16 -25
- package/dist/code/editor/find/useFind.js +17 -17
- package/dist/code/editor/useCodeDocument.js +22 -19
- package/dist/code/editor/useDetachCleanup.js +4 -3
- package/dist/code/use-highlighted-html.js +12 -13
- package/dist/components/IconButton.d.ts +3 -1
- package/dist/components/IconButton.js +7 -2
- package/dist/components/IconButtonTip.d.ts +3 -1
- package/dist/components/IconButtonTip.js +2 -1
- package/dist/components/RowActionsMenu.js +7 -14
- package/dist/components/Tooltip.d.ts +4 -1
- package/dist/components/Tooltip.js +8 -6
- package/dist/components/assign-ref.d.ts +8 -0
- package/dist/components/assign-ref.js +12 -0
- package/dist/components/floating/FloatingSurface.js +2 -2
- package/dist/components/floating/HoverCard.js +32 -14
- package/dist/components/floating/Popover.js +4 -7
- package/dist/components/floating/useAnchoredPosition.d.ts +5 -3
- package/dist/components/floating/useAnchoredPosition.js +7 -7
- package/dist/components/object-key.d.ts +7 -0
- package/dist/components/object-key.js +18 -0
- package/dist/components/palette/PaletteList.js +2 -7
- package/dist/components/tooltip-arming.d.ts +3 -0
- package/dist/components/tooltip-arming.js +8 -1
- package/dist/core.css +3 -3
- package/dist/dist/{index-E1Z0aPmi.d.ts → index-BheVJOLc.d.ts} +3 -1
- package/dist/dist/index.d.ts +2 -2
- package/dist/files/FilesTab.js +0 -1
- package/dist/files/TreeColumn.d.ts +2 -4
- package/dist/files/TreeColumn.js +0 -5
- package/dist/files/headless/host.d.ts +3 -7
- package/dist/files/headless/labels.d.ts +0 -1
- package/dist/files/headless/labels.js +0 -1
- package/dist/files/headless/workspace-diff.js +1 -1
- package/dist/files/useCodeReview.js +1 -3
- package/dist/files/useFilesDiagnostics.d.ts +1 -1
- package/dist/files/useFilesDiagnostics.js +4 -11
- package/dist/files/useOpenFiles.js +9 -12
- package/dist/files/useWorkspace.d.ts +5 -7
- package/dist/files/useWorkspace.js +4 -15
- package/dist/git/GitBar.js +5 -3
- package/dist/git/MoveSessionDialog.d.ts +18 -8
- package/dist/git/MoveSessionDialog.js +32 -53
- package/dist/git/MoveToDialog.d.ts +61 -0
- package/dist/git/MoveToDialog.js +240 -0
- package/dist/git/SandboxManager.js +9 -4
- package/dist/git/SyncChip.js +11 -4
- package/dist/git/TeleportSessionDialog.d.ts +69 -0
- package/dist/git/TeleportSessionDialog.js +440 -0
- package/dist/git/headless/host.d.ts +14 -0
- package/dist/git/headless/index.d.ts +2 -1
- package/dist/git/headless/index.js +2 -1
- package/dist/git/headless/labels.d.ts +44 -1
- package/dist/git/headless/labels.js +50 -0
- package/dist/git/headless/sandboxes.d.ts +1 -1
- package/dist/git/headless/sandboxes.js +4 -3
- package/dist/git/headless/teleport.d.ts +76 -0
- package/dist/git/headless/teleport.js +19 -0
- package/dist/git/index.d.ts +4 -2
- package/dist/git/index.js +4 -2
- package/dist/git/useEnvironmentChoices.d.ts +5 -2
- package/dist/git/useEnvironmentChoices.js +12 -4
- package/dist/hooks/useLatest.d.ts +8 -0
- package/dist/hooks/useLatest.js +17 -0
- package/dist/hooks/useMinuteTick.d.ts +6 -2
- package/dist/hooks/useMinuteTick.js +12 -6
- package/dist/hooks/useNearViewport.js +11 -8
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/keybindings/KeybindingsProvider.js +3 -4
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +18 -0
- package/dist/machines/AddServerForm.js +55 -3
- package/dist/machines/Banners.d.ts +2 -2
- package/dist/machines/Banners.js +3 -3
- package/dist/machines/DaemonMenu.js +1 -3
- package/dist/machines/HostsSection.js +5 -1
- package/dist/machines/OrganizationPanel.d.ts +25 -0
- package/dist/machines/OrganizationPanel.js +266 -0
- package/dist/machines/PersonalLayerPanel.d.ts +32 -0
- package/dist/machines/PersonalLayerPanel.js +360 -0
- package/dist/machines/headless/fixture-host.d.ts +10 -0
- package/dist/machines/headless/fixture-host.js +44 -0
- package/dist/machines/headless/host.d.ts +21 -1
- package/dist/machines/headless/index.d.ts +3 -1
- package/dist/machines/headless/index.js +3 -1
- package/dist/machines/headless/labels.d.ts +55 -0
- package/dist/machines/headless/labels.js +58 -1
- package/dist/machines/headless/layer.d.ts +64 -0
- package/dist/machines/headless/layer.js +56 -0
- package/dist/machines/headless/organization.d.ts +38 -0
- package/dist/machines/headless/organization.js +44 -0
- package/dist/machines/index.d.ts +3 -1
- package/dist/machines/index.js +3 -1
- package/dist/machines/testing/contract.d.ts +25 -1
- package/dist/machines/testing/contract.js +97 -1
- package/dist/motion/grow.js +12 -13
- package/dist/motion/swap.js +2 -5
- package/dist/motion/use-flip-list.d.ts +14 -0
- package/dist/motion/use-flip-list.js +17 -12
- package/dist/palette/headless/app-sources.js +37 -0
- package/dist/palette/headless/labels.js +3 -0
- package/dist/server/sse-handler.js +25 -2
- package/dist/session/DiffFileTree.js +1 -4
- package/dist/session/OpenSessionsDialog.d.ts +46 -0
- package/dist/session/OpenSessionsDialog.js +170 -0
- package/dist/session/PlanTracker.js +1 -2
- package/dist/session/ProjectHome.js +10 -9
- package/dist/session/RemindersPanel.js +10 -12
- package/dist/session/SecretsPanel.js +2 -1
- package/dist/session/SessionHeader.js +1 -0
- package/dist/session/SessionPeopleStack.d.ts +23 -0
- package/dist/session/SessionPeopleStack.js +65 -0
- package/dist/session/SessionPlaceMenu.js +5 -4
- package/dist/session/ShareSessionDialog.d.ts +32 -0
- package/dist/session/ShareSessionDialog.js +342 -0
- package/dist/session/TypingLine.d.ts +22 -0
- package/dist/session/TypingLine.js +31 -0
- package/dist/session/headless/host.d.ts +40 -1
- package/dist/session/headless/index.d.ts +4 -2
- package/dist/session/headless/index.js +3 -1
- package/dist/session/headless/labels.d.ts +49 -0
- package/dist/session/headless/labels.js +56 -0
- package/dist/session/headless/people.d.ts +29 -0
- package/dist/session/headless/people.js +53 -0
- package/dist/session/headless/place.d.ts +5 -0
- package/dist/session/headless/place.js +5 -1
- package/dist/session/headless/typing.d.ts +37 -0
- package/dist/session/headless/typing.js +60 -0
- package/dist/session/index.d.ts +5 -1
- package/dist/session/index.js +5 -1
- package/dist/settings/headless/fixture-performance.js +4 -2
- package/dist/settings/headless/performance.d.ts +4 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/headless/sections-host.d.ts +7 -2
- package/dist/settings/section.d.ts +15 -3
- package/dist/settings/section.js +15 -3
- package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
- package/dist/settings/sections/keybindings/labels.d.ts +3 -0
- package/dist/settings/sections/keybindings/labels.js +3 -0
- package/dist/settings/sections/keybindings/rows.js +12 -0
- package/dist/settings/sections/logs/LogsSection.js +5 -8
- 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/styles.css +65 -9
- package/dist/terminal/HostTerminalSurface.js +28 -30
- package/dist/terminal/TerminalPanel.js +4 -12
- package/dist/terminal/TerminalProvider.d.ts +10 -2
- package/dist/terminal/TerminalProvider.js +10 -2
- package/dist/terminal/headless/labels.d.ts +0 -1
- package/dist/terminal/headless/labels.js +1 -2
- package/dist/terminal/headless/store.js +5 -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/LayoutBudget.js +1 -7
- package/package.json +2 -2
- package/src/styles/chat.css +3 -1
- package/src/styles/palette.css +3 -3
- package/src/styles/transcript.css +50 -5
- /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
|
@@ -12,6 +12,7 @@ import { useRef, useState } from "react";
|
|
|
12
12
|
function useTooltipArming() {
|
|
13
13
|
const [armed, setArmed] = useState(null);
|
|
14
14
|
const inside = useRef(false);
|
|
15
|
+
const pressedRef = useRef(false);
|
|
15
16
|
const [handlers] = useState(() => ({
|
|
16
17
|
onMouseEnter: () => {
|
|
17
18
|
inside.current = true;
|
|
@@ -19,13 +20,19 @@ function useTooltipArming() {
|
|
|
19
20
|
},
|
|
20
21
|
onMouseLeave: () => {
|
|
21
22
|
inside.current = false;
|
|
23
|
+
pressedRef.current = false;
|
|
22
24
|
},
|
|
23
|
-
onFocus: () => setArmed((a) => a ?? "focus")
|
|
25
|
+
onFocus: () => setArmed((a) => a ?? "focus"),
|
|
26
|
+
onPointerDown: () => {
|
|
27
|
+
pressedRef.current = true;
|
|
28
|
+
}
|
|
24
29
|
}));
|
|
25
30
|
const [pointerInside] = useState(() => () => inside.current);
|
|
31
|
+
const [pressed] = useState(() => () => pressedRef.current);
|
|
26
32
|
return {
|
|
27
33
|
armed,
|
|
28
34
|
pointerInside,
|
|
35
|
+
pressed,
|
|
29
36
|
handlers
|
|
30
37
|
};
|
|
31
38
|
}
|
package/dist/core.css
CHANGED
|
@@ -3715,8 +3715,8 @@ html[data-motion='reduced'] .zg-seg > span:nth-child(-n + 3) {
|
|
|
3715
3715
|
|
|
3716
3716
|
/* Command palette. The cursor is one block under the rows that glides to
|
|
3717
3717
|
the marked row (a transform: no layout, no repaint of the rows); a new list
|
|
3718
|
-
puts
|
|
3719
|
-
own, so hover and keyboard mark the same way. */
|
|
3718
|
+
puts a new one in place at once (`PaletteList` keys it by the list). The rows
|
|
3719
|
+
draw no background of their own, so hover and keyboard mark the same way. */
|
|
3720
3720
|
.zg-palette-cursor {
|
|
3721
3721
|
position: absolute;
|
|
3722
3722
|
top: 0;
|
|
@@ -3760,7 +3760,7 @@ html[data-motion='reduced'] .zg-seg > span:nth-child(-n + 3) {
|
|
|
3760
3760
|
/* `snap`'s curve, quicker: the cursor follows a held arrow key, so it must
|
|
3761
3761
|
land before the next repeat. Scaling the duration keeps every motion mode
|
|
3762
3762
|
(springs off: the tween; reduced, off: 0ms). */
|
|
3763
|
-
.zg-palette-cursor
|
|
3763
|
+
.zg-palette-cursor {
|
|
3764
3764
|
transition: transform calc(var(--zg-motion-snap-duration) * 0.6) var(--zg-motion-snap-ease);
|
|
3765
3765
|
}
|
|
3766
3766
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import "./execution-failure-SREfl-EZ.js";
|
|
2
2
|
import "./timeout-CmTx6V9y.js";
|
|
3
|
+
import "./index-ttmMvjgM.js";
|
|
4
|
+
import "./sandbox-CSUihARm.js";
|
|
3
5
|
import "./oauth-callback-page-CV9oTMGy.js";
|
|
4
6
|
import "../node_modules/.bun/hookable@6.1.2/node_modules/hookable/dist/index.js";
|
|
5
7
|
import "../node_modules/.bun/@earendil-works_pi-ai@1.5.2_46b80fae64c053ae/node_modules/@earendil-works/pi-ai/dist/index.js";
|
|
@@ -1679,4 +1681,4 @@ interface Settings {
|
|
|
1679
1681
|
*/
|
|
1680
1682
|
activeIcon: string;
|
|
1681
1683
|
}
|
|
1682
|
-
export {
|
|
1684
|
+
export { ScriptLineProgress as $A, DurabilityMode as $F, TaskOutcomeCounts as AM, AnsiSpan as Dj, EditDiffDisplay as EO, OpenInTarget as FO, NewChatPlace as Fj, ToolCallDisplay as JO, MessageDelivery as MO, AnsiStyle as Oj, ScriptCallStatus as QA, SessionSort as SL, OutputStream as Sj, ApprovalMode as TO, AnsiColor as Tj, Settings as UO, SidebarLayout as WO, TranscriptDensity as XO, ViewsMcp as ZO, QueryBound as aL, ScriptProgress as aj, SessionQueryNot as bL, SessionFieldName as cL, SessionGroupBy as dL, SessionGroupOrder as fL, SessionQueryAny as gL, SessionQueryAll as hL, McpJobViewStatus as hN, FacetPath as iL, ScriptOutputLine as ij, InteractionMode as jO, TaskOutcome as kM, SecretTtl as kR, SessionFieldPath as lL, SessionQuery as mL, McpJobView as mN, QueryValue as oL, EnvironmentConfigValue as oP, Space$1 as ok, SessionCondition as sL, ThinkingLevel as sU, SpaceIcon as sk, EnvironmentSettings as wN, OutputLine as xj };
|
package/dist/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SL as SessionSort, aL as QueryBound, bL as SessionQueryNot, cL as SessionFieldName, dL as SessionGroupBy, fL as SessionGroupOrder, gL as SessionQueryAny, hL as SessionQueryAll, iL as FacetPath, lL as SessionFieldPath, mL as SessionQuery, oL as QueryValue, oP as EnvironmentConfigValue, sL as SessionCondition, sU as ThinkingLevel } from "./index-BheVJOLc.js";
|
|
2
2
|
import "./execution-failure-SREfl-EZ.js";
|
|
3
3
|
import { d as AuthFailureKind, u as AuthFailure } from "./timeout-CmTx6V9y.js";
|
|
4
|
-
import "./index-
|
|
4
|
+
import "./index-ttmMvjgM.js";
|
|
5
5
|
import "./sandbox-CSUihARm.js";
|
|
6
6
|
import "./oauth-callback-page-CV9oTMGy.js";
|
package/dist/files/FilesTab.js
CHANGED
|
@@ -259,7 +259,6 @@ function FilesTab({ scope, layout: layoutStore, chat = null, useEdits = useNoEdi
|
|
|
259
259
|
width: layout.filesTreeWidth ?? TREE_WIDTH.default,
|
|
260
260
|
controlRef: treeControl,
|
|
261
261
|
entries,
|
|
262
|
-
truncated: workspace.truncated,
|
|
263
262
|
onExpandFolder: workspace.openFolder,
|
|
264
263
|
gitStatus: workspace.status,
|
|
265
264
|
selectedPath: selected,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { FilesTreeSide } from "../appearance/headless/prefs.js";
|
|
9
9
|
import { FileTreeControl, FileTreeEditing } from "../code/editor/FileTree.js";
|
|
10
10
|
import { FileActionTarget } from "./file-actions.js";
|
|
11
|
-
import { GitStatusEntry, WorkspaceEntry
|
|
11
|
+
import { GitStatusEntry, WorkspaceEntry } from "./headless/host.js";
|
|
12
12
|
import { FilesLayoutStore } from "./headless/view.js";
|
|
13
13
|
import { KeyboardEvent, ReactNode, RefObject } from "react";
|
|
14
14
|
export declare const TREE_WIDTH: {
|
|
@@ -27,9 +27,7 @@ export interface TreeColumnProps {
|
|
|
27
27
|
width: number;
|
|
28
28
|
controlRef: RefObject<FileTreeControl | null>;
|
|
29
29
|
entries: WorkspaceEntry[] | null;
|
|
30
|
-
/**
|
|
31
|
-
truncated?: WorkspaceListing['truncated'] | null;
|
|
32
|
-
/** An ignored folder (one node) was opened: list what is under it. */
|
|
30
|
+
/** An ignored or deferred folder (one node) was opened: list what is under it. */
|
|
33
31
|
onExpandFolder?: (path: string) => void;
|
|
34
32
|
gitStatus: GitStatusEntry[];
|
|
35
33
|
selectedPath: string | null;
|
package/dist/files/TreeColumn.js
CHANGED
|
@@ -150,11 +150,6 @@ const TreeColumn = memo((p) => {
|
|
|
150
150
|
})
|
|
151
151
|
]
|
|
152
152
|
}),
|
|
153
|
-
p.truncated && !p.search && /* @__PURE__ */ jsx("p", {
|
|
154
|
-
className: "zg-meta shrink-0 mx-3 mb-1 truncate",
|
|
155
|
-
title: labels.filesTruncated(p.truncated.shown, p.truncated.total, !!p.truncated.atLeast),
|
|
156
|
-
children: labels.filesTruncated(p.truncated.shown, p.truncated.total, !!p.truncated.atLeast)
|
|
157
|
-
}),
|
|
158
153
|
p.notice && !p.search && /* @__PURE__ */ jsx(Notice, {
|
|
159
154
|
tone: "error",
|
|
160
155
|
compact: true,
|
|
@@ -24,17 +24,13 @@ export interface WorkspaceEntry {
|
|
|
24
24
|
kind: 'file' | 'dir';
|
|
25
25
|
/** Gitignored (only present when listed with `showIgnored`). An ignored folder is one node: list it with `dir` to open it. */
|
|
26
26
|
ignored?: boolean;
|
|
27
|
+
/** A folder not walked yet (a big folder outside a repository): one node, list it with `dir` to open it. */
|
|
28
|
+
deferred?: boolean;
|
|
27
29
|
}
|
|
28
|
-
/** A folder's listing
|
|
30
|
+
/** A folder's listing. */
|
|
29
31
|
export interface WorkspaceListing {
|
|
30
32
|
/** The entries. */
|
|
31
33
|
entries: WorkspaceEntry[];
|
|
32
|
-
/** Set when the listing was cut: how many it holds and how many there are (`atLeast`: more than that). */
|
|
33
|
-
truncated?: {
|
|
34
|
-
shown: number;
|
|
35
|
-
total: number;
|
|
36
|
-
atLeast?: boolean;
|
|
37
|
-
};
|
|
38
34
|
}
|
|
39
35
|
/** The media kinds a browser plays on its own. */
|
|
40
36
|
export type MediaKind = 'image' | 'video' | 'audio' | 'pdf';
|
|
@@ -18,7 +18,6 @@ export declare const DEFAULT_FILES_LABELS: {
|
|
|
18
18
|
filesRefresh: string;
|
|
19
19
|
filesNoChanged: string;
|
|
20
20
|
filesEmptyFolder: string;
|
|
21
|
-
filesTruncated: (shown: number, total: number, atLeast: boolean) => string;
|
|
22
21
|
filesOpenFiles: string;
|
|
23
22
|
filesPickFile: string;
|
|
24
23
|
/** Under the editor's empty title. */
|
|
@@ -20,7 +20,6 @@ const DEFAULT_FILES_LABELS = {
|
|
|
20
20
|
filesRefresh: "Refresh",
|
|
21
21
|
filesNoChanged: "No changed files",
|
|
22
22
|
filesEmptyFolder: "Empty folder",
|
|
23
|
-
filesTruncated: (shown, total, atLeast) => `Showing ${shown.toLocaleString()} of ${total.toLocaleString()}${atLeast ? "+" : ""}: search to find more`,
|
|
24
23
|
filesOpenFiles: "Open files",
|
|
25
24
|
filesPickFile: "No file open",
|
|
26
25
|
/** Under the editor's empty title. */
|
|
@@ -5,7 +5,7 @@ function sameEntries(a, b) {
|
|
|
5
5
|
for (let i = 0; i < a.length; i++) {
|
|
6
6
|
const x = a[i];
|
|
7
7
|
const y = b[i];
|
|
8
|
-
if (x.path !== y.path || x.kind !== y.kind || Boolean(x.ignored) !== Boolean(y.ignored)) return false;
|
|
8
|
+
if (x.path !== y.path || x.kind !== y.kind || Boolean(x.ignored) !== Boolean(y.ignored) || Boolean(x.deferred) !== Boolean(y.deferred)) return false;
|
|
9
9
|
}
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
@@ -50,9 +50,7 @@ function useCodeReview({ filePath, kind, excerptOf, extraItems, chat }) {
|
|
|
50
50
|
setSelected(range);
|
|
51
51
|
if (chat) setDraft(range);
|
|
52
52
|
}, [chat]);
|
|
53
|
-
|
|
54
|
-
if (!chat) setDraft(null);
|
|
55
|
-
}, [chat]);
|
|
53
|
+
if (!chat && draft !== null) setDraft(null);
|
|
56
54
|
const submitDraft = (text) => {
|
|
57
55
|
if (!draft || !chat || !text.trim()) return;
|
|
58
56
|
const body = serializeReviewComment({
|
|
@@ -7,5 +7,5 @@ export type SeverityCounts = ReturnType<typeof countBySeverity>;
|
|
|
7
7
|
*/
|
|
8
8
|
export type DiagnosticsVersion = number | string | null | undefined | readonly unknown[] | object;
|
|
9
9
|
export declare function useFilesDiagnostics(cwd: string | null, paths: readonly string[], version: DiagnosticsVersion): ReadonlyMap<string, SeverityCounts> | null;
|
|
10
|
-
/** Primitive versions pass through; an object version becomes `length:
|
|
10
|
+
/** Primitive versions pass through; an object version becomes `length:number`, a number per identity. */
|
|
11
11
|
export declare function useVersionKey(version: DiagnosticsVersion): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { countBySeverity } from "../code/editor/diagnostics.js";
|
|
2
|
+
import { objectKey } from "../components/object-key.js";
|
|
2
3
|
import { useDiagnosticsRun } from "./useDiagnosticsRun.js";
|
|
3
|
-
import { useMemo
|
|
4
|
+
import { useMemo } from "react";
|
|
4
5
|
// src/files/useFilesDiagnostics.ts
|
|
5
6
|
function useFilesDiagnostics(cwd, paths, version) {
|
|
6
7
|
const { result } = useDiagnosticsRun(cwd, paths, {
|
|
@@ -15,17 +16,9 @@ function useFilesDiagnostics(cwd, paths, version) {
|
|
|
15
16
|
return new Map([...byPath].map(([p, items]) => [p, countBySeverity(items)]));
|
|
16
17
|
}, [result]);
|
|
17
18
|
}
|
|
18
|
-
/** Primitive versions pass through; an object version becomes `length:
|
|
19
|
+
/** Primitive versions pass through; an object version becomes `length:number`, a number per identity. */
|
|
19
20
|
function useVersionKey(version) {
|
|
20
|
-
const last = useRef({
|
|
21
|
-
value: version,
|
|
22
|
-
counter: 0
|
|
23
|
-
});
|
|
24
21
|
if (version === null || version === void 0 || typeof version !== "object") return String(version);
|
|
25
|
-
|
|
26
|
-
value: version,
|
|
27
|
-
counter: last.current.counter + 1
|
|
28
|
-
};
|
|
29
|
-
return `${Array.isArray(version) ? version.length : 0}:${last.current.counter}`;
|
|
22
|
+
return `${Array.isArray(version) ? version.length : 0}:${objectKey(version)}`;
|
|
30
23
|
}
|
|
31
24
|
export { useFilesDiagnostics, useVersionKey };
|
|
@@ -34,27 +34,24 @@ function useOpenFiles(scope, layout, layoutStore, prefs, source) {
|
|
|
34
34
|
useEffect(() => {
|
|
35
35
|
for (const f of open) retired.current.delete(f.path);
|
|
36
36
|
}, [open]);
|
|
37
|
-
const holding =
|
|
37
|
+
const [holding, setHolding] = useState(() => ({
|
|
38
38
|
buffers,
|
|
39
39
|
slots: /* @__PURE__ */ new Map()
|
|
40
|
-
});
|
|
41
|
-
if (holding.
|
|
40
|
+
}));
|
|
41
|
+
if (holding.buffers !== buffers) setHolding({
|
|
42
42
|
buffers,
|
|
43
43
|
slots: /* @__PURE__ */ new Map()
|
|
44
|
-
};
|
|
45
|
-
const slots = holding.
|
|
44
|
+
});
|
|
45
|
+
const slots = holding.slots;
|
|
46
46
|
const editKey = useCallback((path) => {
|
|
47
47
|
let held = slots.get(path);
|
|
48
48
|
if (!held) slots.set(path, held = buffers.claim(path));
|
|
49
49
|
return buffers.key(path, held);
|
|
50
50
|
}, [buffers, slots]);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
h.slots.clear();
|
|
56
|
-
};
|
|
57
|
-
}, [buffers]);
|
|
51
|
+
useEffect(() => () => {
|
|
52
|
+
for (const [p, s] of holding.slots) holding.buffers.release(p, s);
|
|
53
|
+
holding.slots.clear();
|
|
54
|
+
}, [holding]);
|
|
58
55
|
const resetEditSession = useCallback((path) => {
|
|
59
56
|
const held = slots.get(path);
|
|
60
57
|
if (held) slots.set(path, buffers.reset(path, held));
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* when the repository moves (`folder-changes`), debounced: a run emitting
|
|
6
6
|
* ten results in a second costs one listing, not ten.
|
|
7
7
|
*
|
|
8
|
-
* An ignored folder comes as one node; `openFolder` lists what
|
|
9
|
-
* (`FilesHost.list` with `dir`) when the tree opens it, and
|
|
10
|
-
* lists the opened ones again.
|
|
8
|
+
* An ignored or deferred folder comes as one node; `openFolder` lists what
|
|
9
|
+
* is under it (`FilesHost.list` with `dir`) when the tree opens it, and
|
|
10
|
+
* every refresh lists the opened ones again.
|
|
11
11
|
*/
|
|
12
12
|
import { SessionEditEvent } from "../session/headless/session-diffs.js";
|
|
13
|
-
import { FilesScope, GitStatusEntry, WorkspaceEntry
|
|
13
|
+
import { FilesScope, GitStatusEntry, WorkspaceEntry } from "./headless/host.js";
|
|
14
14
|
import { SessionEditsHook } from "./tab-hooks.js";
|
|
15
15
|
export interface Workspace {
|
|
16
16
|
/** null while the first listing is in flight. */
|
|
@@ -22,9 +22,7 @@ export interface Workspace {
|
|
|
22
22
|
refresh: () => Promise<void>;
|
|
23
23
|
/** Fires after the folder may have changed, debounced (same trigger as `refresh`). */
|
|
24
24
|
onToolResult: (handler: () => void) => () => void;
|
|
25
|
-
/**
|
|
26
|
-
truncated: WorkspaceListing['truncated'] | null;
|
|
27
|
-
/** Lists what is under an ignored folder (relative, no trailing `/`) into `entries`. */
|
|
25
|
+
/** Lists what is under an ignored or deferred folder (relative, no trailing `/`) into `entries`. */
|
|
28
26
|
openFolder: (dir: string) => void;
|
|
29
27
|
}
|
|
30
28
|
export declare function useWorkspace(scope: FilesScope, showIgnored: boolean,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useFilesHost } from "./FilesProvider.js";
|
|
2
2
|
import { filesRootOf } from "./headless/view.js";
|
|
3
|
-
import { editedPaths, sameEntries,
|
|
3
|
+
import { editedPaths, sameEntries, sameStatus } from "./headless/workspace-diff.js";
|
|
4
4
|
import { useFolderChanges } from "./useFolderChanges.js";
|
|
5
5
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
// src/files/useWorkspace.ts
|
|
@@ -9,7 +9,6 @@ const NO_FOLDERS = /* @__PURE__ */ new Map();
|
|
|
9
9
|
function useWorkspace(scope, showIgnored, visible, useEdits) {
|
|
10
10
|
const host = useFilesHost();
|
|
11
11
|
const [listed, setListed] = useState(null);
|
|
12
|
-
const [truncated, setTruncated] = useState(null);
|
|
13
12
|
const [opened, setOpened] = useState(NO_FOLDERS);
|
|
14
13
|
const openedRef = useRef(opened);
|
|
15
14
|
openedRef.current = opened;
|
|
@@ -41,7 +40,6 @@ function useWorkspace(scope, showIgnored, visible, useEdits) {
|
|
|
41
40
|
if (mine !== reads.current) return;
|
|
42
41
|
const list = listing.entries;
|
|
43
42
|
setListed((prev) => sameEntries(prev, list) ? prev : list);
|
|
44
|
-
setTruncated((prev) => sameTruncation(prev, listing.truncated) ? prev : listing.truncated ?? null);
|
|
45
43
|
setStatus((prev) => sameStatus(prev, git) ? prev : git);
|
|
46
44
|
if (folders.length > 0) setOpened((prev) => {
|
|
47
45
|
let changed = false;
|
|
@@ -63,7 +61,6 @@ function useWorkspace(scope, showIgnored, visible, useEdits) {
|
|
|
63
61
|
useEffect(() => {
|
|
64
62
|
generation.current++;
|
|
65
63
|
setListed(null);
|
|
66
|
-
setTruncated(null);
|
|
67
64
|
setOpened(NO_FOLDERS);
|
|
68
65
|
openedRef.current = NO_FOLDERS;
|
|
69
66
|
refresh();
|
|
@@ -118,14 +115,12 @@ function useWorkspace(scope, showIgnored, visible, useEdits) {
|
|
|
118
115
|
staleListing.current = false;
|
|
119
116
|
refresh();
|
|
120
117
|
}, [visible, refresh]);
|
|
121
|
-
const
|
|
122
|
-
const changedPaths = useMemo(() => {
|
|
118
|
+
const changedKey = useMemo(() => {
|
|
123
119
|
const set = editedPaths(edits);
|
|
124
120
|
for (const g of status) set.add(g.path);
|
|
125
|
-
|
|
126
|
-
lastChanged.current = set;
|
|
127
|
-
return set;
|
|
121
|
+
return [...set].sort().join("\0");
|
|
128
122
|
}, [edits, status]);
|
|
123
|
+
const changedPaths = useMemo(() => new Set(changedKey ? changedKey.split("\0") : []), [changedKey]);
|
|
129
124
|
return useMemo(() => ({
|
|
130
125
|
entries,
|
|
131
126
|
status,
|
|
@@ -133,7 +128,6 @@ function useWorkspace(scope, showIgnored, visible, useEdits) {
|
|
|
133
128
|
edits,
|
|
134
129
|
refresh,
|
|
135
130
|
onToolResult,
|
|
136
|
-
truncated,
|
|
137
131
|
openFolder
|
|
138
132
|
}), [
|
|
139
133
|
entries,
|
|
@@ -142,14 +136,9 @@ function useWorkspace(scope, showIgnored, visible, useEdits) {
|
|
|
142
136
|
edits,
|
|
143
137
|
refresh,
|
|
144
138
|
onToolResult,
|
|
145
|
-
truncated,
|
|
146
139
|
openFolder
|
|
147
140
|
]);
|
|
148
141
|
}
|
|
149
|
-
function sameTruncation(a, b) {
|
|
150
|
-
if (!a || !b) return !a && !b;
|
|
151
|
-
return a.shown === b.shown && a.total === b.total && a.atLeast === b.atLeast;
|
|
152
|
-
}
|
|
153
142
|
/**
|
|
154
143
|
* The listing with what each opened folder holds: an opened folder's own node (`dist/`) gives way to its contents,
|
|
155
144
|
* unless it holds nothing.
|
package/dist/git/GitBar.js
CHANGED
|
@@ -8,7 +8,7 @@ import { useGitLabels } from "./GitProvider.js";
|
|
|
8
8
|
import { compactCount } from "./headless/switcher.js";
|
|
9
9
|
import { GIT_BAR_ITEM, SyncChip } from "./SyncChip.js";
|
|
10
10
|
import { useGitBar } from "./useGitBar.js";
|
|
11
|
-
import { memo,
|
|
11
|
+
import { memo, useRef, useState } from "react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
// src/git/GitBar.tsx
|
|
14
14
|
const openInBrowser = (url) => void window.open(url, "_blank");
|
|
@@ -64,9 +64,11 @@ function Bar({ info, pr, cwd, sessionId, running, onSwitched, onShowChanges, onO
|
|
|
64
64
|
const links = useLinkRouter();
|
|
65
65
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
66
66
|
const branchRef = useRef(null);
|
|
67
|
-
|
|
67
|
+
const [wasRunning, setWasRunning] = useState(running);
|
|
68
|
+
if (running !== wasRunning) {
|
|
69
|
+
setWasRunning(running);
|
|
68
70
|
if (running) setMenuOpen(false);
|
|
69
|
-
}
|
|
71
|
+
}
|
|
70
72
|
const { changes } = info;
|
|
71
73
|
return /* @__PURE__ */ jsxs("div", {
|
|
72
74
|
"data-testid": "git-bar",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
* moveSession?.({ sessionId, cwd, kind, hasTurns: true });
|
|
22
22
|
*/
|
|
23
23
|
import { MoveSessionSubject } from "./headless/move.js";
|
|
24
|
-
import { CSSProperties } from "react";
|
|
24
|
+
import { CSSProperties, ReactNode } from "react";
|
|
25
|
+
/** The id of {@link MoveSessionDialog}'s heading, for the layer that labels itself with it. */
|
|
26
|
+
export declare const MOVE_SESSION_TITLE_ID = "move-session-title";
|
|
25
27
|
/** Props for {@link MoveSessionDialog}. */
|
|
26
28
|
export interface MoveSessionDialogProps {
|
|
27
29
|
/** The session to move. */
|
|
@@ -30,6 +32,20 @@ export interface MoveSessionDialogProps {
|
|
|
30
32
|
onDone: () => void;
|
|
31
33
|
/** Closed without moving. */
|
|
32
34
|
onCancel: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* The kind already picked (Move to…'s where menu): the dialog opens on its folder and confirmation, and Back goes
|
|
37
|
+
* to {@link MoveSessionDialogProps.onBack}. Absent: it opens on the list of kinds.
|
|
38
|
+
*/
|
|
39
|
+
initial?: {
|
|
40
|
+
kind: string;
|
|
41
|
+
branch?: string;
|
|
42
|
+
};
|
|
43
|
+
/** Back from the first step shown (with {@link MoveSessionDialogProps.initial}). */
|
|
44
|
+
onBack?: () => void;
|
|
45
|
+
/** Shown above the steps (what happened before this one). */
|
|
46
|
+
lead?: ReactNode;
|
|
47
|
+
/** The Cancel button's words. Default: Cancel. */
|
|
48
|
+
cancelLabel?: string;
|
|
33
49
|
/** Extra class names for the root. */
|
|
34
50
|
className?: string;
|
|
35
51
|
/** Inline styles on the root element. */
|
|
@@ -40,10 +56,4 @@ export interface MoveSessionDialogProps {
|
|
|
40
56
|
*
|
|
41
57
|
* @param props - The {@link MoveSessionDialogProps}.
|
|
42
58
|
*/
|
|
43
|
-
export declare function MoveSessionDialog({ subject, onDone, onCancel, className, style }: MoveSessionDialogProps): import("react").JSX.Element;
|
|
44
|
-
/**
|
|
45
|
-
* Opens the move dialog above whatever is open, over the `GitHost` in context. `undefined` without what it needs
|
|
46
|
-
* (`GitHost.moveSession` and `environments`, a modal layer): hide the control that calls it. The returned function
|
|
47
|
-
* resolves `true` once the session moved, `false` when closed.
|
|
48
|
-
*/
|
|
49
|
-
export declare function useMoveSession(): ((subject: MoveSessionSubject) => Promise<boolean>) | undefined;
|
|
59
|
+
export declare function MoveSessionDialog({ subject, onDone, onCancel, initial, onBack, lead, cancelLabel, className, style }: MoveSessionDialogProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useOptionalModal } from "../app/ModalProvider.js";
|
|
2
1
|
import { buttonClass } from "../components/button.js";
|
|
3
2
|
import { Checkbox, MetaChip } from "../components/Form.js";
|
|
4
3
|
import { MenuNote, MenuRow } from "../components/Menu.js";
|
|
@@ -11,10 +10,12 @@ import { environmentKindIcon } from "./headless/environment.js";
|
|
|
11
10
|
import { gitErrorText } from "./headless/labels.js";
|
|
12
11
|
import { leavesWorktree, moveChoices, moveListingCwd } from "./headless/move.js";
|
|
13
12
|
import { RemoteFolderBrowser } from "./RemoteFolderPicker.js";
|
|
14
|
-
import {
|
|
13
|
+
import { useEffect, useState } from "react";
|
|
15
14
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
16
15
|
// src/git/MoveSessionDialog.tsx
|
|
17
|
-
|
|
16
|
+
/** The id of {@link MoveSessionDialog}'s heading, for the layer that labels itself with it. */
|
|
17
|
+
const MOVE_SESSION_TITLE_ID = "move-session-title";
|
|
18
|
+
const TITLE_ID = MOVE_SESSION_TITLE_ID;
|
|
18
19
|
/** How a folder is picked on a target: browsed there, with the native dialog, or not at all. */
|
|
19
20
|
function folderPicking(host, choice, subject) {
|
|
20
21
|
if (!host) return null;
|
|
@@ -27,7 +28,7 @@ function folderPicking(host, choice, subject) {
|
|
|
27
28
|
*
|
|
28
29
|
* @param props - The {@link MoveSessionDialogProps}.
|
|
29
30
|
*/
|
|
30
|
-
function MoveSessionDialog({ subject, onDone, onCancel, className, style }) {
|
|
31
|
+
function MoveSessionDialog({ subject, onDone, onCancel, initial, onBack, lead, cancelLabel, className, style }) {
|
|
31
32
|
const host = useGitHost();
|
|
32
33
|
const labels = useGitLabels();
|
|
33
34
|
const [choices, setChoices] = useState(null);
|
|
@@ -42,6 +43,15 @@ function MoveSessionDialog({ subject, onDone, onCancel, className, style }) {
|
|
|
42
43
|
/** The session moved, its old worktree kept: why, shown before the dialog closes. */
|
|
43
44
|
const [kept, setKept] = useState(null);
|
|
44
45
|
const offersRemoval = leavesWorktree(subject);
|
|
46
|
+
const pick = (choice) => {
|
|
47
|
+
setPicked(choice);
|
|
48
|
+
setFolder(null);
|
|
49
|
+
setBranch("");
|
|
50
|
+
setError(null);
|
|
51
|
+
setRemoveWorktree(false);
|
|
52
|
+
setBrowsing(choice.needsFolder && folderPicking(host, choice, subject) === "browse");
|
|
53
|
+
if (choice.needsFolder && folderPicking(host, choice, subject) === "native") pickNative();
|
|
54
|
+
};
|
|
45
55
|
const listEnvironments = host?.environments;
|
|
46
56
|
const listingCwd = moveListingCwd(subject);
|
|
47
57
|
const { hostId } = subject;
|
|
@@ -53,7 +63,17 @@ function MoveSessionDialog({ subject, onDone, onCancel, className, style }) {
|
|
|
53
63
|
...listingCwd ? { cwd: listingCwd } : {},
|
|
54
64
|
...hostId !== void 0 ? { hostId } : {}
|
|
55
65
|
}).then((descriptors) => {
|
|
56
|
-
if (live)
|
|
66
|
+
if (!live) return;
|
|
67
|
+
const listed = moveChoices(descriptors, subject);
|
|
68
|
+
setChoices(listed);
|
|
69
|
+
const chosen = initial ? listed.find((choice) => choice.descriptor.kind === initial.kind) : void 0;
|
|
70
|
+
if (initial && chosen?.pickable) {
|
|
71
|
+
pick(chosen);
|
|
72
|
+
setBranch(initial.branch ?? "");
|
|
73
|
+
} else if (initial) setError({
|
|
74
|
+
message: labels.gitMoveUnavailable,
|
|
75
|
+
...chosen?.reason ? { detail: chosen.reason } : {}
|
|
76
|
+
});
|
|
57
77
|
}).catch((err) => {
|
|
58
78
|
if (!live) return;
|
|
59
79
|
setChoices([]);
|
|
@@ -70,21 +90,13 @@ function MoveSessionDialog({ subject, onDone, onCancel, className, style }) {
|
|
|
70
90
|
listingCwd,
|
|
71
91
|
hostId
|
|
72
92
|
]);
|
|
73
|
-
const pick = (choice) => {
|
|
74
|
-
setPicked(choice);
|
|
75
|
-
setFolder(null);
|
|
76
|
-
setBranch("");
|
|
77
|
-
setError(null);
|
|
78
|
-
setRemoveWorktree(false);
|
|
79
|
-
setBrowsing(choice.needsFolder && folderPicking(host, choice, subject) === "browse");
|
|
80
|
-
if (choice.needsFolder && folderPicking(host, choice, subject) === "native") pickNative();
|
|
81
|
-
};
|
|
82
93
|
async function pickNative() {
|
|
83
94
|
const chosen = await host?.pickFolder?.().catch(() => null);
|
|
84
95
|
if (chosen) setFolder(chosen);
|
|
85
96
|
}
|
|
86
97
|
const back = () => {
|
|
87
98
|
if (browsing && folder !== null) return setBrowsing(false);
|
|
99
|
+
if (onBack) return onBack();
|
|
88
100
|
setPicked(null);
|
|
89
101
|
setBrowsing(false);
|
|
90
102
|
setFolder(null);
|
|
@@ -135,7 +147,8 @@ function MoveSessionDialog({ subject, onDone, onCancel, className, style }) {
|
|
|
135
147
|
className: "m-0 mt-1 text-zg-ui text-[var(--zg-text-muted)]",
|
|
136
148
|
children: !picked ? labels.gitMoveWhere : browsing || shownFolder === null ? labels.gitMovePickFolder(picked.name) : subject.hasTurns ?? true ? labels.gitMoveConfirm(picked.name) : picked.name
|
|
137
149
|
})] }),
|
|
138
|
-
|
|
150
|
+
lead,
|
|
151
|
+
!picked && !initial && /* @__PURE__ */ jsx("div", {
|
|
139
152
|
role: "menu",
|
|
140
153
|
"aria-label": labels.gitMoveWhere,
|
|
141
154
|
className: "flex flex-col max-h-[min(360px,50vh)] overflow-y-auto",
|
|
@@ -156,6 +169,7 @@ function MoveSessionDialog({ subject, onDone, onCancel, className, style }) {
|
|
|
156
169
|
onClick: () => pick(choice)
|
|
157
170
|
}, choice.descriptor.kind))
|
|
158
171
|
}),
|
|
172
|
+
!picked && initial && choices === null && /* @__PURE__ */ jsx(MenuNote, { children: labels.gitMoveLoading }),
|
|
159
173
|
picked && browsing && /* @__PURE__ */ jsx(RemoteFolderBrowser, {
|
|
160
174
|
...subject.hostId !== void 0 ? { hostId: subject.hostId } : {},
|
|
161
175
|
...machine ? { machineId: machine.id } : {},
|
|
@@ -246,7 +260,7 @@ function MoveSessionDialog({ subject, onDone, onCancel, className, style }) {
|
|
|
246
260
|
className: buttonClass({ variant: "solid" }),
|
|
247
261
|
children: labels.gitMoveDone
|
|
248
262
|
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
249
|
-
picked && /* @__PURE__ */ jsx("button", {
|
|
263
|
+
(picked || onBack) && /* @__PURE__ */ jsx("button", {
|
|
250
264
|
type: "button",
|
|
251
265
|
onClick: back,
|
|
252
266
|
disabled: moving,
|
|
@@ -258,7 +272,7 @@ function MoveSessionDialog({ subject, onDone, onCancel, className, style }) {
|
|
|
258
272
|
onClick: onCancel,
|
|
259
273
|
disabled: moving,
|
|
260
274
|
className: buttonClass({ variant: "secondary" }),
|
|
261
|
-
children: labels.gitMoveCancel
|
|
275
|
+
children: cancelLabel ?? labels.gitMoveCancel
|
|
262
276
|
}),
|
|
263
277
|
/* @__PURE__ */ jsx("button", {
|
|
264
278
|
type: "button",
|
|
@@ -272,39 +286,4 @@ function MoveSessionDialog({ subject, onDone, onCancel, className, style }) {
|
|
|
272
286
|
})]
|
|
273
287
|
});
|
|
274
288
|
}
|
|
275
|
-
|
|
276
|
-
* Opens the move dialog above whatever is open, over the `GitHost` in context. `undefined` without what it needs
|
|
277
|
-
* (`GitHost.moveSession` and `environments`, a modal layer): hide the control that calls it. The returned function
|
|
278
|
-
* resolves `true` once the session moved, `false` when closed.
|
|
279
|
-
*/
|
|
280
|
-
function useMoveSession() {
|
|
281
|
-
const host = useGitHost();
|
|
282
|
-
const modal = useOptionalModal();
|
|
283
|
-
const openLayer = modal?.openLayer;
|
|
284
|
-
const closeLayer = modal?.closeLayer;
|
|
285
|
-
const offered = Boolean(host?.moveSession && host.environments && openLayer && closeLayer);
|
|
286
|
-
const open = useCallback((subject) => new Promise((resolve) => {
|
|
287
|
-
if (!openLayer || !closeLayer) return resolve(false);
|
|
288
|
-
const previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
289
|
-
const settle = (moved) => {
|
|
290
|
-
resolve(moved);
|
|
291
|
-
requestAnimationFrame(() => previousFocus?.focus());
|
|
292
|
-
};
|
|
293
|
-
openLayer(/* @__PURE__ */ jsx(MoveSessionDialog, {
|
|
294
|
-
subject,
|
|
295
|
-
onDone: () => {
|
|
296
|
-
closeLayer();
|
|
297
|
-
settle(true);
|
|
298
|
-
},
|
|
299
|
-
onCancel: () => {
|
|
300
|
-
closeLayer();
|
|
301
|
-
settle(false);
|
|
302
|
-
}
|
|
303
|
-
}), {
|
|
304
|
-
onDismiss: () => settle(false),
|
|
305
|
-
labelledBy: TITLE_ID
|
|
306
|
-
});
|
|
307
|
-
}), [openLayer, closeLayer]);
|
|
308
|
-
return offered ? open : void 0;
|
|
309
|
-
}
|
|
310
|
-
export { MoveSessionDialog, useMoveSession };
|
|
289
|
+
export { MOVE_SESSION_TITLE_ID, MoveSessionDialog };
|