@olares/lares-core 0.15.20 → 0.15.21

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.
@@ -221,7 +221,7 @@ export function transcriptBlocks(items, { running = false } = {}) {
221
221
  if (showHeader && !folded && memberSet.has(entry)) {
222
222
  blocks.push({
223
223
  kind: "fold",
224
- key: `fold-${group.turn ?? `g${groupIndex}`}-${entry.index}`,
224
+ key: `fold-${group.turn ?? `g${groupIndex}`}-${entry.row?.key || entry.row?.id || entry.index}`,
225
225
  phase,
226
226
  foldable,
227
227
  reason,
@@ -232,7 +232,12 @@ export function transcriptBlocks(items, { running = false } = {}) {
232
232
  folded = true;
233
233
  }
234
234
  if (memberSet.has(entry) && showHeader) continue;
235
- blocks.push({ kind: "row", key: `row-${entry.index}`, index: entry.index, row: entry.row });
235
+ blocks.push({
236
+ kind: "row",
237
+ key: entry.row?.key || entry.row?.id || `row-${entry.index}`,
238
+ index: entry.index,
239
+ row: entry.row,
240
+ });
236
241
  }
237
242
  });
238
243
  return blocks;
@@ -152,6 +152,9 @@ export function foldTranscript(entries) {
152
152
  };
153
153
 
154
154
  const putBlock = (turn, step, index, row) => {
155
+ // The block is one row for its whole life. Keying it by the event being
156
+ // folded makes the key change on every chunk, and the list remounts.
157
+ row.key = `block:${blockKey(turn, step, index)}:${row.type}`;
155
158
  const stored = upsert(items, blocks, blockKey(turn, step, index), tag(row));
156
159
  // The turn's readings belong under its closing reply, the row whose action
157
160
  // bar ends the turn on screen.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olares/lares-core",
3
- "version": "0.15.20",
3
+ "version": "0.15.21",
4
4
  "description": "Lares 共享业务核心:Router、workspace、文件/媒体、Olares 身份(无 UI、无平台壳)",
5
5
  "type": "module",
6
6
  "repository": {