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
|
@@ -1,132 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RowMountContext } from "./row-mount.js";
|
|
2
|
+
import { RowKeyContext } from "./row-ui-state.js";
|
|
3
|
+
import { createContext, useContext, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { flushSync } from "react-dom";
|
|
5
5
|
// src/chat/transcript/LazyRow.tsx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (!mount) continue;
|
|
24
|
-
forget(target);
|
|
25
|
-
mounts.push(mount);
|
|
26
|
-
}
|
|
27
|
-
if (mounts.length > 0) flushSync(() => mounts.forEach((mount) => mount(false)));
|
|
28
|
-
}
|
|
29
|
-
function lazyObservers(root) {
|
|
30
|
-
const key = root ?? document;
|
|
31
|
-
const hit = observersByRoot.get(key);
|
|
32
|
-
if (hit) return hit;
|
|
33
|
-
const pair = [new IntersectionObserver((entries) => {
|
|
34
|
-
for (const entry of entries) {
|
|
35
|
-
if (!entry.isIntersecting) continue;
|
|
36
|
-
const mount = pendingMounts.get(entry.target);
|
|
37
|
-
if (mount) queue.set(entry.target, mount);
|
|
38
|
-
}
|
|
39
|
-
schedulePump();
|
|
40
|
-
}, {
|
|
41
|
-
root,
|
|
42
|
-
rootMargin: MARGIN
|
|
43
|
-
}), new IntersectionObserver((entries) => mountNow(entries.filter((entry) => entry.isIntersecting).map((entry) => entry.target)), {
|
|
44
|
-
root,
|
|
45
|
-
rootMargin: NEAR_MARGIN
|
|
46
|
-
})];
|
|
47
|
-
observersByRoot.set(key, pair);
|
|
48
|
-
return pair;
|
|
49
|
-
}
|
|
50
|
-
function forget(target) {
|
|
51
|
-
pendingMounts.delete(target);
|
|
52
|
-
queue.delete(target);
|
|
53
|
-
const pair = observedBy.get(target);
|
|
54
|
-
observedBy.delete(target);
|
|
55
|
-
pair?.[0].unobserve(target);
|
|
56
|
-
pair?.[1].unobserve(target);
|
|
6
|
+
const NO_FORCE = {
|
|
7
|
+
all: false,
|
|
8
|
+
needles: []
|
|
9
|
+
};
|
|
10
|
+
const holds = /* @__PURE__ */ new Set();
|
|
11
|
+
let forced = NO_FORCE;
|
|
12
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
13
|
+
function publish() {
|
|
14
|
+
const needles = /* @__PURE__ */ new Set();
|
|
15
|
+
let all = false;
|
|
16
|
+
for (const hold of holds) if (!hold.needles) all = true;
|
|
17
|
+
else hold.needles.forEach((n) => needles.add(n));
|
|
18
|
+
forced = holds.size === 0 ? NO_FORCE : {
|
|
19
|
+
all,
|
|
20
|
+
needles: [...needles]
|
|
21
|
+
};
|
|
22
|
+
for (const notify of subscribers) notify();
|
|
57
23
|
}
|
|
58
24
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* it outside React's render and effects: it commits synchronously.
|
|
25
|
+
* Holds rows mounted while a search is active: the rows whose text holds one
|
|
26
|
+
* of `needles` (lowercased), or every row without them. The transcript mounts
|
|
27
|
+
* them wherever they are, so a walk of the DOM finds their text. Returns the release.
|
|
63
28
|
*
|
|
64
|
-
* @param
|
|
65
|
-
*/
|
|
66
|
-
function mountRowNow(row) {
|
|
67
|
-
mountNow([row]);
|
|
68
|
-
}
|
|
69
|
-
function schedulePump() {
|
|
70
|
-
if (pumpScheduled || queue.size === 0) return;
|
|
71
|
-
pumpScheduled = true;
|
|
72
|
-
requestAnimationFrame(() => setTimeout(pump, 0));
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Distance from the visible part of the row's scroll root (0 = in view), and that view's height.
|
|
76
|
-
* `views` keeps each root's top and bottom for one pump: a root is measured once, not per row.
|
|
29
|
+
* @param needles - What the search looks for, lowercased; absent, every row.
|
|
77
30
|
*/
|
|
78
|
-
function
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (!view) {
|
|
83
|
-
const rect = root?.getBoundingClientRect();
|
|
84
|
-
view = rect ? [rect.top, rect.bottom] : [0, window.innerHeight];
|
|
85
|
-
views.set(root, view);
|
|
86
|
-
}
|
|
87
|
-
const [top, bottom] = view;
|
|
88
|
-
return [r.bottom >= top && r.top <= bottom ? 0 : r.top > bottom ? r.top - bottom : top - r.bottom, bottom - top];
|
|
89
|
-
}
|
|
90
|
-
function pump() {
|
|
91
|
-
pumpScheduled = false;
|
|
92
|
-
const views = /* @__PURE__ */ new Map();
|
|
93
|
-
const order = [...queue.keys()].filter((el) => el.isConnected).map((el) => [el, ...distanceToView(el, views)]).sort((a, b) => a[1] - b[1]);
|
|
94
|
-
const isNear = ([, distance, view]) => distance <= view;
|
|
95
|
-
mountNow(order.filter(isNear).map(([el]) => el));
|
|
96
|
-
const start = performance.now();
|
|
97
|
-
for (const entry of order) {
|
|
98
|
-
if (isNear(entry)) continue;
|
|
99
|
-
const el = entry[0];
|
|
100
|
-
if (performance.now() - start > BUDGET_MS) break;
|
|
101
|
-
const mount = queue.get(el);
|
|
102
|
-
forget(el);
|
|
103
|
-
if (mount) flushSync(() => mount(true));
|
|
104
|
-
}
|
|
105
|
-
for (const el of queue.keys()) if (!el.isConnected) queue.delete(el);
|
|
106
|
-
schedulePump();
|
|
107
|
-
}
|
|
108
|
-
/** How many active searches want every row mounted; any one is enough. */
|
|
109
|
-
let forceHolds = 0;
|
|
110
|
-
const subscribers = /* @__PURE__ */ new Set();
|
|
111
|
-
/** Every lazy row mounts while held (and stays mounted after release). Returns the release. */
|
|
112
|
-
function holdForceMountRows() {
|
|
113
|
-
forceHolds++;
|
|
114
|
-
if (forceHolds === 1) for (const notify of subscribers) notify();
|
|
31
|
+
function holdForceMountRows(needles) {
|
|
32
|
+
const hold = { needles: needles ?? null };
|
|
33
|
+
holds.add(hold);
|
|
34
|
+
publish();
|
|
115
35
|
let released = false;
|
|
116
36
|
return () => {
|
|
117
37
|
if (released) return;
|
|
118
38
|
released = true;
|
|
119
|
-
|
|
120
|
-
|
|
39
|
+
holds.delete(hold);
|
|
40
|
+
publish();
|
|
121
41
|
};
|
|
122
42
|
}
|
|
123
43
|
function subscribe(notify) {
|
|
124
44
|
subscribers.add(notify);
|
|
125
45
|
return () => subscribers.delete(notify);
|
|
126
46
|
}
|
|
127
|
-
const getForced = () =>
|
|
128
|
-
|
|
47
|
+
const getForced = () => forced;
|
|
48
|
+
const getForcing = () => forced !== NO_FORCE;
|
|
49
|
+
/** Returns whether a search holds rows mounted now (rows then render whole: no reveal over frames, groups open). */
|
|
129
50
|
function useForceMountRows() {
|
|
51
|
+
return useSyncExternalStore(subscribe, getForcing, getForcing);
|
|
52
|
+
}
|
|
53
|
+
/** What the active searches hold mounted ({@link holdForceMountRows}); a new object on every change. */
|
|
54
|
+
function useForcedRows() {
|
|
130
55
|
return useSyncExternalStore(subscribe, getForced, getForced);
|
|
131
56
|
}
|
|
132
57
|
/**
|
|
@@ -148,7 +73,10 @@ function CvRow({ style, children, className, ...rest }) {
|
|
|
148
73
|
style,
|
|
149
74
|
"data-quiet": quiet ? "" : void 0,
|
|
150
75
|
...rest,
|
|
151
|
-
children
|
|
76
|
+
children: rest["data-row"] === void 0 ? children : /* @__PURE__ */ jsx(RowKeyContext.Provider, {
|
|
77
|
+
value: rest["data-row"],
|
|
78
|
+
children
|
|
79
|
+
})
|
|
152
80
|
});
|
|
153
81
|
}
|
|
154
82
|
const BackgroundMount = createContext(false);
|
|
@@ -157,51 +85,74 @@ function useBackgroundMount() {
|
|
|
157
85
|
return useContext(BackgroundMount);
|
|
158
86
|
}
|
|
159
87
|
/**
|
|
160
|
-
* Renders a transcript row that mounts its content
|
|
88
|
+
* Renders a root transcript row that mounts its content when it nears the view, and keeps it: until then (and
|
|
89
|
+
* parked) an empty box of the row's height, its last measured height when known, without `content-visibility`.
|
|
161
90
|
*
|
|
162
|
-
* @param props - Row props: `
|
|
91
|
+
* @param props - Row props: `itemKey`, `estimatePx`, `style`, `children`, the row's id and the select-mode data attributes.
|
|
163
92
|
*/
|
|
164
|
-
function LazyRow({
|
|
165
|
-
const
|
|
166
|
-
const force = useForceMountRows();
|
|
167
|
-
const [near, setNear] = useState(eager);
|
|
168
|
-
const [background, setBackground] = useState(false);
|
|
93
|
+
function LazyRow({ itemKey, estimatePx, style, children, className, box = false, ...rest }) {
|
|
94
|
+
const mounter = useContext(RowMountContext);
|
|
169
95
|
const settling = useContext(TranscriptSettling);
|
|
170
|
-
const [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
96
|
+
const [state, setState] = useState(() => {
|
|
97
|
+
const start = mounter?.start(itemKey) ?? {
|
|
98
|
+
mounted: true,
|
|
99
|
+
eager: true,
|
|
100
|
+
seen: false
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
phase: start.mounted ? "mounted" : "lazy",
|
|
104
|
+
background: false,
|
|
105
|
+
parkedPx: void 0,
|
|
106
|
+
quiet: settling() || !start.eager || start.seen
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
const ref = useRef(null);
|
|
110
|
+
const phase = useRef(state.phase);
|
|
111
|
+
phase.current = state.phase;
|
|
112
|
+
useLayoutEffect(() => {
|
|
174
113
|
const el = ref.current;
|
|
175
|
-
if (!
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
114
|
+
if (!mounter || !el) return void 0;
|
|
115
|
+
return mounter.register({
|
|
116
|
+
key: itemKey,
|
|
117
|
+
el,
|
|
118
|
+
cv: !box,
|
|
119
|
+
phase: phase.current,
|
|
120
|
+
set: (next, background, parkedPx) => setState((s) => ({
|
|
121
|
+
...s,
|
|
122
|
+
phase: next,
|
|
123
|
+
background,
|
|
124
|
+
parkedPx
|
|
125
|
+
}))
|
|
186
126
|
});
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
127
|
+
}, [
|
|
128
|
+
mounter,
|
|
129
|
+
itemKey,
|
|
130
|
+
box
|
|
131
|
+
]);
|
|
132
|
+
const mounted = state.phase === "mounted";
|
|
133
|
+
const known = mounter?.sizeOf(itemKey);
|
|
134
|
+
const px = state.parkedPx ?? known ?? estimatePx;
|
|
135
|
+
const wrapperStyle = !mounted ? { height: px } : box ? void 0 : {
|
|
136
|
+
...style,
|
|
137
|
+
containIntrinsicSize: `auto ${Math.round(known ?? estimatePx)}px`
|
|
138
|
+
};
|
|
139
|
+
const rowKey = rest["data-row"];
|
|
191
140
|
return /* @__PURE__ */ jsx("div", {
|
|
192
141
|
ref,
|
|
193
|
-
className: ["zg-cv-row", className].filter(Boolean).join(" "),
|
|
194
|
-
style:
|
|
195
|
-
|
|
196
|
-
height: estimatePx
|
|
197
|
-
},
|
|
142
|
+
className: box ? className : ["zg-cv-row", className].filter(Boolean).join(" "),
|
|
143
|
+
style: wrapperStyle,
|
|
144
|
+
"data-item": itemKey,
|
|
198
145
|
"data-lazy": mounted ? void 0 : "",
|
|
199
|
-
"data-
|
|
146
|
+
"data-parked": state.phase === "parked" ? "" : void 0,
|
|
147
|
+
"data-quiet": state.quiet ? "" : void 0,
|
|
200
148
|
...rest,
|
|
201
|
-
children: mounted ? /* @__PURE__ */ jsx(
|
|
202
|
-
value:
|
|
203
|
-
children
|
|
149
|
+
children: mounted ? /* @__PURE__ */ jsx(RowKeyContext.Provider, {
|
|
150
|
+
value: rowKey,
|
|
151
|
+
children: /* @__PURE__ */ jsx(BackgroundMount.Provider, {
|
|
152
|
+
value: state.background,
|
|
153
|
+
children
|
|
154
|
+
})
|
|
204
155
|
}) : null
|
|
205
156
|
});
|
|
206
157
|
}
|
|
207
|
-
export { CvRow, LazyRow, TranscriptSettling, holdForceMountRows,
|
|
158
|
+
export { CvRow, LazyRow, TranscriptSettling, holdForceMountRows, useBackgroundMount, useForceMountRows, useForcedRows };
|
|
@@ -3,6 +3,7 @@ import { CodeFrame } from "../../components/CodeFrame.js";
|
|
|
3
3
|
import { Notice } from "../../components/Notice.js";
|
|
4
4
|
import { useNearViewport } from "../../hooks/useNearViewport.js";
|
|
5
5
|
import { useChatLabels } from "../useChatLabels.js";
|
|
6
|
+
import { textKey, useRowPartKey, useRowUiState } from "./row-ui-state.js";
|
|
6
7
|
import { memo, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
7
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
// src/chat/transcript/MermaidDiagram.tsx
|
|
@@ -321,7 +322,7 @@ function failureOf(code, error) {
|
|
|
321
322
|
*/
|
|
322
323
|
const MermaidDiagram = memo(({ code, streaming = false, className, style, view = false, still = false, highlight }) => {
|
|
323
324
|
const labels = useChatLabels();
|
|
324
|
-
const [showSource, setShowSource] =
|
|
325
|
+
const [showSource, setShowSource] = useRowUiState(useRowPartKey(`mermaid:${textKey(code)}`), false);
|
|
325
326
|
const [failure, setFailure] = useState(null);
|
|
326
327
|
const failed = !streaming && failure?.code === code ? failure : null;
|
|
327
328
|
const sourceToggle = (buttonClass) => {
|
|
@@ -5,11 +5,12 @@ import { useChatLabels } from "../useChatLabels.js";
|
|
|
5
5
|
import { useBadgeMenu } from "./BadgeMenu.js";
|
|
6
6
|
import { BADGE_GLYPH, FileBadgeIcon, LinkBadge, fileBadgeName } from "./badges.js";
|
|
7
7
|
import { ChipHover } from "./ChipCard.js";
|
|
8
|
-
import { CommandCard,
|
|
8
|
+
import { CommandCard, SkillCard, SkillGroupCard } from "./ChipCards.js";
|
|
9
9
|
import { MarkdownContext } from "./markdown-context.js";
|
|
10
10
|
import { PromptLines } from "./prompt-lines.js";
|
|
11
11
|
import { useReferenceMatches } from "./references.js";
|
|
12
12
|
import { ReferenceChip } from "./ReferenceText.js";
|
|
13
|
+
import { SessionChip } from "./SessionChip.js";
|
|
13
14
|
import { useContext } from "react";
|
|
14
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
16
|
import { inferPromptRefs, splitPromptSegments, tidyPromptText } from "zidane/chat/pure";
|
|
@@ -154,16 +155,7 @@ function PromptBadge({ text, providerId, cwd, skillGroups }) {
|
|
|
154
155
|
text
|
|
155
156
|
})
|
|
156
157
|
});
|
|
157
|
-
case "chats": return /* @__PURE__ */ jsx(
|
|
158
|
-
ariaLabel: labels.chipChat(text),
|
|
159
|
-
trigger: (props) => /* @__PURE__ */ jsx("span", {
|
|
160
|
-
...props,
|
|
161
|
-
className: `zg-badge ${BADGE_GLYPH.chat}`,
|
|
162
|
-
"data-kind": "chat",
|
|
163
|
-
children: text
|
|
164
|
-
}),
|
|
165
|
-
children: /* @__PURE__ */ jsx(SessionCard, { token: text })
|
|
166
|
-
});
|
|
158
|
+
case "chats": return /* @__PURE__ */ jsx(SessionChip, { token: text });
|
|
167
159
|
default: return /* @__PURE__ */ jsx("span", {
|
|
168
160
|
className: "zg-badge",
|
|
169
161
|
children: text
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Props for {@link SessionChip}. */
|
|
2
|
+
export interface SessionChipProps {
|
|
3
|
+
/** What names the session: a `#token`, an id prefix or a full id. */
|
|
4
|
+
token: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A session's chip: its title, its card on hover.
|
|
8
|
+
*
|
|
9
|
+
* @param props - The {@link SessionChipProps}.
|
|
10
|
+
*/
|
|
11
|
+
export declare function SessionChip({ token }: SessionChipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useChatLabels } from "../useChatLabels.js";
|
|
2
|
+
import { BADGE_GLYPH } from "./badges.js";
|
|
3
|
+
import { useTokenSession } from "./chip-details.js";
|
|
4
|
+
import { ChipHover } from "./ChipCard.js";
|
|
5
|
+
import { SessionCard } from "./ChipCards.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
// src/chat/transcript/SessionChip.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A session named in a chat: a `#chat` chip of a sent prompt, or a session id an answer wrote in inline code.
|
|
10
|
+
* It reads as the composer's chip does, the session's title (its token until the sessions are read, or when
|
|
11
|
+
* none matches), with the session's card on hover.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* A session's chip: its title, its card on hover.
|
|
15
|
+
*
|
|
16
|
+
* @param props - The {@link SessionChipProps}.
|
|
17
|
+
*/
|
|
18
|
+
function SessionChip({ token }) {
|
|
19
|
+
const labels = useChatLabels();
|
|
20
|
+
const { session } = useTokenSession(token);
|
|
21
|
+
const face = session?.title.trim() || token;
|
|
22
|
+
return /* @__PURE__ */ jsx(ChipHover, {
|
|
23
|
+
ariaLabel: labels.chipChat(token),
|
|
24
|
+
trigger: (props) => /* @__PURE__ */ jsx("span", {
|
|
25
|
+
...props,
|
|
26
|
+
className: `zg-badge ${BADGE_GLYPH.chat}`,
|
|
27
|
+
"data-kind": "chat",
|
|
28
|
+
title: token,
|
|
29
|
+
children: face
|
|
30
|
+
}),
|
|
31
|
+
children: /* @__PURE__ */ jsx(SessionCard, { token })
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export { SessionChip };
|
|
@@ -2,8 +2,9 @@ import { useStaysMounted } from "../../motion/collapse.js";
|
|
|
2
2
|
import { RunEstimateChip, useRunEstimate } from "../RunEstimateChip.js";
|
|
3
3
|
import { useChatLabels } from "../useChatLabels.js";
|
|
4
4
|
import { Caret, Dot, FailedMark, lineStateOf, useRowIcons } from "./frame.js";
|
|
5
|
+
import { useRowUiState } from "./row-ui-state.js";
|
|
5
6
|
import { ToolTiming } from "./tool-parts.js";
|
|
6
|
-
import { useMemo
|
|
7
|
+
import { useMemo } from "react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { previewLine, spawnStartParts } from "zidane/chat/pure";
|
|
9
10
|
// src/chat/transcript/SubagentBlock.tsx
|
|
@@ -69,7 +70,7 @@ function subagentDot(status, streaming) {
|
|
|
69
70
|
*/
|
|
70
71
|
function SubagentBlock({ childId, sessionId, depth, parentDepth, rows, defaultCollapsed, streaming, children, "data-row": rowId, className, style }) {
|
|
71
72
|
const labels = useChatLabels();
|
|
72
|
-
const [userOpen, setUserOpen] =
|
|
73
|
+
const [userOpen, setUserOpen] = useRowUiState(`worker-block:${childId}`, null);
|
|
73
74
|
const open = userOpen ?? !defaultCollapsed;
|
|
74
75
|
const mounted = useStaysMounted(open);
|
|
75
76
|
const { task, status, durationMs, turns } = useMemo(() => subagentHeaderMeta(rows), [rows]);
|
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
* closes it. A click, or the previous / next message keys, glides the prompt
|
|
12
12
|
* to the top; next past the last prompt glides to the end of its answer.
|
|
13
13
|
*
|
|
14
|
+
* Every prompt of the session has a tick, loaded or not: the transcript's
|
|
15
|
+
* host gives the session's outline (`Transcript.outline`), and a tick whose
|
|
16
|
+
* history is not loaded yet loads up to it (`Transcript.loadThrough`) when
|
|
17
|
+
* picked, pulsing meanwhile, then lands there.
|
|
18
|
+
*
|
|
19
|
+
* A tick is 8px tall. Past `RAIL_MAX_TICKS` of them (or the view's height,
|
|
20
|
+
* less `RAIL_FIT_INSET_PX` above and below) the list scrolls: the edges with
|
|
21
|
+
* more ticks fade, and the tick in view is kept in sight.
|
|
22
|
+
*
|
|
14
23
|
* The rail floats over that space: showing, hiding or growing it never moves
|
|
15
24
|
* the layout. It hides with fewer than two prompts, where the space has no
|
|
16
25
|
* room for it, and on touch screens.
|
|
@@ -29,7 +38,9 @@
|
|
|
29
38
|
*/
|
|
30
39
|
import { Cluster, Row } from "../headless/transcript/rows.js";
|
|
31
40
|
import { TranscriptRailStore } from "../headless/transcript/rail.js";
|
|
41
|
+
import { Transcript } from "../headless/host.js";
|
|
32
42
|
import "../headless/transcript/index.js";
|
|
43
|
+
import { TranscriptRowsSlice } from "../headless/transcript/incremental.js";
|
|
33
44
|
import { CSSProperties, ReactNode, RefObject } from "react";
|
|
34
45
|
import { RunReceipt } from "zidane/chat/pure";
|
|
35
46
|
/** Props for {@link TranscriptRailProvider}. */
|
|
@@ -49,12 +60,24 @@ export declare function useTranscriptRailStore(): TranscriptRailStore | null;
|
|
|
49
60
|
* The transcript's side of the rail: publishes its exchanges and the cursor's exchange to the provider's store.
|
|
50
61
|
* Outside a provider it computes nothing.
|
|
51
62
|
*
|
|
52
|
-
* @param clusters - The root clusters the transcript paints.
|
|
63
|
+
* @param clusters - The root clusters the transcript paints, or their settled and open parts (the settled ones fold once).
|
|
53
64
|
* @param isHidden - Whether a row paints nothing.
|
|
54
65
|
* @param receipts - The receipts docked on reply rows.
|
|
55
66
|
* @param selectedTurn - Select-turn mode's selected stop (a turn id), or `null`.
|
|
56
67
|
*/
|
|
57
|
-
export declare function useRailPublish(clusters: readonly Cluster[]
|
|
68
|
+
export declare function useRailPublish(clusters: readonly Cluster[] | {
|
|
69
|
+
settled: TranscriptRowsSlice;
|
|
70
|
+
open: TranscriptRowsSlice;
|
|
71
|
+
}, isHidden: (row: Row) => boolean, receipts: ReadonlyMap<string, RunReceipt>, selectedTurn: string | null): TranscriptRailStore | null;
|
|
72
|
+
/**
|
|
73
|
+
* The transcript host's side of the rail: hands it the session's prompt outline while part of the history is not
|
|
74
|
+
* loaded, and how to load up to one of them. Read again when the session changes, when more history becomes
|
|
75
|
+
* loadable, and when the outline no longer matches the loaded rows (the history was rewritten).
|
|
76
|
+
*
|
|
77
|
+
* @param transcript - The session's transcript, from its host.
|
|
78
|
+
* @param hasEarlier - Older history is not loaded yet.
|
|
79
|
+
*/
|
|
80
|
+
export declare function useRailOutline(transcript: Transcript, hasEarlier: boolean): void;
|
|
58
81
|
/** Props for {@link RailTint}. */
|
|
59
82
|
interface RailTintProps {
|
|
60
83
|
store: TranscriptRailStore;
|