zidane-ui 9.3.1 → 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.
Files changed (255) hide show
  1. package/dist/adapters/live.d.ts +2 -0
  2. package/dist/adapters/live.js +3 -0
  3. package/dist/adapters/server-git-host.js +5 -2
  4. package/dist/adapters/server-host.js +17 -11
  5. package/dist/adapters/server-machines-host.js +7 -0
  6. package/dist/adapters/server-session-host.js +49 -0
  7. package/dist/adapters/server-settings-sections.js +4 -1
  8. package/dist/adapters/sse-host.js +3 -0
  9. package/dist/adapters/sse-protocol.d.ts +10 -0
  10. package/dist/appearance/ZoomIndicator.js +5 -8
  11. package/dist/chat/HostTranscript.js +15 -1
  12. package/dist/chat/SessionStreamsProvider.d.ts +1 -1
  13. package/dist/chat/Transcript.d.ts +3 -2
  14. package/dist/chat/Transcript.js +26 -7
  15. package/dist/chat/composer/ComposerEditor.js +1 -1
  16. package/dist/chat/composer/ModelOptionsPicker.js +6 -2
  17. package/dist/chat/composer/ModelPicker.d.ts +1 -1
  18. package/dist/chat/composer/PlacePicker.d.ts +3 -1
  19. package/dist/chat/composer/PlacePicker.js +5 -1
  20. package/dist/chat/composer/use-draft-target.js +15 -3
  21. package/dist/chat/headless/block-runs.js +26 -1
  22. package/dist/chat/headless/chip-views.js +1 -1
  23. package/dist/chat/headless/draft-target.d.ts +28 -1
  24. package/dist/chat/headless/draft-target.js +22 -1
  25. package/dist/chat/headless/hosts.d.ts +4 -0
  26. package/dist/chat/headless/index.d.ts +25 -25
  27. package/dist/chat/headless/index.js +6 -6
  28. package/dist/chat/headless/markdown-scan.d.ts +0 -2
  29. package/dist/chat/headless/markdown-scan.js +3 -8
  30. package/dist/chat/headless/markdown-stream.js +3 -3
  31. package/dist/chat/headless/prompt-origin.d.ts +2 -0
  32. package/dist/chat/headless/prompt-origin.js +6 -2
  33. package/dist/chat/headless/sidebar/directory.d.ts +10 -1
  34. package/dist/chat/headless/sidebar/directory.js +9 -1
  35. package/dist/chat/headless/sidebar/environment.d.ts +15 -4
  36. package/dist/chat/headless/sidebar/environment.js +27 -9
  37. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  38. package/dist/chat/headless/sidebar/index.js +2 -2
  39. package/dist/chat/headless/sidebar/labels.d.ts +9 -2
  40. package/dist/chat/headless/sidebar/labels.js +8 -1
  41. package/dist/chat/headless/streams/actions.d.ts +2 -2
  42. package/dist/chat/headless/streams/actions.js +1 -1
  43. package/dist/chat/headless/streams/event-bytes.d.ts +12 -1
  44. package/dist/chat/headless/streams/event-bytes.js +13 -1
  45. package/dist/chat/headless/streams/store.d.ts +21 -5
  46. package/dist/chat/headless/streams/store.js +36 -7
  47. package/dist/chat/headless/streams/transcript-map.js +2 -5
  48. package/dist/chat/headless/streams/types.d.ts +2 -1
  49. package/dist/chat/headless/transcript/collapse.js +3 -0
  50. package/dist/chat/index.d.ts +2 -2
  51. package/dist/chat/index.js +2 -2
  52. package/dist/chat/sidebar/ProjectIcon.js +1 -1
  53. package/dist/chat/sidebar/RowChips.js +2 -2
  54. package/dist/chat/sidebar/SessionSidebar.d.ts +6 -0
  55. package/dist/chat/sidebar/SessionSidebar.js +23 -16
  56. package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
  57. package/dist/chat/sidebar/SidebarFold.js +17 -16
  58. package/dist/chat/sidebar/SidebarSessionRow.d.ts +7 -1
  59. package/dist/chat/sidebar/SidebarSessionRow.js +11 -8
  60. package/dist/chat/sidebar/session-menu.d.ts +4 -0
  61. package/dist/chat/sidebar/session-menu.js +14 -2
  62. package/dist/chat/sidebar/sidebar-live.js +28 -4
  63. package/dist/chat/sidebar/useInboxRows.js +6 -6
  64. package/dist/chat/sidebar/useInboxTriage.js +50 -47
  65. package/dist/chat/sidebar/useSessionSearch.js +19 -18
  66. package/dist/chat/transcript/FileChip.js +28 -0
  67. package/dist/chat/transcript/LazyRow.d.ts +1 -1
  68. package/dist/chat/transcript/LazyRow.js +3 -4
  69. package/dist/chat/transcript/PromptEcho.js +3 -11
  70. package/dist/chat/transcript/SessionChip.d.ts +11 -0
  71. package/dist/chat/transcript/SessionChip.js +34 -0
  72. package/dist/chat/transcript/TranscriptRail.d.ts +1 -1
  73. package/dist/chat/transcript/chip-details.d.ts +11 -0
  74. package/dist/chat/transcript/chip-details.js +17 -1
  75. package/dist/chat/transcript/fold-worker.js +2 -1
  76. package/dist/chat/transcript/fold.js +11 -3
  77. package/dist/chat/transcript/index.d.ts +2 -2
  78. package/dist/chat/transcript/index.js +2 -2
  79. package/dist/chat/transcript/markdown-cache.d.ts +10 -1
  80. package/dist/chat/transcript/markdown-cache.js +37 -4
  81. package/dist/chat/transcript/markdown.js +27 -34
  82. package/dist/chat/transcript/media-gallery.js +13 -16
  83. package/dist/chat/transcript/messages.js +5 -4
  84. package/dist/chat/transcript/prompt.d.ts +1 -1
  85. package/dist/chat/transcript/row-mount.d.ts +27 -8
  86. package/dist/chat/transcript/row-mount.js +114 -80
  87. package/dist/chat/transcript/row-parking.d.ts +27 -0
  88. package/dist/chat/transcript/row-parking.js +37 -1
  89. package/dist/chat/transcript/script-input.d.ts +1 -1
  90. package/dist/chat/transcript/tool-parts.js +0 -1
  91. package/dist/chat/transcript/use-transcript-rows.d.ts +1 -1
  92. package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
  93. package/dist/chat/transcript/useHistoryBackfill.js +170 -0
  94. package/dist/chat/transcript/useTranscriptFind.js +2 -4
  95. package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
  96. package/dist/chat/transcript/useTranscriptScroll.js +12 -1
  97. package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
  98. package/dist/chat/transcript/useTranscriptSearch.js +6 -6
  99. package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
  100. package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
  101. package/dist/code/editor/FileTree.d.ts +2 -0
  102. package/dist/code/editor/FileTree.js +1 -1
  103. package/dist/code/editor/FileView.js +16 -25
  104. package/dist/code/editor/find/useFind.js +17 -17
  105. package/dist/code/editor/useCodeDocument.js +22 -19
  106. package/dist/code/editor/useDetachCleanup.js +4 -3
  107. package/dist/code/use-highlighted-html.js +12 -13
  108. package/dist/components/IconButton.d.ts +3 -1
  109. package/dist/components/IconButton.js +7 -2
  110. package/dist/components/IconButtonTip.d.ts +3 -1
  111. package/dist/components/IconButtonTip.js +2 -1
  112. package/dist/components/RowActionsMenu.js +7 -14
  113. package/dist/components/Tooltip.d.ts +4 -1
  114. package/dist/components/Tooltip.js +8 -6
  115. package/dist/components/assign-ref.d.ts +8 -0
  116. package/dist/components/assign-ref.js +12 -0
  117. package/dist/components/floating/FloatingSurface.js +2 -2
  118. package/dist/components/floating/HoverCard.js +32 -14
  119. package/dist/components/floating/Popover.js +4 -7
  120. package/dist/components/floating/useAnchoredPosition.d.ts +5 -3
  121. package/dist/components/floating/useAnchoredPosition.js +7 -7
  122. package/dist/components/object-key.d.ts +7 -0
  123. package/dist/components/object-key.js +18 -0
  124. package/dist/components/palette/PaletteList.js +2 -7
  125. package/dist/components/tooltip-arming.d.ts +3 -0
  126. package/dist/components/tooltip-arming.js +8 -1
  127. package/dist/core.css +3 -3
  128. package/dist/dist/{index-C6-t1SS9.d.ts → index-BheVJOLc.d.ts} +1 -0
  129. package/dist/dist/index.d.ts +2 -2
  130. package/dist/files/FilesTab.js +0 -1
  131. package/dist/files/TreeColumn.d.ts +2 -4
  132. package/dist/files/TreeColumn.js +0 -5
  133. package/dist/files/headless/host.d.ts +3 -7
  134. package/dist/files/headless/labels.d.ts +0 -1
  135. package/dist/files/headless/labels.js +0 -1
  136. package/dist/files/headless/workspace-diff.js +1 -1
  137. package/dist/files/useCodeReview.js +1 -3
  138. package/dist/files/useFilesDiagnostics.d.ts +1 -1
  139. package/dist/files/useFilesDiagnostics.js +4 -11
  140. package/dist/files/useOpenFiles.js +9 -12
  141. package/dist/files/useWorkspace.d.ts +5 -7
  142. package/dist/files/useWorkspace.js +4 -15
  143. package/dist/git/GitBar.js +5 -3
  144. package/dist/git/MoveSessionDialog.d.ts +18 -8
  145. package/dist/git/MoveSessionDialog.js +32 -53
  146. package/dist/git/MoveToDialog.d.ts +61 -0
  147. package/dist/git/MoveToDialog.js +240 -0
  148. package/dist/git/SandboxManager.js +9 -4
  149. package/dist/git/SyncChip.js +11 -4
  150. package/dist/git/TeleportSessionDialog.d.ts +69 -0
  151. package/dist/git/TeleportSessionDialog.js +440 -0
  152. package/dist/git/headless/host.d.ts +14 -0
  153. package/dist/git/headless/index.d.ts +2 -1
  154. package/dist/git/headless/index.js +2 -1
  155. package/dist/git/headless/labels.d.ts +44 -1
  156. package/dist/git/headless/labels.js +50 -0
  157. package/dist/git/headless/sandboxes.d.ts +1 -1
  158. package/dist/git/headless/sandboxes.js +4 -3
  159. package/dist/git/headless/teleport.d.ts +76 -0
  160. package/dist/git/headless/teleport.js +19 -0
  161. package/dist/git/index.d.ts +4 -2
  162. package/dist/git/index.js +4 -2
  163. package/dist/git/useEnvironmentChoices.d.ts +5 -2
  164. package/dist/git/useEnvironmentChoices.js +12 -4
  165. package/dist/hooks/useLatest.d.ts +8 -0
  166. package/dist/hooks/useLatest.js +17 -0
  167. package/dist/hooks/useMinuteTick.d.ts +6 -2
  168. package/dist/hooks/useMinuteTick.js +12 -6
  169. package/dist/hooks/useNearViewport.js +11 -8
  170. package/dist/index.d.ts +3 -2
  171. package/dist/index.js +2 -1
  172. package/dist/keybindings/KeybindingsProvider.js +3 -4
  173. package/dist/keybindings/headless/catalog.d.ts +1 -1
  174. package/dist/keybindings/headless/catalog.js +18 -0
  175. package/dist/machines/AddServerForm.js +55 -3
  176. package/dist/machines/Banners.d.ts +2 -2
  177. package/dist/machines/Banners.js +3 -3
  178. package/dist/machines/DaemonMenu.js +1 -3
  179. package/dist/machines/HostsSection.js +5 -1
  180. package/dist/machines/OrganizationPanel.d.ts +25 -0
  181. package/dist/machines/OrganizationPanel.js +266 -0
  182. package/dist/machines/PersonalLayerPanel.d.ts +32 -0
  183. package/dist/machines/PersonalLayerPanel.js +360 -0
  184. package/dist/machines/headless/fixture-host.d.ts +10 -0
  185. package/dist/machines/headless/fixture-host.js +44 -0
  186. package/dist/machines/headless/host.d.ts +21 -1
  187. package/dist/machines/headless/index.d.ts +3 -1
  188. package/dist/machines/headless/index.js +3 -1
  189. package/dist/machines/headless/labels.d.ts +55 -0
  190. package/dist/machines/headless/labels.js +58 -1
  191. package/dist/machines/headless/layer.d.ts +64 -0
  192. package/dist/machines/headless/layer.js +56 -0
  193. package/dist/machines/headless/organization.d.ts +38 -0
  194. package/dist/machines/headless/organization.js +44 -0
  195. package/dist/machines/index.d.ts +3 -1
  196. package/dist/machines/index.js +3 -1
  197. package/dist/machines/testing/contract.d.ts +25 -1
  198. package/dist/machines/testing/contract.js +97 -1
  199. package/dist/motion/grow.js +12 -13
  200. package/dist/motion/swap.js +2 -5
  201. package/dist/motion/use-flip-list.d.ts +14 -0
  202. package/dist/motion/use-flip-list.js +17 -12
  203. package/dist/palette/headless/app-sources.js +37 -0
  204. package/dist/palette/headless/labels.js +3 -0
  205. package/dist/server/sse-handler.js +25 -2
  206. package/dist/session/DiffFileTree.js +1 -4
  207. package/dist/session/OpenSessionsDialog.d.ts +46 -0
  208. package/dist/session/OpenSessionsDialog.js +170 -0
  209. package/dist/session/PlanTracker.js +1 -2
  210. package/dist/session/ProjectHome.js +10 -9
  211. package/dist/session/RemindersPanel.js +10 -12
  212. package/dist/session/SecretsPanel.js +2 -1
  213. package/dist/session/SessionPeopleStack.d.ts +23 -0
  214. package/dist/session/SessionPeopleStack.js +65 -0
  215. package/dist/session/SessionPlaceMenu.js +5 -4
  216. package/dist/session/ShareSessionDialog.d.ts +32 -0
  217. package/dist/session/ShareSessionDialog.js +342 -0
  218. package/dist/session/TypingLine.d.ts +22 -0
  219. package/dist/session/TypingLine.js +31 -0
  220. package/dist/session/headless/host.d.ts +40 -1
  221. package/dist/session/headless/index.d.ts +4 -2
  222. package/dist/session/headless/index.js +3 -1
  223. package/dist/session/headless/labels.d.ts +49 -0
  224. package/dist/session/headless/labels.js +56 -0
  225. package/dist/session/headless/people.d.ts +29 -0
  226. package/dist/session/headless/people.js +53 -0
  227. package/dist/session/headless/place.d.ts +5 -0
  228. package/dist/session/headless/place.js +5 -1
  229. package/dist/session/headless/typing.d.ts +37 -0
  230. package/dist/session/headless/typing.js +60 -0
  231. package/dist/session/index.d.ts +5 -1
  232. package/dist/session/index.js +5 -1
  233. package/dist/settings/headless/search.d.ts +1 -1
  234. package/dist/settings/headless/sections-host.d.ts +7 -2
  235. package/dist/settings/section.d.ts +15 -3
  236. package/dist/settings/section.js +15 -3
  237. package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
  238. package/dist/settings/sections/keybindings/labels.d.ts +3 -0
  239. package/dist/settings/sections/keybindings/labels.js +3 -0
  240. package/dist/settings/sections/keybindings/rows.js +12 -0
  241. package/dist/settings/sections/logs/LogsSection.js +5 -8
  242. package/dist/styles.css +32 -7
  243. package/dist/terminal/HostTerminalSurface.js +28 -30
  244. package/dist/terminal/TerminalPanel.js +4 -12
  245. package/dist/terminal/TerminalProvider.d.ts +10 -2
  246. package/dist/terminal/TerminalProvider.js +10 -2
  247. package/dist/terminal/headless/labels.d.ts +0 -1
  248. package/dist/terminal/headless/labels.js +1 -2
  249. package/dist/terminal/headless/store.js +5 -1
  250. package/dist/workspace/LayoutBudget.js +1 -7
  251. package/package.json +2 -2
  252. package/src/styles/chat.css +3 -1
  253. package/src/styles/palette.css +3 -3
  254. package/src/styles/transcript.css +17 -3
  255. /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
