zidane-ui 9.2.3 → 9.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/adapters/live.d.ts +6 -0
  2. package/dist/adapters/live.js +16 -8
  3. package/dist/adapters/server-composer-host.js +22 -9
  4. package/dist/adapters/server-host.js +143 -18
  5. package/dist/adapters/server-media.d.ts +9 -1
  6. package/dist/adapters/server-media.js +14 -1
  7. package/dist/chat/HostTranscript.d.ts +0 -12
  8. package/dist/chat/HostTranscript.js +6 -1
  9. package/dist/chat/SessionStreamsProvider.d.ts +8 -0
  10. package/dist/chat/SessionStreamsProvider.js +11 -2
  11. package/dist/chat/Transcript.d.ts +20 -11
  12. package/dist/chat/Transcript.js +326 -160
  13. package/dist/chat/composer/ComposerEditor.js +1 -1
  14. package/dist/chat/headless/host.d.ts +43 -7
  15. package/dist/chat/headless/index.d.ts +7 -6
  16. package/dist/chat/headless/index.js +10 -9
  17. package/dist/chat/headless/labels.d.ts +17 -0
  18. package/dist/chat/headless/labels.js +17 -0
  19. package/dist/chat/headless/markdown-chunks.d.ts +2 -1
  20. package/dist/chat/headless/markdown-chunks.js +12 -20
  21. package/dist/chat/headless/markdown-scan.d.ts +66 -0
  22. package/dist/chat/headless/markdown-scan.js +124 -0
  23. package/dist/chat/headless/markdown-stream.d.ts +64 -0
  24. package/dist/chat/headless/markdown-stream.js +143 -0
  25. package/dist/chat/headless/output-pager.d.ts +68 -0
  26. package/dist/chat/headless/output-pager.js +113 -0
  27. package/dist/chat/headless/session-list.d.ts +10 -0
  28. package/dist/chat/headless/sidebar/activity.d.ts +14 -0
  29. package/dist/chat/headless/sidebar/activity.js +32 -0
  30. package/dist/chat/headless/sidebar/directory.d.ts +9 -1
  31. package/dist/chat/headless/sidebar/directory.js +10 -50
  32. package/dist/chat/headless/sidebar/labels.d.ts +11 -1
  33. package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
  34. package/dist/chat/headless/sidebar/prewarm.js +114 -0
  35. package/dist/chat/headless/streams/actions.d.ts +2 -0
  36. package/dist/chat/headless/streams/actions.js +1 -0
  37. package/dist/chat/headless/streams/event-bytes.d.ts +6 -0
  38. package/dist/chat/headless/streams/event-bytes.js +34 -0
  39. package/dist/chat/headless/streams/live-events.d.ts +25 -1
  40. package/dist/chat/headless/streams/live-events.js +53 -2
  41. package/dist/chat/headless/streams/selectors.d.ts +3 -0
  42. package/dist/chat/headless/streams/selectors.js +8 -1
  43. package/dist/chat/headless/streams/session-streams.d.ts +15 -3
  44. package/dist/chat/headless/streams/session-streams.js +31 -3
  45. package/dist/chat/headless/streams/store.d.ts +24 -1
  46. package/dist/chat/headless/streams/store.js +51 -26
  47. package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
  48. package/dist/chat/headless/streams/transcript-map.js +88 -0
  49. package/dist/chat/headless/streams/transcript.d.ts +4 -2
  50. package/dist/chat/headless/streams/transcript.js +19 -7
  51. package/dist/chat/headless/transcript/batch.js +5 -1
  52. package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
  53. package/dist/chat/headless/transcript/blob-media.js +23 -0
  54. package/dist/chat/headless/transcript/collapse.d.ts +10 -0
  55. package/dist/chat/headless/transcript/collapse.js +32 -6
  56. package/dist/chat/headless/transcript/derive.d.ts +98 -0
  57. package/dist/chat/headless/transcript/derive.js +89 -0
  58. package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
  59. package/dist/chat/headless/transcript/exchange-media.js +8 -5
  60. package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
  61. package/dist/chat/headless/transcript/fold-attachments.js +3 -2
  62. package/dist/chat/headless/transcript/fold.d.ts +2 -1
  63. package/dist/chat/headless/transcript/fold.js +16 -6
  64. package/dist/chat/headless/transcript/incremental.d.ts +53 -0
  65. package/dist/chat/headless/transcript/incremental.js +181 -0
  66. package/dist/chat/headless/transcript/index.d.ts +2 -2
  67. package/dist/chat/headless/transcript/index.js +2 -2
  68. package/dist/chat/headless/transcript/nesting.js +2 -1
  69. package/dist/chat/headless/transcript/rail.d.ts +50 -1
  70. package/dist/chat/headless/transcript/rail.js +165 -23
  71. package/dist/chat/headless/transcript/rows.d.ts +5 -1
  72. package/dist/chat/headless/transcript/run-failures.js +2 -1
  73. package/dist/chat/headless/transcript/seams.d.ts +78 -0
  74. package/dist/chat/headless/transcript/seams.js +116 -0
  75. package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
  76. package/dist/chat/headless/transcript/tool-media.js +27 -9
  77. package/dist/chat/index.d.ts +8 -7
  78. package/dist/chat/index.js +17 -16
  79. package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
  80. package/dist/chat/sidebar/SidebarFooter.js +6 -6
  81. package/dist/chat/testing/contract.d.ts +5 -3
  82. package/dist/chat/testing/contract.js +66 -1
  83. package/dist/chat/transcript/DiffLines.d.ts +6 -1
  84. package/dist/chat/transcript/DiffLines.js +35 -20
  85. package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
  86. package/dist/chat/transcript/EditDiffBlock.js +89 -30
  87. package/dist/chat/transcript/LazyRow.d.ts +40 -40
  88. package/dist/chat/transcript/LazyRow.js +101 -149
  89. package/dist/chat/transcript/MermaidDiagram.js +2 -1
  90. package/dist/chat/transcript/SubagentBlock.js +3 -2
  91. package/dist/chat/transcript/TranscriptRail.d.ts +25 -2
  92. package/dist/chat/transcript/TranscriptRail.js +175 -17
  93. package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
  94. package/dist/chat/transcript/TranscriptRow.js +4 -3
  95. package/dist/chat/transcript/actions.d.ts +37 -1
  96. package/dist/chat/transcript/actions.js +27 -1
  97. package/dist/chat/transcript/clipped-output.d.ts +58 -0
  98. package/dist/chat/transcript/clipped-output.js +131 -0
  99. package/dist/chat/transcript/fold-attachments.js +10 -5
  100. package/dist/chat/transcript/fold-worker.js +3 -2
  101. package/dist/chat/transcript/fold.js +2 -1
  102. package/dist/chat/transcript/index.d.ts +10 -9
  103. package/dist/chat/transcript/index.js +9 -8
  104. package/dist/chat/transcript/markdown-cache.d.ts +7 -1
  105. package/dist/chat/transcript/markdown-cache.js +12 -1
  106. package/dist/chat/transcript/markdown.js +116 -54
  107. package/dist/chat/transcript/media-gallery.d.ts +3 -2
  108. package/dist/chat/transcript/media-gallery.js +10 -7
  109. package/dist/chat/transcript/notices.js +2 -1
  110. package/dist/chat/transcript/prompt.js +6 -4
  111. package/dist/chat/transcript/prose.js +2 -1
  112. package/dist/chat/transcript/root-items.d.ts +96 -0
  113. package/dist/chat/transcript/root-items.js +180 -0
  114. package/dist/chat/transcript/row-mount.d.ts +165 -0
  115. package/dist/chat/transcript/row-mount.js +498 -0
  116. package/dist/chat/transcript/row-parking.d.ts +125 -0
  117. package/dist/chat/transcript/row-parking.js +135 -0
  118. package/dist/chat/transcript/row-ui-state.d.ts +37 -0
  119. package/dist/chat/transcript/row-ui-state.js +53 -0
  120. package/dist/chat/transcript/run-rows.js +3 -2
  121. package/dist/chat/transcript/script-input.d.ts +1 -1
  122. package/dist/chat/transcript/tasks.js +3 -2
  123. package/dist/chat/transcript/tool-media.d.ts +4 -2
  124. package/dist/chat/transcript/tool-media.js +15 -7
  125. package/dist/chat/transcript/tool-parts.d.ts +27 -4
  126. package/dist/chat/transcript/tool-parts.js +31 -5
  127. package/dist/chat/transcript/tool-payload.js +26 -11
  128. package/dist/chat/transcript/tool-row.d.ts +2 -1
  129. package/dist/chat/transcript/tool-row.js +38 -19
  130. package/dist/chat/transcript/use-transcript-rows.d.ts +24 -7
  131. package/dist/chat/transcript/use-transcript-rows.js +28 -46
  132. package/dist/chat/transcript/useStickToBottom.js +2 -3
  133. package/dist/chat/transcript/useTranscriptSearch.js +30 -14
  134. package/dist/chat/transcript/view-scope.d.ts +26 -6
  135. package/dist/chat/transcript/view-scope.js +106 -20
  136. package/dist/dist/{index-E1Z0aPmi.d.ts → index-C6-t1SS9.d.ts} +2 -1
  137. package/dist/dist/index.d.ts +1 -1
  138. package/dist/session/SessionHeader.js +1 -0
  139. package/dist/settings/headless/fixture-performance.js +4 -2
  140. package/dist/settings/headless/performance.d.ts +4 -0
  141. package/dist/settings/headless/search.d.ts +1 -1
  142. package/dist/settings/sections/performance/PerformanceSection.js +8 -1
  143. package/dist/settings/sections/performance/labels.d.ts +2 -0
  144. package/dist/settings/sections/performance/labels.js +2 -0
  145. package/dist/styles.css +33 -2
  146. package/dist/views/headless/answers.d.ts +8 -2
  147. package/dist/views/headless/answers.js +58 -1
  148. package/dist/views/headless/placement.d.ts +78 -0
  149. package/dist/views/headless/placement.js +154 -44
  150. package/package.json +2 -2
  151. package/src/styles/transcript.css +33 -2
@@ -3,14 +3,16 @@ import { useStaysMounted } from "../../motion/collapse.js";
3
3
  import { useChatLabels } from "../useChatLabels.js";
4
4
  import { useModelName } from "./actions.js";
5
5
  import { AnsiText } from "./AnsiText.js";
6
+ import { ClippedOutputControls, useClippedOutput } from "./clipped-output.js";
6
7
  import { EditDiffBlock } from "./EditDiffBlock.js";
7
8
  import { Caret, FailedMark } from "./frame.js";
8
9
  import { ImageGenerationBlock, drawsImageGeneration } from "./ImageGenerationBlock.js";
9
10
  import { useTranscriptRenderers } from "./renderers.js";
10
11
  import { Rolling } from "./rolling.js";
12
+ import { useRowUiState } from "./row-ui-state.js";
11
13
  import { scriptInputProps } from "./script-input.js";
12
14
  import { ToolMedia, useToolMedia } from "./tool-media.js";
13
- import { CODE_PANEL, LoadFullOutputButton, ReadFileBlock, ToolGlyph, ToolInput, ToolTiming, useFullOutput } from "./tool-parts.js";
15
+ import { CODE_PANEL, LoadFullOutputButton, ReadFileBlock, ToolGlyph, ToolInput, ToolTiming, useFullToolCall } from "./tool-parts.js";
14
16
  import { Fragment, memo, useEffect, useMemo, useState } from "react";
15
17
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
16
18
  import { computeLineDiff, isMcpJobDone, scriptProgressView } from "zidane/chat/pure";
@@ -27,7 +29,7 @@ function toolRowPropsEqual(prev, next) {
27
29
  if (prev.mode !== next.mode || prev.showResult !== next.showResult || prev.showDiff !== next.showDiff || prev.lineState !== next.lineState || prev.className !== next.className || prev.style !== next.style) return false;
28
30
  const a = prev.tool;
29
31
  const b = next.tool;
30
- return a.name === b.name && a.displayName === b.displayName && a.result === b.result && a.ok === b.ok && a.edit === b.edit && a.rawInput === b.rawInput && a.resultClipped === b.resultClipped && a.callId === b.callId && a.startedAt === b.startedAt && a.durationMs === b.durationMs && a.waitingFor === b.waitingFor && a.resuming === b.resuming && a.scriptProgress === b.scriptProgress && a.mcpJob === b.mcpJob && a.approval === b.approval && formattedEqual(a.formatted, b.formatted);
32
+ return a.name === b.name && a.displayName === b.displayName && a.result === b.result && a.ok === b.ok && a.edit === b.edit && a.rawInput === b.rawInput && a.resultClipped === b.resultClipped && a.inputClipped === b.inputClipped && a.callId === b.callId && a.turnId === b.turnId && a.startedAt === b.startedAt && a.durationMs === b.durationMs && a.waitingFor === b.waitingFor && a.resuming === b.resuming && a.scriptProgress === b.scriptProgress && a.mcpJob === b.mcpJob && a.approval === b.approval && formattedEqual(a.formatted, b.formatted);
31
33
  }