@@ -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, 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 }) => {
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, onTeleportSession, onShareSession, canShareSession, 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();
@@ -36,7 +36,7 @@ const SidebarSessionRow = memo(({ sessionId, title, cwd, hostId, hostBadge = tru
36
36
  /** A new commit or pull request just arrived: the row sweeps once. */
37
37
  const [arrived, setArrived] = useState(false);
38
38
  const environmentActions = useEnvironmentActions(sessionId, menuOpen && environment?.state === "ready");
39
- const menuItems = useMemo(() => sessionMenuItems({
39
+ const baseMenuItems = useMemo(() => sessionMenuItems({
40
40
  id: sessionId,
41
41
  title,
42
42
  cwd: cwd ?? "",
@@ -59,11 +59,13 @@ const SidebarSessionRow = memo(({ sessionId, title, cwd, hostId, hostBadge = tru
59
59
  ...onWakeEnvironment ? { wakeEnvironment: () => onWakeEnvironment(sessionId) } : {},
60
60
  runEnvironmentAction: (actionId, label) => onRunEnvironmentAction(sessionId, actionId, label),
61
61
  moveToSpace: (space) => onMoveToSpace(sessionId, space),
62
- ...onMoveSession ? { moveSession: () => onMoveSession(sessionId) } : {}
62
+ ...onMoveSession ? { moveSession: () => onMoveSession(sessionId) } : {},
63
+ ...onTeleportSession ? { teleportSession: () => onTeleportSession(sessionId) } : {},
64
+ ...onShareSession && (canShareSession?.(sessionId) ?? true) ? { shareSession: () => onShareSession(sessionId) } : {}
63
65
  }, labels).map((item) => inboxSection && item.id === "favorite" ? {
64
66
  ...item,
65
67
  label: favorite ? labels.inboxMenuUnpin : labels.inboxMenuPin
66
- } : item).concat(menuOpen && inboxSection && inboxHandlers ? inboxHandlers.menuItems(sessionId, inboxSection) : []), [
68
+ } : item), [
67
69
  sessionId,
68
70
  title,
69
71
  cwd,
@@ -77,10 +79,7 @@ const SidebarSessionRow = memo(({ sessionId, title, cwd, hostId, hostBadge = tru
77
79
  environmentActions,
78
80
  host,
79
81
  labels,
80
- menuOpen,
81
- selected,
82
82
  inboxSection,
83
- inboxHandlers,
84
83
  onStartRename,
85
84
  onDelete,
86
85
  onSetArchived,
@@ -89,8 +88,12 @@ const SidebarSessionRow = memo(({ sessionId, title, cwd, hostId, hostBadge = tru
89
88
  onWakeEnvironment,
90
89
  onRunEnvironmentAction,
91
90
  onMoveToSpace,
92
- onMoveSession
91
+ onMoveSession,
92
+ onTeleportSession,
93
+ onShareSession,
94
+ canShareSession
93
95
  ]);
96
+ const menuItems = menuOpen && inboxSection && inboxHandlers ? baseMenuItems.concat(inboxHandlers.menuItems(sessionId, inboxSection)) : baseMenuItems;
94
97
  const handleSelect = useCallback(() => onSelect(sessionId), [sessionId, onSelect]);
95
98
  const handleOpenMenu = useCallback(() => onOpenMenu(sessionId), [sessionId, onOpenMenu]);
96
99
  const handleCloseMenu = useCallback(() => onCloseMenu(sessionId), [sessionId, onCloseMenu]);
@@ -56,6 +56,10 @@ export interface SessionMenuActions {
56
56
  moveToSpace: (spaceId: string) => void;
57
57
  /** Move to another environment of its host ("Move to…", `useMoveSession`). Absent: no row. */
58
58
  moveSession?: () => void;
59
+ /** Teleport to another host ("Teleport to…", `useTeleportSession`). Absent: no row. */
60
+ teleportSession?: () => void;
61
+ /** Who shares it ("Share…", `useShareSession`). Absent: no row. */
62
+ shareSession?: () => void;
59
63
  }
60
64
  /** What the menu knows beyond the conversation. */
61
65
  export interface SessionMenuContext {
@@ -95,7 +95,7 @@ function sessionMenuItems(session, context, actions, labels) {
95
95
  onSelect: () => void openWindow(id, "panels").catch(ignore)
96
96
  }
97
97
  ] : [],
98
- ...actions.wakeEnvironment && environment === "ready" && !session.environment?.resuming && isExternalEnvironment(session.environment) ? [{
98
+ ...actions.wakeEnvironment && environment === "ready" && !session.environment?.resuming && !session.environment?.busy && isExternalEnvironment(session.environment) ? [{
99
99
  id: "wake-environment",
100
100
  label: labels.menuWakeEnvironment,
101
101
  group: "environment",
@@ -113,7 +113,19 @@ function sessionMenuItems(session, context, actions, labels) {
113
113
  group: "environment",
114
114
  onSelect: actions.moveSession
115
115
  }] : [],
116
- ...environment === "ready" ? context.environmentActions.map((action) => ({
116
+ ...actions.teleportSession && !session.isMain && environment !== "provisioning" ? [{
117
+ id: "teleport",
118
+ label: labels.menuTeleportTo,
119
+ group: "environment",
120
+ onSelect: actions.teleportSession
121
+ }] : [],
122
+ ...actions.shareSession && !session.isMain ? [{
123
+ id: "share",
124
+ label: labels.menuShare,
125
+ group: "environment",
126
+ onSelect: actions.shareSession
127
+ }] : [],
128
+ ...environment === "ready" && !session.environment?.busy ? context.environmentActions.map((action) => ({
117
129
  id: `environment:${action.id}`,
118
130
  label: action.label,
119
131
  group: "environment",
@@ -27,6 +27,11 @@ import { isRunEstimated, sessionBadgeTarget } from "zidane/chat/pure";
27
27
  // src/chat/sidebar/sidebar-live.tsx
28
28
  /** A state shows at least this long, so a quick tool call does not flicker by. */
29
29
  const STATE_HOLD_MS = 500;
30
+ /**
31
+ * A state shown this long sizes the trailing slot to itself. Quicker ones leave the slot at the widest of them,
32
+ * so a burst of steps never moves the title beside it.
33
+ */
34
+ const STATE_FIT_MS = 1500;
30
35
  /** How long a new commit or pull request reads as new (the badge pop, the row sweep). */
31
36
  const ARRIVAL_MS = 1600;
32
37
  /**
@@ -47,6 +52,24 @@ function useArrival(at) {
47
52
  return Date.now() - at < ARRIVAL_MS;
48
53
  }
49
54
  /**
55
+ * A count that moves on once `value` has held still for `ms` after a change. A value that comes back after
56
+ * another counts again.
57
+ *
58
+ * @param value - The value on show.
59
+ * @param ms - How long it must hold still to count.
60
+ */
61
+ function useLastingCount(value, ms) {
62
+ const [count, bump] = useReducer((n) => n + 1, 0);
63
+ const seen = useRef(value);
64
+ useEffect(() => {
65
+ if (seen.current === value) return void 0;
66
+ seen.current = value;
67
+ const t = window.setTimeout(bump, ms);
68
+ return () => window.clearTimeout(t);
69
+ }, [value, ms]);
70
+ return count;
71
+ }
72
+ /**
50
73
  * The arrivals already played, by what arrived (a session's badge line, one of its badges) and when. A row
51
74
  * mounts again when it moves between the list and a shelf: it must look as it did, not grow its badge line
52
75
  * or pop its badges a second time (the moving copy would be measured mid-grow, and the row would jump).
@@ -77,10 +100,10 @@ const none = () => null;
77
100
  const noHost = () => void 0;
78
101
  /** How long ago `at` was, kept current by the shared minute tick (its own component: the tick re-renders this text only). */
79
102
  function Ago({ at, className }) {
80
- useMinuteTick();
103
+ const now = useMinuteTick();
81
104
  return /* @__PURE__ */ jsx("span", {
82
105
  className,
83
- children: relativeTime(at, Date.now())
106
+ children: relativeTime(at, now)
84
107
  });
85
108
  }
86
109
  /** A number in the badge text that rolls when it changes: the text around the first occurrence of `count`. */
@@ -277,7 +300,7 @@ function BadgeLine({ sessionId, startedFromKey, entry, host, project, environmen
277
300
  className: "zg-row-extra",
278
301
  "data-grow": growIn ? "" : void 0,
279
302
  children: /* @__PURE__ */ jsxs("div", {
280
- className: "zg-badge-strip zg-scroll-fade-x pt-1",
303
+ className: "zg-badge-strip zg-scroll-area zg-scroll-fade-x pt-1",
281
304
  "data-testid": "row-artifacts",
282
305
  children: [
283
306
  project && /* @__PURE__ */ jsx(ProjectChip, { project }),
@@ -415,11 +438,12 @@ function createSidebarLive(options) {
415
438
  const live = running || compacting;
416
439
  const label = useMemo(() => activity ? activityLabel(activity, labels) : { text: labels.rowRunning }, [activity, labels]);
417
440
  const shown = useCadencedValue(label, STATE_HOLD_MS);
441
+ const lasted = useLastingCount(shown.text, STATE_FIT_MS);
418
442
  const mode = needsYou ? "needs" : live ? "live" : "idle";
419
443
  return /* @__PURE__ */ jsx("span", {
420
444
  className: "zg-row-meta min-w-0 inline-flex justify-end",
421
445
  children: /* @__PURE__ */ jsx(HeldWidth, {
422
- holdKey: mode,
446
+ holdKey: mode === "live" ? `live-${lasted}` : mode,
423
447
  children: /* @__PURE__ */ jsx(Crossfade, {
424
448
  activeKey: mode,
425
449
  variant: "text",
@@ -73,21 +73,21 @@ function useInboxRows({ on, sessions, groupBy, earlierAfterMs, needsYou, activeI
73
73
  }));
74
74
  }, []);
75
75
  const holdRunning = useRunHold(sessions, on);
76
- const [tick, setTick] = useState(0);
76
+ const [now, setNow] = useState(() => Date.now());
77
77
  useEffect(() => {
78
78
  if (!on) return;
79
- const next = nextInboxChangeAt(sessions, Date.now(), earlierAfterMs);
79
+ const next = nextInboxChangeAt(sessions, now, earlierAfterMs);
80
80
  if (next === void 0) return;
81
- const timer = setTimeout(() => setTick((t) => t + 1), Math.min(2 ** 31 - 1, Math.max(0, next - Date.now())));
81
+ const timer = setTimeout(() => setNow(Date.now()), Math.min(2 ** 31 - 1, Math.max(0, next - Date.now())));
82
82
  return () => clearTimeout(timer);
83
83
  }, [
84
84
  on,
85
85
  sessions,
86
- tick,
86
+ now,
87
87
  earlierAfterMs
88
88
  ]);
89
89
  const rows = useMemo(() => on ? buildInboxRows(sessions, {
90
- now: Date.now(),
90
+ now,
91
91
  groupBy,
92
92
  collapsedShelves,
93
93
  collapsedFolders,
@@ -104,7 +104,7 @@ function useInboxRows({ on, sessions, groupBy, earlierAfterMs, needsYou, activeI
104
104
  collapsedFolders,
105
105
  shelfShown,
106
106
  activeId,
107
- tick,
107
+ now,
108
108
  earlierAfterMs,
109
109
  needsYou,
110
110
  holdRunning
@@ -1,4 +1,5 @@
1
1
  import { errorMessage } from "../../components/report-error.js";
2
+ import { useLatest } from "../../hooks/useLatest.js";
2
3
  import { compareInboxSection } from "../headless/sidebar/inbox.js";
3
4
  import { applyInboxPatch } from "../headless/sidebar/inbox-state.js";
4
5
  import { INBOX_SNOOZE_PRESETS, inboxDragPreview, inverseInboxPatch, snoozeUntil } from "./inbox-triage.js";
@@ -34,7 +35,7 @@ function useInboxTriage(options) {
34
35
  /** The custom snooze time picked so far: saved when the field loses focus or on Enter, not on each change. */
35
36
  const picked = useRef("");
36
37
  const timeInput = useRef(null);
37
- const live = useRef({
38
+ const live = useLatest({
38
39
  rows,
39
40
  selected,
40
41
  onSetInboxState,
@@ -43,39 +44,31 @@ function useInboxTriage(options) {
43
44
  labels,
44
45
  needsYou
45
46
  });
46
- useEffect(() => {
47
- live.current = {
48
- rows,
49
- selected,
50
- onSetInboxState,
51
- onSetFavorite,
52
- onSetArchived,
53
- labels,
54
- needsYou
55
- };
56
- });
57
- useEffect(() => {
58
- if (!enabled) {
59
- setSelected(EMPTY);
60
- return;
61
- }
62
- setSelected((current) => {
63
- if (current.size === 0) return current;
64
- const listed = new Set(rows.flatMap((r) => r.kind === "session" ? [r.id] : []));
65
- const kept = [...current].filter((id) => listed.has(id));
66
- return kept.length === current.size ? current : new Set(kept);
67
- });
68
- }, [enabled, rows]);
69
- const sessionRow = (id) => live.current.rows.find((r) => r.kind === "session" && r.id === id);
47
+ const kept = useMemo(() => {
48
+ if (!enabled) return EMPTY;
49
+ if (selected.size === 0) return selected;
50
+ const listed = new Set(rows.flatMap((r) => r.kind === "session" ? [r.id] : []));
51
+ const ids = [...selected].filter((id) => listed.has(id));
52
+ return ids.length === selected.size ? selected : new Set(ids);
53
+ }, [
54
+ enabled,
55
+ rows,
56
+ selected
57
+ ]);
58
+ if (kept !== selected) setSelected(kept);
59
+ const sessionRow = useCallback((id) => live().rows.find((r) => r.kind === "session" && r.id === id), [live]);
70
60
  /** The row and, when it is selected, every selected row. */
71
- const targetsOf = (id) => live.current.selected.has(id) ? [...live.current.selected] : [id];
72
- const failed = useCallback((err) => notify(live.current.labels.inboxActionFailed(errorMessage(err))), [notify]);
61
+ const targetsOf = useCallback((id) => {
62
+ const current = live().selected;
63
+ return current.has(id) ? [...current] : [id];
64
+ }, [live]);
65
+ const failed = useCallback((err) => notify(live().labels.inboxActionFailed(errorMessage(err))), [notify, live]);
73
66
  /**
74
67
  * Saves a change on each session; ⌘Z takes back the ones that saved for a moment. No toast: the row moving
75
68
  * says it was done. A failed save is reported.
76
69
  */
77
70
  const apply = useCallback((ids, patchFor) => {
78
- const save = live.current.onSetInboxState;
71
+ const save = live().onSetInboxState;
79
72
  if (!save || ids.length === 0) return;
80
73
  const now = Date.now();
81
74
  const before = ids.flatMap((id) => {
@@ -105,7 +98,11 @@ function useInboxTriage(options) {
105
98
  if (ok.length === 0 && undo.current === revert) undo.current = null;
106
99
  });
107
100
  setSelected(EMPTY);
108
- }, [failed]);
101
+ }, [
102
+ failed,
103
+ sessionRow,
104
+ live
105
+ ]);
109
106
  const settle = useCallback((ids) => apply(ids, () => ({ settled: true })), [apply]);
110
107
  const bringBack = useCallback((ids) => apply(ids, () => ({
111
108
  settled: false,
@@ -133,7 +130,7 @@ function useInboxTriage(options) {
133
130
  const ids = targetsOf(sessionId);
134
131
  if (action === "settle") settle(ids);
135
132
  else if (action === "unsettle" || action === "wake") bringBack(ids);
136
- else live.current.onSetInboxState?.(sessionId, { woke: false }).catch(failed);
133
+ else live().onSetInboxState?.(sessionId, { woke: false }).catch(failed);
137
134
  };
138
135
  const snooze = (sessionId, preset) => {
139
136
  const ids = targetsOf(sessionId);
@@ -157,7 +154,7 @@ function useInboxTriage(options) {
157
154
  const listMaybe = listRef.current;
158
155
  if (!listMaybe) return;
159
156
  const list = listMaybe;
160
- const order = live.current.rows.flatMap((r) => r.kind === "session" && r.section === section ? [r.id] : []);
157
+ const order = live().rows.flatMap((r) => r.kind === "session" && r.section === section ? [r.id] : []);
161
158
  const start = order.indexOf(sessionId);
162
159
  let picked = [sessionId];
163
160
  setSwept(new Set(picked));
@@ -193,7 +190,7 @@ function useInboxTriage(options) {
193
190
  event.preventDefault();
194
191
  };
195
192
  const menuItems = (sessionId, section) => {
196
- const l = live.current.labels;
193
+ const l = live().labels;
197
194
  const ids = targetsOf(sessionId);
198
195
  const many = ids.length > 1;
199
196
  const snoozeRows = INBOX_SNOOZE_PRESETS.map((preset) => ({
@@ -228,7 +225,7 @@ function useInboxTriage(options) {
228
225
  label: allPinned ? l.inboxUnpinMany(ids.length) : l.inboxPinMany(ids.length),
229
226
  group: "inbox-many",
230
227
  onSelect: () => {
231
- for (const id of ids) live.current.onSetFavorite(id, !allPinned).catch(failed);
228
+ for (const id of ids) live().onSetFavorite(id, !allPinned).catch(failed);
232
229
  setSelected(EMPTY);
233
230
  }
234
231
  }, {
@@ -236,7 +233,7 @@ function useInboxTriage(options) {
236
233
  label: l.inboxArchiveMany(ids.length),
237
234
  group: "inbox-many",
238
235
  onSelect: () => {
239
- for (const id of ids) live.current.onSetArchived(id, true).catch(failed);
236
+ for (const id of ids) live().onSetArchived(id, true).catch(failed);
240
237
  setSelected(EMPTY);
241
238
  }
242
239
  });
@@ -255,7 +252,10 @@ function useInboxTriage(options) {
255
252
  bringBack,
256
253
  snoozeAt,
257
254
  failed,
258
- listRef
255
+ listRef,
256
+ sessionRow,
257
+ live,
258
+ targetsOf
259
259
  ]);
260
260
  const onClickCapture = useCallback((event) => {
261
261
  if (!enabled) return;
@@ -277,25 +277,25 @@ function useInboxTriage(options) {
277
277
  if (event.shiftKey && anchor.current) {
278
278
  event.preventDefault();
279
279
  event.stopPropagation();
280
- const order = live.current.rows.flatMap((r) => r.kind === "session" ? [r.id] : []);
280
+ const order = live().rows.flatMap((r) => r.kind === "session" ? [r.id] : []);
281
281
  const a = order.indexOf(anchor.current);
282
282
  const b = order.indexOf(id);
283
283
  if (a >= 0 && b >= 0) setSelected(new Set(order.slice(Math.min(a, b), Math.max(a, b) + 1)));
284
284
  return;
285
285
  }
286
286
  anchor.current = id;
287
- if (live.current.selected.size > 0) setSelected(EMPTY);
288
- }, [enabled]);
287
+ if (live().selected.size > 0) setSelected(EMPTY);
288
+ }, [enabled, live]);
289
289
  const onKeyDown = useCallback((event) => {
290
- if (event.key === "Escape" && live.current.selected.size > 0) {
290
+ if (event.key === "Escape" && live().selected.size > 0) {
291
291
  setSelected(EMPTY);
292
292
  event.stopPropagation();
293
293
  }
294
- }, []);
294
+ }, [live]);
295
295
  /** Drops `id` (from `from`) per `state`. */
296
296
  const drop = useCallback((id, from, state) => {
297
297
  const { action } = state;
298
- const l = live.current;
298
+ const l = live();
299
299
  const save = l.onSetInboxState;
300
300
  if (!action) return;
301
301
  if (action === "settle") {
@@ -332,7 +332,8 @@ function useInboxTriage(options) {
332
332
  }, [
333
333
  settle,
334
334
  bringBack,
335
- failed
335
+ failed,
336
+ live
336
337
  ]);
337
338
  return {
338
339
  handlers,
@@ -342,7 +343,7 @@ function useInboxTriage(options) {
342
343
  onKeyDown,
343
344
  onPointerDown: useCallback((event) => {
344
345
  const listMaybe = listRef.current;
345
- if (!enabled || !listMaybe || !live.current.onSetInboxState || event.button !== 0 || event.pointerType === "touch") return;
346
+ if (!enabled || !listMaybe || !live().onSetInboxState || event.button !== 0 || event.pointerType === "touch") return;
346
347
  const target = event.target;
347
348
  if (target.closest(".zg-row-actions, .zg-row-dots, input, textarea, [contenteditable=\"true\"]")) return;
348
349
  const rowMaybe = target.closest("[data-session-id]");
@@ -458,7 +459,7 @@ function useInboxTriage(options) {
458
459
  last = i;
459
460
  continue;
460
461
  }
461
- if (compareInboxSection(section, moved, other, live.current.needsYou) < 0) {
462
+ if (compareInboxSection(section, moved, other, live().needsYou) < 0) {
462
463
  at = i;
463
464
  break;
464
465
  }
@@ -506,7 +507,7 @@ function useInboxTriage(options) {
506
507
  const shift = preview.shifts[i];
507
508
  el.style.transform = shift ? `translateY(${shift}px)` : "";
508
509
  });
509
- if (!state || state.action !== preview.action) badge.textContent = preview.action && preview.action !== "move" ? live.current.labels.inboxDrop[preview.action] : "";
510
+ if (!state || state.action !== preview.action) badge.textContent = preview.action && preview.action !== "move" ? live().labels.inboxDrop[preview.action] : "";
510
511
  state = {
511
512
  action: preview.action,
512
513
  over: preview.section,
@@ -586,9 +587,11 @@ function useInboxTriage(options) {
586
587
  enabled,
587
588
  listRef,
588
589
  flip,
589
- drop
590
+ drop,
591
+ sessionRow,
592
+ live
590
593
  ]),
591
- timeField: handlers ? /* @__PURE__ */ jsx("input", {
594
+ timeField: hasSave ? /* @__PURE__ */ jsx("input", {
592
595
  ref: timeInput,
593
596
  type: "datetime-local",
594
597
  "aria-label": labels.inboxSnoozeTime,
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useMemo, useRef, useState } from "react";
2
2
  // src/chat/sidebar/useSessionSearch.ts
3
+ const NO_HITS = [];
3
4
  /**
4
5
  * Debounce between the last search keystroke and the content search. Title
5
6
  * matching is local and instant; only the content scan waits it out.
@@ -14,35 +15,35 @@ const SEARCH_DEBOUNCE_MS = 200;
14
15
  */
15
16
  function useSessionSearch(sessions, archiveFilter, search) {
16
17
  const [searchQuery, setSearchQuery] = useState("");
17
- const [contentHits, setContentHits] = useState([]);
18
- const [searching, setSearching] = useState(false);
18
+ /** The last answer, and what it answers: a search is on while the query, the archive or the search differ. */
19
+ const [answer, setAnswer] = useState(null);
19
20
  /** The newest search sent: an answer to an older one is a stale scan a newer keystroke superseded. */
20
21
  const latest = useRef(0);
21
22
  const trimmedQuery = searchQuery.trim();
22
23
  const searchMode = trimmedQuery.length > 0;
24
+ const contentSearch = searchMode ? search : void 0;
25
+ if (!contentSearch && answer !== null) setAnswer(null);
26
+ const contentHits = contentSearch && answer ? answer.hits : NO_HITS;
27
+ const searching = contentSearch !== void 0 && !(answer?.query === trimmedQuery && answer.archive === archiveFilter && answer.search === contentSearch);
23
28
  useEffect(() => {
24
- if (!searchMode || !search) {
25
- setContentHits([]);
26
- setSearching(false);
27
- return;
28
- }
29
- setSearching(true);
29
+ if (!contentSearch) return;
30
30
  const timer = setTimeout(() => {
31
31
  const ask = ++latest.current;
32
- search(trimmedQuery, { archive: archiveFilter }).then((hits) => {
33
- if (ask !== latest.current) return;
34
- setContentHits(hits);
35
- setSearching(false);
36
- }).catch(() => {
37
- if (ask === latest.current) setSearching(false);
38
- });
32
+ const answered = (hits) => {
33
+ if (ask === latest.current) setAnswer((prev) => ({
34
+ query: trimmedQuery,
35
+ archive: archiveFilter,
36
+ search: contentSearch,
37
+ hits: hits ?? prev?.hits ?? NO_HITS
38
+ }));
39
+ };
40
+ contentSearch(trimmedQuery, { archive: archiveFilter }).then(answered, () => answered(null));
39
41
  }, SEARCH_DEBOUNCE_MS);
40
42
  return () => clearTimeout(timer);
41
43
  }, [
42
- searchMode,
44
+ contentSearch,
43
45
  trimmedQuery,
44
- archiveFilter,
45
- search
46
+ archiveFilter
46
47
  ]);
47
48
  /** Local (instant) axis of the merged results: sessions whose TITLE contains every query term. */
48
49
  const titleMatches = useMemo(() => {
@@ -4,12 +4,14 @@ import { classifyInlineCode, resolveChipPath } from "../headless/file-chip.js";
4
4
  import { useChatLabels } from "../useChatLabels.js";
5
5
  import { useBadgeMenu } from "./BadgeMenu.js";
6
6
  import { FileBadgeIcon, fileBadgeName } from "./badges.js";
7
+ import { useTokenSession } from "./chip-details.js";
7
8
  import { useChipResolution, useResolveChipNow } from "./chip-resolve.js";
8
9
  import { ChipHover } from "./ChipCard.js";
9
10
  import { CommitCard } from "./ChipCards.js";
10
11
  import { INLINE_CODE_CLASS, MarkdownContext } from "./markdown-context.js";
11
12
  import { ReferenceChip } from "./ReferenceText.js";
12
13
  import { classifyInlineRef, refHref } from "./remark-refs.js";
14
+ import { SessionChip } from "./SessionChip.js";
13
15
  import { useContext, useRef, useState } from "react";
14
16
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
15
17
  import { GITHUB_ISSUE_PROVIDER_ID, GITHUB_PULL_PROVIDER_ID, githubRefKey } from "zidane/chat/pure";
@@ -20,6 +22,8 @@ function useChipMenu(target) {
20
22
  const { cwd } = useContext(MarkdownContext);
21
23
  return open && target ? (e) => open(e, target, cwd) : void 0;
22
24
  }
25
+ /** A full session id (a UUID). */
26
+ const SESSION_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
23
27
  /** Prose chips are the shared inline badge (the `zg-badge` class); `zg-file-chip` marks them. */
24
28
  const CHIP_CLASS = "zg-file-chip zg-badge";
25
29
  /** An issue or PR link on GitHub: `owner` / `repo` / `pull` or `issues` / number. */
@@ -128,6 +132,10 @@ function displayPath(abs, cwd) {
128
132
  function InlineCode({ text }) {
129
133
  const { host } = useContext(MarkdownContext);
130
134
  const ref = classifyInlineRef(text);
135
+ if ((ref?.kind === "sha" || SESSION_ID.test(text.trim())) && !host) return /* @__PURE__ */ jsx(IdOrCommit, {
136
+ text,
137
+ commit: ref?.kind === "sha" ? ref : null
138
+ });
131
139
  if (ref) return /* @__PURE__ */ jsx(RefChip, {
132
140
  parsed: ref,
133
141
  label: text.trim()
@@ -148,6 +156,26 @@ function InlineCode({ text }) {
148
156
  children: text
149
157
  });
150
158
  }
159
+ /**
160
+ * Inline code that may be a session's id: the session's chip when one matches it (an answer naming a chat by id,
161
+ * as `3f5cf5fc`), else the commit chip a sha gets, else code. Code while the sessions are read: never a commit
162
+ * that turns into a chat.
163
+ */
164
+ function IdOrCommit({ text, commit }) {
165
+ const { session, loading, listed } = useTokenSession(text.trim());
166
+ if (session) return /* @__PURE__ */ jsx(SessionChip, { token: text.trim() });
167
+ if (listed && loading) return /* @__PURE__ */ jsx("code", {
168
+ className: INLINE_CODE_CLASS,
169
+ children: text
170
+ });
171
+ return commit ? /* @__PURE__ */ jsx(RefChip, {
172
+ parsed: commit,
173
+ label: text.trim()
174
+ }) : /* @__PURE__ */ jsx("code", {
175
+ className: INLINE_CODE_CLASS,
176
+ children: text
177
+ });
178
+ }
151
179
  /** Could `text` name a branch (`main`, `feat/x`, `origin/main`): the characters branch names use, not a number. */
152
180
  function branchShaped(text) {
153
181
  const t = text.trim();
@@ -87,7 +87,7 @@ export interface LazyRowProps {
87
87
  }
88
88
  /**
89
89
  * Renders a root transcript row that mounts its content when it nears the view, and keeps it: until then (and
90
- * parked) an empty box of the row's height, its last measured height when known.
90
+ * parked) an empty box of the row's height, its last measured height when known, without `content-visibility`.
91
91
  *
92
92
  * @param props - Row props: `itemKey`, `estimatePx`, `style`, `children`, the row's id and the select-mode data attributes.
93
93
  */
@@ -86,7 +86,7 @@ function useBackgroundMount() {
86
86
  }
87
87
  /**
88
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.
89
+ * parked) an empty box of the row's height, its last measured height when known, without `content-visibility`.
90
90
  *
91
91
  * @param props - Row props: `itemKey`, `estimatePx`, `style`, `children`, the row's id and the select-mode data attributes.
92
92
  */
@@ -132,10 +132,9 @@ function LazyRow({ itemKey, estimatePx, style, children, className, box = false,
132
132
  const mounted = state.phase === "mounted";
133
133
  const known = mounter?.sizeOf(itemKey);
134
134
  const px = state.parkedPx ?? known ?? estimatePx;
135
- const wrapperStyle = box ? mounted ? void 0 : { height: px } : {
135
+ const wrapperStyle = !mounted ? { height: px } : box ? void 0 : {
136
136
  ...style,
137
- containIntrinsicSize: `auto ${Math.round(known ?? estimatePx)}px`,
138
- ...mounted ? null : { height: px }
137
+ containIntrinsicSize: `auto ${Math.round(known ?? estimatePx)}px`
139
138
  };
140
139
  const rowKey = rest["data-row"];
141
140
  return /* @__PURE__ */ jsx("div", {
@@ -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, SessionCard, SkillCard, SkillGroupCard } from "./ChipCards.js";
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(ChipHover, {
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;