32
34
  function formattedEqual(a, b) {
33
35
  if (a === b) return true;
@@ -89,10 +91,21 @@ const ToolRow = memo(({ tool, mode, showResult, showDiff, lineState, className,
89
91
  const labels = useChatLabels();
90
92
  const display = useDisplayPath();
91
93
  const { SessionTitle, ToolBody, hasToolBody } = useTranscriptRenderers();
92
- const [open, setOpen] = useState(false);
94
+ const [open, setOpen] = useRowUiState(`tool:${tool.id}`, false);
93
95
  /** Output revealed on demand while the "Tool outputs" setting is off. */
94
- const [revealOutput, setRevealOutput] = useState(false);
95
- const { full: fullResult, load: loadFullResult, available: canLoadFull, ready: fullReady } = useFullOutput(tool);
96
+ const [revealOutput, setRevealOutput] = useRowUiState(`tool-output:${tool.id}`, false);
97
+ const clippedOutput = useClippedOutput(tool);
98
+ const fullResult = clippedOutput.text;
99
+ const { full: fullCall, load: loadFullCall, available: canLoadCall, ready: callReady } = useFullToolCall(tool);
100
+ const input = fullCall !== "loading" && fullCall?.input ? fullCall.input : tool.rawInput;
101
+ const loadInputButton = tool.inputClipped && canLoadCall && (fullCall === null || fullCall === "loading") && /* @__PURE__ */ jsx(LoadFullOutputButton, {
102
+ loading: fullCall === "loading",
103
+ disabled: !callReady,
104
+ onClick: loadFullCall,
105
+ className: "mt-1.5",
106
+ label: labels.loadFullInput,
107
+ loadingLabel: labels.loadingFullInput
108
+ });
96
109
  const bodyMounted = useStaysMounted(open);
97
110
  const media = useToolMedia(tool, typeof fullResult === "string" ? fullResult : tool.result);
98
111
  const hasDiff = showDiff && tool.edit;
@@ -119,10 +132,8 @@ const ToolRow = memo(({ tool, mode, showResult, showDiff, lineState, className,
119
132
  const scriptInline = showInputPanel && tool.name === "codemode" && tool.scriptProgress !== void 0;
120
133
  const hasExpandable = interaction || showInputPanel || hasOutput || mode === "full" && tool.rawInput || hasDiff;
121
134
  const sweep = lineState === "running" && !tool.waitingFor;
122
- const outputBody = showOutputPanel ? /* @__PURE__ */ jsxs(Fragment$1, { children: [bodyMounted && canLoadFull && tool.resultClipped && typeof fullResult !== "string" && /* @__PURE__ */ jsx(LoadFullOutputButton, {
123
- loading: fullResult === "loading",
124
- disabled: !fullReady,
125
- onClick: loadFullResult,
135
+ const outputBody = showOutputPanel ? /* @__PURE__ */ jsxs(Fragment$1, { children: [bodyMounted && tool.resultClipped && /* @__PURE__ */ jsx(ClippedOutputControls, {
136
+ output: clippedOutput,
126
137
  className: "mt-1.5"
127
138
  }), !bodyMounted ? null : media ? /* @__PURE__ */ jsxs("div", {
128
139
  className: "mt-1.5 flex flex-col gap-1.5",
@@ -230,7 +241,11 @@ const ToolRow = memo(({ tool, mode, showResult, showDiff, lineState, className,
230
241
  "data-open": open,
231
242
  children: /* @__PURE__ */ jsx("div", {
232
243
  className: "zg-collapsible-inner",
233
- children: bodyMounted && /* @__PURE__ */ jsx(EditDiffBlock, { edit: tool.edit })
244
+ children: bodyMounted && /* @__PURE__ */ jsx(EditDiffBlock, {
245
+ edit: tool.edit,
246
+ ...tool.callId ? { callId: tool.callId } : {},
247
+ ...tool.turnId ? { turnId: tool.turnId } : {}
248
+ })
234
249
  })
235
250
  }),
236
251
  interaction && ToolBody && /* @__PURE__ */ jsx("div", {
@@ -249,12 +264,16 @@ const ToolRow = memo(({ tool, mode, showResult, showDiff, lineState, className,
249
264
  "data-open": open,
250
265
  children: /* @__PURE__ */ jsx("div", {
251
266
  className: "zg-collapsible-inner",
252
- children: bodyMounted && /* @__PURE__ */ jsxs(Fragment$1, { children: [showOutputPanel && !scriptInline && /* @__PURE__ */ jsx(PanelCaption, { children: labels.inputCaption }), /* @__PURE__ */ jsx(ToolInput, {
253
- name: tool.name,
254
- input: tool.rawInput,
255
- ...scriptInputProps(tool),
256
- ...scriptInline && outputBody ? { output: outputBody } : {}
257
- })] })
267
+ children: bodyMounted && /* @__PURE__ */ jsxs(Fragment$1, { children: [
268
+ showOutputPanel && !scriptInline && /* @__PURE__ */ jsx(PanelCaption, { children: labels.inputCaption }),
269
+ /* @__PURE__ */ jsx(ToolInput, {
270
+ name: tool.name,
271
+ input,
272
+ ...scriptInputProps(tool),
273
+ ...scriptInline && outputBody ? { output: outputBody } : {}
274
+ }),
275
+ loadInputButton
276
+ ] })
258
277
  })
259
278
  }),
260
279
  hasOutput && !showOutputPanel && /* @__PURE__ */ jsx("div", {
@@ -283,11 +302,11 @@ const ToolRow = memo(({ tool, mode, showResult, showDiff, lineState, className,
283
302
  "data-open": open,
284
303
  children: /* @__PURE__ */ jsx("div", {
285
304
  className: "zg-collapsible-inner",
286
- children: bodyMounted && /* @__PURE__ */ jsx(ToolInput, {
305
+ children: bodyMounted && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ToolInput, {
287
306
  name: tool.name,
288
- input: tool.rawInput,
307
+ input: input ?? tool.rawInput,
289
308
  ...scriptInputProps(tool)
290
- })
309
+ }), loadInputButton] })
291
310
  })
292
311
  })
293
312
  ]
@@ -2,7 +2,8 @@ import { ChatEvent } from "../headless/host.js";
2
2
  import { Cluster, Row } from "../headless/transcript/rows.js";
3
3
  import { SelectStops } from "../headless/transcript/select-stops.js";
4
4
  import "../headless/transcript/index.js";
5
- import { RunReceipt } from "zidane/chat/pure";
5
+ import { TranscriptRowsSlice } from "../headless/transcript/incremental.js";
6
+ import { RunReceipt, TranscriptEvents } from "zidane/chat/pure";
6
7
  /** The display options that shape the rows. */
7
8
  export interface TranscriptRowsInput {
8
9
  /** Show cache notices (cache expired / break, dropped reasoning). */
@@ -30,15 +31,30 @@ export interface TranscriptRows {
30
31
  clusters: readonly Cluster[];
31
32
  /** The reply still streaming: the only row with a caret. */
32
33
  lastStreamingRow: Row | null | undefined;
34
+ /**
35
+ * `visibleRows` and `clusters` split at the open exchange: `settled` keeps
36
+ * its arrays (and every row and cluster in them) while only the open
37
+ * exchange streams. A renderer can read these instead of the joined arrays.
38
+ */
39
+ parts?: {
40
+ settled: TranscriptRowsSlice;
41
+ open: TranscriptRowsSlice;
42
+ };
33
43
  }
44
+ /** A transcript's events: an array, or the transcript store a session stream store holds (`TranscriptEvents`). */
45
+ export type TranscriptSource = readonly ChatEvent[] | TranscriptEvents<ChatEvent>;
46
+ /** Rows, or what holds them (read only when needed: `useTranscriptRows`' result joins its parts on first read). */
47
+ type RowsSource = readonly Row[] | {
48
+ readonly visibleRows: readonly Row[];
49
+ };
34
50
  /**
35
- * Runs the headless pipeline over a transcript's events, one `useMemo` per pass, and returns the rows to paint.
51
+ * Runs the headless pipeline over a transcript's events, incrementally (only the open exchange re-derives per tick), and returns the rows to paint.
36
52
  *
37
- * @param events - The session's events, oldest first.
53
+ * @param events - The session's events, oldest first, or its transcript store (then nothing walks the settled exchanges per tick).
38
54
  * @param streaming - A run is in flight, so the last reply may still be streaming.
39
55
  * @param input - The display options that shape the rows.
40
56
  */
41
- export declare function useTranscriptRows(events: readonly ChatEvent[], streaming: boolean, { showCacheNotices, codemodeShowCalls, showEditDiffs, groupToolCalls, showRunReceipt, compact }: TranscriptRowsInput): TranscriptRows;
57
+ export declare function useTranscriptRows(events: TranscriptSource, streaming: boolean, { showCacheNotices, codemodeShowCalls, showEditDiffs, groupToolCalls, showRunReceipt, compact }: TranscriptRowsInput): TranscriptRows;
42
58
  /**
43
59
  * Select-turn stops (`computeSelectStops`): which turns the cursor walks
44
60
  * and which rows light up. Derived per transcript change while the mode is
@@ -47,10 +63,11 @@ export declare function useTranscriptRows(events: readonly ChatEvent[], streamin
47
63
  * before the mode is on, and on every arrow), cached per input so a burst
48
64
  * of arrows computes once.
49
65
  *
50
- * @param visibleRows - The rows painted, from {@link useTranscriptRows}.
51
- * @param events - The session's events, oldest first.
66
+ * @param visibleRows - The rows painted, or {@link useTranscriptRows}' result (its rows are read only while the mode is on or asked).
67
+ * @param events - The session's events, oldest first, or its transcript store (read as one array only while the mode is on or asked).
52
68
  * @param showThinking - Reasoning rows are shown, so they can be stops.
53
69
  * @param selecting - Select-turn mode is on.
54
70
  * @param registerStops - Hands the app the stops source; returns its unregister function.
55
71
  */
56
- export declare function useSelectStops(visibleRows: readonly Row[], events: readonly ChatEvent[], showThinking: boolean, selecting: boolean, registerStops: ((source: () => SelectStops) => () => void) | undefined): SelectStops | null;
72
+ export declare function useSelectStops(visibleRows: RowsSource, events: TranscriptSource, showThinking: boolean, selecting: boolean, registerStops: ((source: () => SelectStops) => () => void) | undefined): SelectStops | null;
73
+ export {};
@@ -1,58 +1,40 @@
1
- import { batchTaskRuns, batchThinkingRuns, batchToolRuns, clusterByOwner } from "../headless/transcript/batch.js";
2
- import { collapseEvents } from "../headless/transcript/collapse.js";
3
1
  import { computeSelectStops } from "../headless/transcript/select-stops.js";
4
- import { dockRunReceipts, findLastStreamingRow, foldExchanges } from "../headless/transcript/fold.js";
5
- import { markRunFailures } from "../headless/transcript/run-failures.js";
6
- import { nestToolCalls, nestedCallVisible } from "../headless/transcript/nesting.js";
2
+ import { createTranscriptRowsDeriver } from "../headless/transcript/incremental.js";
7
3
  import { isHiddenRow } from "./TranscriptRow.js";
8
- import { useEffect, useLayoutEffect, useMemo, useRef } from "react";
9
- import { gatherCommandNotes, isCacheNotice, turnSelectionOwnership } from "zidane/chat/pure";
4
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
5
+ import { transcriptArray, turnSelectionOwnership } from "zidane/chat/pure";
10
6
  // src/chat/transcript/use-transcript-rows.ts
11
- const asStream = (events) => events;
7
+ function asStream(events) {
8
+ return Array.isArray(events) ? events : transcriptArray(events);
9
+ }
10
+ const rowsOf = (rows) => Array.isArray(rows) ? rows : rows.visibleRows;
12
11
  /**
13
- * Runs the headless pipeline over a transcript's events, one `useMemo` per pass, and returns the rows to paint.
12
+ * Runs the headless pipeline over a transcript's events, incrementally (only the open exchange re-derives per tick), and returns the rows to paint.
14
13
  *
15
- * @param events - The session's events, oldest first.
14
+ * @param events - The session's events, oldest first, or its transcript store (then nothing walks the settled exchanges per tick).
16
15
  * @param streaming - A run is in flight, so the last reply may still be streaming.
17
16
  * @param input - The display options that shape the rows.
18
17
  */
19
18
  function useTranscriptRows(events, streaming, { showCacheNotices, codemodeShowCalls, showEditDiffs, groupToolCalls, showRunReceipt, compact }) {
20
- const shownEvents = useMemo(() => {
21
- const shown = showCacheNotices && codemodeShowCalls ? events : events.filter((event) => (showCacheNotices || !isCacheNotice(event.notice)) && nestedCallVisible(event, codemodeShowCalls));
22
- return gatherCommandNotes(asStream(shown));
23
- }, [
19
+ const [deriver] = useState(createTranscriptRowsDeriver);
20
+ return useMemo(() => deriver.derive(events, streaming, {
21
+ showCacheNotices,
22
+ codemodeShowCalls,
23
+ showEditDiffs,
24
+ groupToolCalls,
25
+ showRunReceipt,
26
+ compact
27
+ }), [
28
+ deriver,
24
29
  events,
30
+ streaming,
25
31
  showCacheNotices,
26
- codemodeShowCalls
27
- ]);
28
- const rows = useMemo(() => nestToolCalls(collapseEvents(shownEvents, showEditDiffs, streaming)), [
29
- shownEvents,
32
+ codemodeShowCalls,
30
33
  showEditDiffs,
31
- streaming
32
- ]);
33
- const batched = useMemo(() => batchTaskRuns(batchThinkingRuns(batchToolRuns(rows, groupToolCalls))), [rows, groupToolCalls]);
34
- const failed = useMemo(() => markRunFailures(batched), [batched]);
35
- const { visibleRows: dockedRows, receiptByRowId } = useMemo(() => dockRunReceipts(failed, showRunReceipt), [failed, showRunReceipt]);
36
- const visibleRows = useMemo(() => compact ? foldExchanges(dockedRows, streaming) : dockedRows, [
37
- dockedRows,
38
- compact,
39
- streaming
34
+ groupToolCalls,
35
+ showRunReceipt,
36
+ compact
40
37
  ]);
41
- return {
42
- visibleRows,
43
- receiptByRowId,
44
- resumableId: useMemo(() => {
45
- if (streaming) return null;
46
- for (let i = visibleRows.length - 1; i >= 0; i--) {
47
- const row = visibleRows[i];
48
- if (row.kind === "separator" || row.kind === "run-summary") continue;
49
- return row.kind === "error" && row.failure ? row.id : null;
50
- }
51
- return null;
52
- }, [visibleRows, streaming]),
53
- clusters: useMemo(() => clusterByOwner(visibleRows), [visibleRows]),
54
- lastStreamingRow: findLastStreamingRow(visibleRows)
55
- };
56
38
  }
57
39
  /**
58
40
  * Select-turn stops (`computeSelectStops`): which turns the cursor walks
@@ -62,14 +44,14 @@ function useTranscriptRows(events, streaming, { showCacheNotices, codemodeShowCa
62
44
  * before the mode is on, and on every arrow), cached per input so a burst
63
45
  * of arrows computes once.
64
46
  *
65
- * @param visibleRows - The rows painted, from {@link useTranscriptRows}.
66
- * @param events - The session's events, oldest first.
47
+ * @param visibleRows - The rows painted, or {@link useTranscriptRows}' result (its rows are read only while the mode is on or asked).
48
+ * @param events - The session's events, oldest first, or its transcript store (read as one array only while the mode is on or asked).
67
49
  * @param showThinking - Reasoning rows are shown, so they can be stops.
68
50
  * @param selecting - Select-turn mode is on.
69
51
  * @param registerStops - Hands the app the stops source; returns its unregister function.
70
52
  */
71
53
  function useSelectStops(visibleRows, events, showThinking, selecting, registerStops) {
72
- const stops = useMemo(() => selecting ? computeSelectStops(visibleRows, turnSelectionOwnership(asStream(events)), (row) => isHiddenRow(row, showThinking)) : null, [
54
+ const stops = useMemo(() => selecting ? computeSelectStops(rowsOf(visibleRows), turnSelectionOwnership(asStream(events)), (row) => isHiddenRow(row, showThinking)) : null, [
73
55
  selecting,
74
56
  visibleRows,
75
57
  events,
@@ -94,7 +76,7 @@ function useSelectStops(visibleRows, events, showThinking, selecting, registerSt
94
76
  const { rows, events: evts, showThinking: show } = stopsInput.current;
95
77
  const hit = stopsCache.current;
96
78
  if (hit && hit.rows === rows && hit.events === evts && hit.show === show) return hit.stops;
97
- const fresh = computeSelectStops(rows, turnSelectionOwnership(asStream(evts)), (row) => isHiddenRow(row, show));
79
+ const fresh = computeSelectStops(rowsOf(rows), turnSelectionOwnership(asStream(evts)), (row) => isHiddenRow(row, show));
98
80
  stopsCache.current = {
99
81
  rows,
100
82
  events: evts,
@@ -1,6 +1,6 @@
1
1
  import { currentMotionTransition } from "../../motion/springs.js";
2
2
  import { dataRowSelector } from "../headless/transcript/rail.js";
3
- import { mountRowNow } from "./LazyRow.js";
3
+ import { revealRow } from "./row-mount.js";
4
4
  import { mayShrink } from "./scroll-clamp.js";
5
5
  import { viewAbove } from "./view-anchor.js";
6
6
  import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
@@ -360,8 +360,7 @@ function useStickToBottom(scrollRef, { paused = false, rowSelector = ".zg-cv-row
360
360
  };
361
361
  restoreRows.current = (rows) => {
362
362
  const find = (id) => el.querySelector(dataRowSelector(id));
363
- const outer = rows.length > 0 ? find(rows[rows.length - 1].id) : null;
364
- if (outer) mountRowNow(outer);
363
+ if (rows.length > 0) revealRow(el, rows[rows.length - 1].id);
365
364
  for (const [i, place] of rows.entries()) {
366
365
  const target = find(place.id);
367
366
  if (!target) continue;
@@ -1,5 +1,6 @@
1
1
  import { useHydrated } from "../../hooks/useHydrated.js";
2
- import { holdForceMountRows, useForceMountRows } from "./LazyRow.js";
2
+ import { holdForceMountRows, useForcedRows } from "./LazyRow.js";
3
+ import { mountAround } from "./row-mount.js";
3
4
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  // src/chat/transcript/useTranscriptSearch.tsx
@@ -14,9 +15,10 @@ import { jsx } from "react/jsx-runtime";
14
15
  * re-deriving text from stream events — the DOM is the source of truth
15
16
  * for "what the user can see" (markdown rendering, tool-row formatting,
16
17
  * masking all live there). `content-visibility: auto` rows keep their
17
- * text in the DOM even when paint is skipped, and rows that mount on
18
- * approach (`LazyRow`) are all mounted while a needle is active, so the
19
- * walk still finds offscreen matches. Highlighting uses the CSS Custom Highlight API
18
+ * text in the DOM even when paint is skipped, and while a needle is
19
+ * active the transcript mounts the rows whose data holds it wherever they
20
+ * are (`holdForceMountRows`), so the walk still finds matches in rows
21
+ * that never mounted or parked. Highlighting uses the CSS Custom Highlight API
20
22
  * (`CSS.highlights`) so we never mutate the transcript's DOM — wrapping
21
23
  * matches in `<mark>` would fight React's reconciler on the next
22
24
  * streaming tick.
@@ -121,10 +123,16 @@ function releaseHighlights(owner) {
121
123
  /**
122
124
  * Jump to a match's row. `block: 'center'` keeps context visible above
123
125
  * and below; on a `content-visibility: auto` row this forces render,
124
- * which is exactly what we want before the user reads the match.
126
+ * which is exactly what we want before the user reads the match. The rows
127
+ * around it that have not mounted mount first (`mountAround`), at their
128
+ * real heights: mounting after the jump, they would push the match out of
129
+ * view. Their render lands with the next commit, so the jump waits for it.
125
130
  */
126
- function scrollToRange(range) {
127
- range.startContainer.parentElement?.scrollIntoView({ block: "center" });
131
+ function scrollToRange(range, root) {
132
+ const target = range.startContainer.parentElement;
133
+ if (!target) return;
134
+ if (root && mountAround(root, target, root.clientHeight)) queueMicrotask(() => target.isConnected && target.scrollIntoView({ block: "center" }));
135
+ else target.scrollIntoView({ block: "center" });
128
136
  }
129
137
  /**
130
138
  * `revision` is any value whose identity changes when the transcript
@@ -174,9 +182,10 @@ function useTranscriptSearch(container, query, revision, { terms, revealFirstMat
174
182
  * sees the freshly-rendered rows.
175
183
  */
176
184
  const prevNeedleRef = useRef("");
177
- const rowsMounted = useForceMountRows();
185
+ const forced = useForcedRows();
178
186
  const searching = needle.key !== "";
179
- useEffect(() => searching ? holdForceMountRows() : void 0, [searching]);
187
+ useEffect(() => searching ? holdForceMountRows(needle.needles) : void 0, [searching, needle]);
188
+ const rowsMounted = forced.all || needle.needles.every((n) => forced.needles.includes(n));
180
189
  /** A rescan the transcript changing asked for, waiting out a burst of stream updates. */
181
190
  const rescanTimer = useRef(null);
182
191
  useEffect(() => () => {
@@ -188,12 +197,12 @@ function useTranscriptSearch(container, query, revision, { terms, revealFirstMat
188
197
  if (searching && !rowsMounted) return;
189
198
  const needleChanged = prevNeedleRef.current !== needle.key;
190
199
  if (needleChanged && prevNeedleRef.current !== "") revealArmed.current = false;
191
- prevNeedleRef.current = needle.key;
192
200
  if (rescanTimer.current) {
193
201
  clearTimeout(rescanTimer.current);
194
202
  rescanTimer.current = null;
195
203
  }
196
204
  if (!root || !searching) {
205
+ prevNeedleRef.current = needle.key;
197
206
  if (rangesRef.current.length === 0 && !needleChanged) return;
198
207
  rangesRef.current = [];
199
208
  setMatches((prev) => prev.count === 0 && !prev.capped ? prev : {
@@ -206,6 +215,7 @@ function useTranscriptSearch(container, query, revision, { terms, revealFirstMat
206
215
  }
207
216
  const scan = () => {
208
217
  rescanTimer.current = null;
218
+ prevNeedleRef.current = needle.key;
209
219
  const ranges = collectMatches(root, needle.needles);
210
220
  const jump = needleChanged || revealArmed.current;
211
221
  const nextIndex = needleChanged ? 0 : Math.min(activeIndexRef.current, Math.max(0, ranges.length - 1));
@@ -218,11 +228,17 @@ function useTranscriptSearch(container, query, revision, { terms, revealFirstMat
218
228
  setHighlights(owner, ranges, nextIndex);
219
229
  if (jump && ranges.length > 0) {
220
230
  revealArmed.current = false;
221
- scrollToRange(ranges[nextIndex]);
231
+ scrollToRange(ranges[nextIndex], root);
222
232
  }
223
233
  };
224
- if (needleChanged) scan();
225
- else rescanTimer.current = setTimeout(scan, RESCAN_MS);
234
+ if (needleChanged) {
235
+ let live = true;
236
+ queueMicrotask(() => live && scan());
237
+ return () => {
238
+ live = false;
239
+ };
240
+ }
241
+ rescanTimer.current = setTimeout(scan, RESCAN_MS);
226
242
  }, [
227
243
  needle,
228
244
  searching,
@@ -241,7 +257,7 @@ function useTranscriptSearch(container, query, revision, { terms, revealFirstMat
241
257
  const next = (activeIndexRef.current + direction + ranges.length) % ranges.length;
242
258
  setActiveIndex(next);
243
259
  setHighlights(ownerRef.current, ranges, next);
244
- scrollToRange(ranges[next]);
260
+ scrollToRange(ranges[next], container.current);
245
261
  }, []);
246
262
  return {
247
263
  count: matches.count,
@@ -10,7 +10,7 @@ import { ViewAnswer, ViewAnswers } from "../../views/headless/answers.js";
10
10
  import { ReplyViewPlace, TextlessExchange } from "../../views/headless/placement.js";
11
11
  import { ChatEvent } from "../headless/host.js";
12
12
  import { ReactNode } from "react";
13
- import { ViewsOrchestrationMode } from "zidane/chat/pure";
13
+ import { TranscriptEvents, ViewsOrchestrationMode } from "zidane/chat/pure";
14
14
  /** Props of the views chunk's fence: see `ui/src/views/TranscriptViews.tsx`. */
15
15
  export interface ViewFencePartProps {
16
16
  /** The fence body. */
@@ -143,8 +143,13 @@ export declare function viewFenceStarts(text: string): readonly number[];
143
143
  * The fences of each chunk of a reply.
144
144
  *
145
145
  * @param chunks - The reply's chunks.
146
+ * @param previous - The last call's chunks and result: a chunk still the same string is not read again (a streaming
147
+ * reply's closed chunks keep theirs), and keeps its value while its base does.
146
148
  */
147
- export declare function chunkFencesFor(chunks: readonly string[]): ChunkFences[];
149
+ export declare function chunkFencesFor(chunks: readonly string[], previous?: {
150
+ chunks: readonly string[];
151
+ fences: readonly ChunkFences[];
152
+ } | null): ChunkFences[];
148
153
  /**
149
154
  * Provides one chunk's fences. The value stays while its base and starts do: a streamed chunk
150
155
  * that grows with no new fence changes nothing below it.
@@ -163,21 +168,36 @@ export declare function ChunkFencesScope({ base, starts, children }: ChunkFences
163
168
  export declare function fenceIndexIn(chunk: ChunkFences, offset: number): number;
164
169
  /** Where each reply row's views go, read per row: a row draws again only when its own place changes. */
165
170
  export declare class ReplyViewPlaces {
166
- private map;
171
+ /** The places of the settled exchanges (or of a whole array). */
172
+ private base;
173
+ /** The places the open exchange sets, over `base`. */
174
+ private top;
175
+ private source;
167
176
  private events;
177
+ /** The folds of a transcript store's settled exchanges, per chunk list. */
178
+ private settled;
168
179
  private textless;
180
+ private textlessKey;
169
181
  private readonly changed;
170
182
  private readonly listeners;
171
183
  /**
172
184
  * Reads the events: the places (`viewPlacements`) and the exchanges with no reply text
173
185
  * (`textlessExchanges`). A stream tick changes neither, so it reads nothing. Rows rendering
174
- * after it read the places; {@link flush} tells the others.
186
+ * after it read the places; {@link flush} tells the others. A transcript store's settled
187
+ * exchanges are read once: a tick reads its open exchange.
175
188
  *
176
- * @param events - The session's events, oldest first.
189
+ * @param events - The session's events, oldest first, or its transcript store.
177
190
  */
178
- update(events: readonly ChatEvent[]): void;
191
+ update(events: readonly ChatEvent[] | TranscriptEvents<ChatEvent>): void;
192
+ private updateTranscript;
179
193
  /** The exchanges with no reply text, as of the last {@link update}. */
180
194
  get textlessExchanges(): readonly TextlessExchange[];
195
+ /** The places as one map (the array path's `previous`). */
196
+ private flat;
197
+ /**
198
+ * Sets the places, noting the rows whose place changed: every row when `whole`, else those the
199
+ * open exchange set before or sets now (the base is the same).
200
+ */
181
201
  private replace;
182
202
  /** Tells the rows whose place changed since the last flush. */
183
203
  flush(): void;
@@ -1,9 +1,9 @@
1
1
  import { lazyPart } from "../../components/lazy-part.js";
2
- import { onlyLastTextChanged, textlessExchanges, unplacedCodemodeViews, viewPlacements } from "../../views/headless/placement.js";
2
+ import { closePlacementExchange, foldPlacements, foldTextless, onlyLastTextChanged, placementFold, sameViewPlace, textlessExchanges, textlessFold, unplacedCodemodeViews, viewPlacements } from "../../views/headless/placement.js";
3
3
  import { useViewsHost, useViewsMeta } from "../../views/ViewsProvider.js";
4
4
  import { Suspense, createContext, useCallback, useContext, useEffect, useMemo, useState, useSyncExternalStore } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import { findViewFences, mayHoldViewFence } from "zidane/chat/pure";
6
+ import { findViewFences, mayHoldViewFence, noteTranscriptPass } from "zidane/chat/pure";
7
7
  // src/chat/transcript/view-scope.tsx
8
8
  /** Loads the views chunk. Counted by the tests that prove it never loads with views off. */
9
9
  const loadViews = () => import("../../views/TranscriptViews.js");
@@ -144,13 +144,16 @@ function viewFenceStarts(text) {
144
144
  * The fences of each chunk of a reply.
145
145
  *
146
146
  * @param chunks - The reply's chunks.
147
+ * @param previous - The last call's chunks and result: a chunk still the same string is not read again (a streaming
148
+ * reply's closed chunks keep theirs), and keeps its value while its base does.
147
149
  */
148
- function chunkFencesFor(chunks) {
150
+ function chunkFencesFor(chunks, previous) {
149
151
  let base = 0;
150
- return chunks.map((text) => {
151
- const value = {
152
+ return chunks.map((text, i) => {
153
+ const kept = previous && previous.chunks[i] === text ? previous.fences[i] : void 0;
154
+ const value = kept && kept.base === base ? kept : {
152
155
  base,
153
- starts: viewFenceStarts(text)
156
+ starts: kept ? kept.starts : viewFenceStarts(text)
154
157
  };
155
158
  base += value.starts.length;
156
159
  return value;
@@ -182,37 +185,120 @@ function ChunkFencesScope({ base, starts, children }) {
182
185
  function fenceIndexIn(chunk, offset) {
183
186
  return Math.max(0, chunk.starts.filter((start) => start <= offset).length - 1);
184
187
  }
188
+ const NO_PLACES = /* @__PURE__ */ new Map();
185
189
  /** Where each reply row's views go, read per row: a row draws again only when its own place changes. */
186
190
  var ReplyViewPlaces = class {
187
- map = /* @__PURE__ */ new Map();
191
+ /** The places of the settled exchanges (or of a whole array). */
192
+ base = NO_PLACES;
193
+ /** The places the open exchange sets, over `base`. */
194
+ top = NO_PLACES;
195
+ source = null;
188
196
  events = [];
197
+ /** The folds of a transcript store's settled exchanges, per chunk list. */
198
+ settled = null;
189
199
  textless = [];
200
+ textlessKey = null;
190
201
  changed = /* @__PURE__ */ new Set();
191
202
  listeners = /* @__PURE__ */ new Map();
192
203
  /**
193
204
  * Reads the events: the places (`viewPlacements`) and the exchanges with no reply text
194
205
  * (`textlessExchanges`). A stream tick changes neither, so it reads nothing. Rows rendering
195
- * after it read the places; {@link flush} tells the others.
206
+ * after it read the places; {@link flush} tells the others. A transcript store's settled
207
+ * exchanges are read once: a tick reads its open exchange.
196
208
  *
197
- * @param events - The session's events, oldest first.
209
+ * @param events - The session's events, oldest first, or its transcript store.
198
210
  */
199
211
  update(events) {
200
- if (events === this.events) return;
201
- if (!onlyLastTextChanged(this.events, events)) {
202
- this.replace(viewPlacements(events, this.map));
203
- this.textless = textlessExchanges(events);
212
+ if (events === this.source) return;
213
+ if (Array.isArray(events)) {
214
+ const list = events;
215
+ if (!onlyLastTextChanged(this.events, list)) {
216
+ this.replace(viewPlacements(list, this.flat()), NO_PLACES, true);
217
+ this.textless = textlessExchanges(list);
218
+ }
219
+ this.events = list;
220
+ this.settled = null;
221
+ this.textlessKey = null;
222
+ } else {
223
+ this.updateTranscript(events);
224
+ this.events = [];
225
+ }
226
+ this.source = events;
227
+ }
228
+ updateTranscript(transcript) {
229
+ let settled = this.settled;
230
+ const whole = !settled || settled.chunks !== transcript.chunks;
231
+ if (!settled || whole) {
232
+ noteTranscriptPass("views:settle", transcript.prefixLength);
233
+ const places = placementFold();
234
+ const textless = textlessFold();
235
+ for (const chunk of transcript.chunks) {
236
+ foldPlacements(places, chunk);
237
+ foldTextless(textless, chunk);
238
+ }
239
+ const map = places.places;
240
+ for (const [rowId, place] of map) {
241
+ const before = this.get(rowId);
242
+ if (before && sameViewPlace(before, place)) map.set(rowId, before);
243
+ }
244
+ settled = {
245
+ chunks: transcript.chunks,
246
+ places,
247
+ textless
248
+ };
249
+ this.settled = settled;
250
+ }
251
+ noteTranscriptPass("views:open", transcript.tail.length);
252
+ const fold = placementFold(settled.places);
253
+ foldPlacements(fold, transcript.tail);
254
+ closePlacementExchange(fold);
255
+ const top = fold.places.top;
256
+ for (const [rowId, place] of top) {
257
+ const before = this.get(rowId);
258
+ if (before && sameViewPlace(before, place)) top.set(rowId, before);
259
+ }
260
+ this.replace(settled.places.places, top, whole);
261
+ const tf = textlessFold(settled.textless);
262
+ foldTextless(tf, transcript.tail);
263
+ const open = !tf.replied && tf.turns.length > 0 ? tf.turns : null;
264
+ const key = this.textlessKey;
265
+ if (!(key !== null && key.closed === tf.out && (key.open === open || key.open !== null && open !== null && key.open.length === open.length && key.open.every((t, i) => t === open[i])))) {
266
+ this.textless = open ? [...tf.out, {
267
+ turns: open,
268
+ closed: false
269
+ }] : tf.out;
270
+ this.textlessKey = {
271
+ closed: tf.out,
272
+ open
273
+ };
204
274
  }
205
- this.events = events;
206
275
  }
207
276
  /** The exchanges with no reply text, as of the last {@link update}. */
208
277
  get textlessExchanges() {
209
278
  return this.textless;
210
279
  }
211
- replace(next) {
212
- if (next === this.map) return;
213
- for (const [rowId, place] of next) if (this.map.get(rowId) !== place) this.changed.add(rowId);
214
- for (const rowId of this.map.keys()) if (!next.has(rowId)) this.changed.add(rowId);
215
- this.map = next;
280
+ /** The places as one map (the array path's `previous`). */
281
+ flat() {
282
+ if (this.top.size === 0) return this.base;
283
+ const all = new Map(this.base);
284
+ for (const [rowId, place] of this.top) all.set(rowId, place);
285
+ return all;
286
+ }
287
+ /**
288
+ * Sets the places, noting the rows whose place changed: every row when `whole`, else those the
289
+ * open exchange set before or sets now (the base is the same).
290
+ */
291
+ replace(base, top, whole) {
292
+ const read = (rowId) => top.has(rowId) ? top.get(rowId) : base.get(rowId);
293
+ const keys = whole ? [
294
+ this.base.keys(),
295
+ this.top.keys(),
296
+ base.keys(),
297
+ top.keys()
298
+ ] : [this.top.keys(), top.keys()];
299
+ for (const list of keys) for (const rowId of list) if (this.get(rowId) !== read(rowId)) this.changed.add(rowId);
300
+ this.base = base;
301
+ this.top = top;
216
302
  }
217
303
  /** Tells the rows whose place changed since the last flush. */
218
304
  flush() {
@@ -221,7 +307,7 @@ var ReplyViewPlaces = class {
221
307
  for (const rowId of changed) for (const listener of [...this.listeners.get(rowId) ?? []]) listener();
222
308
  }
223
309
  get(rowId) {
224
- return this.map.get(rowId);
310
+ return this.top.has(rowId) ? this.top.get(rowId) : this.base.get(rowId);
225
311
  }
226
312
  subscribe(rowId, onChange) {
227
313
  let set = this.listeners.get(rowId);