@flamingo-stack/openframe-frontend-core 0.0.692 → 0.0.693-snapshot.20261002144836

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 (207) hide show
  1. package/dist/chat-protocol/events.d.ts +3 -0
  2. package/dist/chat-protocol/events.d.ts.map +1 -1
  3. package/dist/chat-protocol/frames.d.ts +6 -0
  4. package/dist/chat-protocol/frames.d.ts.map +1 -1
  5. package/dist/chat-protocol/index.cjs +26 -1
  6. package/dist/chat-protocol/index.cjs.map +1 -1
  7. package/dist/chat-protocol/index.d.ts +1 -0
  8. package/dist/chat-protocol/index.d.ts.map +1 -1
  9. package/dist/chat-protocol/index.js +23 -2
  10. package/dist/chat-protocol/index.js.map +1 -1
  11. package/dist/chat-protocol/leading-frames.d.ts.map +1 -1
  12. package/dist/chat-protocol/progress.d.ts +35 -0
  13. package/dist/chat-protocol/progress.d.ts.map +1 -0
  14. package/dist/{chunk-GDZ7IC5B.js → chunk-234IIQIS.js} +2 -2
  15. package/dist/{chunk-KDCIYRZV.cjs → chunk-2EQED5SZ.cjs} +34 -34
  16. package/dist/{chunk-KDCIYRZV.cjs.map → chunk-2EQED5SZ.cjs.map} +1 -1
  17. package/dist/{chunk-JUNOY5HK.js → chunk-2HX6AADM.js} +15 -17
  18. package/dist/chunk-2HX6AADM.js.map +1 -0
  19. package/dist/{chunk-X5XFKI6N.js → chunk-33L2IR62.js} +3 -3
  20. package/dist/{chunk-A5NHAHV6.js → chunk-42LIHMRA.js} +4 -4
  21. package/dist/{chunk-MIZU2OTO.cjs → chunk-63BLVGXZ.cjs} +4 -4
  22. package/dist/{chunk-MIZU2OTO.cjs.map → chunk-63BLVGXZ.cjs.map} +1 -1
  23. package/dist/{chunk-TEIHEFXP.js → chunk-6ZSDKDOV.js} +8 -8
  24. package/dist/{chunk-UVUNBXS6.js → chunk-7IINE3MK.js} +48 -5
  25. package/dist/chunk-7IINE3MK.js.map +1 -0
  26. package/dist/{chunk-N3526CTH.cjs → chunk-7TO3CWPM.cjs} +3 -3
  27. package/dist/{chunk-N3526CTH.cjs.map → chunk-7TO3CWPM.cjs.map} +1 -1
  28. package/dist/{chunk-TXFGG47A.js → chunk-7VO6NC67.js} +4 -4
  29. package/dist/{chunk-SC44YJCF.js → chunk-A7RKT5SO.js} +2 -2
  30. package/dist/{chunk-Y7ZEVTLC.js → chunk-BW6YBATM.js} +141 -71
  31. package/dist/chunk-BW6YBATM.js.map +1 -0
  32. package/dist/{chunk-GZRU2A4L.cjs → chunk-C27F6GBZ.cjs} +790 -720
  33. package/dist/chunk-C27F6GBZ.cjs.map +1 -0
  34. package/dist/{chunk-DVSPRY2V.cjs → chunk-ESMDIJIN.cjs} +3 -3
  35. package/dist/{chunk-DVSPRY2V.cjs.map → chunk-ESMDIJIN.cjs.map} +1 -1
  36. package/dist/{chunk-EXWS2QSD.cjs → chunk-FNGX5WZM.cjs} +497 -474
  37. package/dist/chunk-FNGX5WZM.cjs.map +1 -0
  38. package/dist/{chunk-RK47E3PP.js → chunk-GWQCUC53.js} +4 -4
  39. package/dist/{chunk-AVAZ6BD6.js → chunk-HBMGSGZY.js} +6 -6
  40. package/dist/{chunk-HM7ZGABI.js → chunk-HEBLLLLD.js} +2 -2
  41. package/dist/{chunk-7BNWMOPM.cjs → chunk-HJZ3UTUE.cjs} +83 -83
  42. package/dist/{chunk-7BNWMOPM.cjs.map → chunk-HJZ3UTUE.cjs.map} +1 -1
  43. package/dist/{chunk-ATREVNIN.cjs → chunk-JB25CCOB.cjs} +47 -47
  44. package/dist/{chunk-ATREVNIN.cjs.map → chunk-JB25CCOB.cjs.map} +1 -1
  45. package/dist/{chunk-Q25VYAEL.cjs → chunk-JISKS7RJ.cjs} +26 -26
  46. package/dist/{chunk-Q25VYAEL.cjs.map → chunk-JISKS7RJ.cjs.map} +1 -1
  47. package/dist/{chunk-WTYQCT4A.cjs → chunk-K5GSLGV2.cjs} +18 -18
  48. package/dist/{chunk-WTYQCT4A.cjs.map → chunk-K5GSLGV2.cjs.map} +1 -1
  49. package/dist/{chunk-CG7OWW7X.cjs → chunk-K5K2FRQK.cjs} +19 -19
  50. package/dist/{chunk-CG7OWW7X.cjs.map → chunk-K5K2FRQK.cjs.map} +1 -1
  51. package/dist/{chunk-CKUPANVU.cjs → chunk-KBSL4FCL.cjs} +9 -9
  52. package/dist/{chunk-CKUPANVU.cjs.map → chunk-KBSL4FCL.cjs.map} +1 -1
  53. package/dist/{chunk-SDORFSFK.cjs → chunk-KDUDL4PB.cjs} +37 -37
  54. package/dist/{chunk-SDORFSFK.cjs.map → chunk-KDUDL4PB.cjs.map} +1 -1
  55. package/dist/{chunk-5XPK2QGU.cjs → chunk-KJHIFF6H.cjs} +16 -16
  56. package/dist/{chunk-5XPK2QGU.cjs.map → chunk-KJHIFF6H.cjs.map} +1 -1
  57. package/dist/{chunk-MCNQKS6I.js → chunk-LHYOESIQ.js} +4 -4
  58. package/dist/{chunk-DUURFYGS.cjs → chunk-LPFU6U7O.cjs} +5 -5
  59. package/dist/{chunk-DUURFYGS.cjs.map → chunk-LPFU6U7O.cjs.map} +1 -1
  60. package/dist/{chunk-ZAV2F4VX.js → chunk-N7HFUBOV.js} +3 -3
  61. package/dist/{chunk-53O6PQ3F.cjs → chunk-NDLFK57D.cjs} +7 -7
  62. package/dist/{chunk-53O6PQ3F.cjs.map → chunk-NDLFK57D.cjs.map} +1 -1
  63. package/dist/{chunk-PKZGXRU2.js → chunk-NOMECDMA.js} +11 -9
  64. package/dist/chunk-NOMECDMA.js.map +1 -0
  65. package/dist/{chunk-Z7QCNCBN.js → chunk-O4RDXDVS.js} +12 -12
  66. package/dist/{chunk-F6LXGP6S.cjs → chunk-Q2B2MGFU.cjs} +7 -7
  67. package/dist/{chunk-F6LXGP6S.cjs.map → chunk-Q2B2MGFU.cjs.map} +1 -1
  68. package/dist/{chunk-CKO6NKNE.js → chunk-QP54LMXJ.js} +38 -15
  69. package/dist/{chunk-CKO6NKNE.js.map → chunk-QP54LMXJ.js.map} +1 -1
  70. package/dist/{chunk-QRA2JXE4.cjs → chunk-RE6PGOSS.cjs} +6 -8
  71. package/dist/chunk-RE6PGOSS.cjs.map +1 -0
  72. package/dist/{chunk-C2SVJVEB.js → chunk-SH5GPYSV.js} +2 -2
  73. package/dist/{chunk-KQZMM3QJ.cjs → chunk-SJFB4Z4L.cjs} +105 -105
  74. package/dist/{chunk-KQZMM3QJ.cjs.map → chunk-SJFB4Z4L.cjs.map} +1 -1
  75. package/dist/{chunk-DKJDO7YM.cjs → chunk-SYLLPIGU.cjs} +47 -45
  76. package/dist/chunk-SYLLPIGU.cjs.map +1 -0
  77. package/dist/{chunk-7EPGJOKN.js → chunk-TA3JJFEO.js} +4 -4
  78. package/dist/{chunk-LYJJH4D6.js → chunk-TBR3UTFY.js} +6 -6
  79. package/dist/{chunk-USKQURNF.cjs → chunk-TG3VBMDG.cjs} +3 -3
  80. package/dist/{chunk-USKQURNF.cjs.map → chunk-TG3VBMDG.cjs.map} +1 -1
  81. package/dist/{chunk-IQTQIBZ3.js → chunk-TV5SZJ3N.js} +12 -12
  82. package/dist/{chunk-RLNNV46K.js → chunk-TXSQLORA.js} +6 -6
  83. package/dist/{chunk-LYQULSK4.js → chunk-UCXZRJIE.js} +7 -7
  84. package/dist/{chunk-I27PWVWE.cjs → chunk-WT4HURQN.cjs} +46 -3
  85. package/dist/chunk-WT4HURQN.cjs.map +1 -0
  86. package/dist/{chunk-XAOAYDGR.js → chunk-WZJWIZVH.js} +4 -4
  87. package/dist/{chunk-LNKLB7GM.cjs → chunk-XNTQHC26.cjs} +28 -28
  88. package/dist/{chunk-LNKLB7GM.cjs.map → chunk-XNTQHC26.cjs.map} +1 -1
  89. package/dist/{chunk-2YVTGPM7.js → chunk-XZILGCXJ.js} +2 -2
  90. package/dist/{chunk-FTK3S57R.cjs → chunk-ZCPMWXIB.cjs} +25 -25
  91. package/dist/{chunk-FTK3S57R.cjs.map → chunk-ZCPMWXIB.cjs.map} +1 -1
  92. package/dist/{chunk-RTKF5AYA.cjs → chunk-ZUGAHQDB.cjs} +7 -7
  93. package/dist/{chunk-RTKF5AYA.cjs.map → chunk-ZUGAHQDB.cjs.map} +1 -1
  94. package/dist/components/case-studies/index.cjs +21 -21
  95. package/dist/components/case-studies/index.js +8 -8
  96. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  97. package/dist/components/chat/chat-typing-indicator.d.ts.map +1 -1
  98. package/dist/components/chat/cycling-phrase.d.ts.map +1 -1
  99. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  100. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  101. package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
  102. package/dist/components/chat/index.cjs +5 -5
  103. package/dist/components/chat/index.js +4 -4
  104. package/dist/components/chat/stream/chat-dialog-store.d.ts.map +1 -1
  105. package/dist/components/chat/stream/chat-stream-reducer.d.ts +4 -0
  106. package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
  107. package/dist/components/chat/types/component.types.d.ts +2 -0
  108. package/dist/components/chat/types/component.types.d.ts.map +1 -1
  109. package/dist/components/chat/types/unified-chat-state.types.d.ts +5 -0
  110. package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
  111. package/dist/components/contact/index.cjs +9 -9
  112. package/dist/components/contact/index.js +8 -8
  113. package/dist/components/docs/index.cjs +12 -12
  114. package/dist/components/docs/index.js +11 -11
  115. package/dist/components/embeds/index.cjs +9 -9
  116. package/dist/components/embeds/index.js +8 -8
  117. package/dist/components/faq/index.cjs +10 -10
  118. package/dist/components/faq/index.js +9 -9
  119. package/dist/components/features/index.cjs +8 -8
  120. package/dist/components/features/index.js +7 -7
  121. package/dist/components/help-center-pages/index.cjs +107 -107
  122. package/dist/components/help-center-pages/index.js +22 -22
  123. package/dist/components/index.cjs +69 -69
  124. package/dist/components/index.js +22 -22
  125. package/dist/components/meeting-scheduler/index.cjs +59 -59
  126. package/dist/components/meeting-scheduler/index.js +9 -9
  127. package/dist/components/navigation/app-layout-drawer.d.ts.map +1 -1
  128. package/dist/components/navigation/index.cjs +11 -11
  129. package/dist/components/navigation/index.js +10 -10
  130. package/dist/components/onboarding-guides/index.cjs +12 -12
  131. package/dist/components/onboarding-guides/index.js +11 -11
  132. package/dist/components/related-content/index.cjs +6 -6
  133. package/dist/components/related-content/index.js +5 -5
  134. package/dist/components/tickets/index.cjs +13 -13
  135. package/dist/components/tickets/index.js +12 -12
  136. package/dist/components/ui/index.cjs +8 -8
  137. package/dist/components/ui/index.js +7 -7
  138. package/dist/components/ui/markdown/engine.d.ts +0 -21
  139. package/dist/components/ui/markdown/engine.d.ts.map +1 -1
  140. package/dist/hooks/index.cjs +6 -6
  141. package/dist/hooks/index.cjs.map +1 -1
  142. package/dist/hooks/index.js +5 -5
  143. package/dist/hooks/use-authed-asset-src.d.ts.map +1 -1
  144. package/dist/index.cjs +15 -15
  145. package/dist/index.cjs.map +1 -1
  146. package/dist/index.js +12 -12
  147. package/dist/tailwind.config.cjs +14 -1
  148. package/dist/tailwind.config.cjs.map +1 -1
  149. package/dist/tailwind.config.js +14 -1
  150. package/dist/tailwind.config.js.map +1 -1
  151. package/eslint-config/README.md +13 -0
  152. package/eslint-config/base.js +15 -0
  153. package/eslint-config/webview-performance.js +75 -0
  154. package/package.json +1 -1
  155. package/src/chat-protocol/__tests__/progress.test.ts +39 -0
  156. package/src/chat-protocol/events.ts +3 -0
  157. package/src/chat-protocol/frames.ts +7 -0
  158. package/src/chat-protocol/index.ts +2 -0
  159. package/src/chat-protocol/leading-frames.ts +4 -1
  160. package/src/chat-protocol/progress.ts +55 -0
  161. package/src/components/chat/chat-message-enhanced.tsx +1 -1
  162. package/src/components/chat/chat-message-list.tsx +65 -15
  163. package/src/components/chat/chat-typing-indicator.tsx +18 -29
  164. package/src/components/chat/cycling-phrase.tsx +1 -11
  165. package/src/components/chat/embeddable-chat.tsx +14 -6
  166. package/src/components/chat/hooks/use-sse-chat-adapter.ts +2 -0
  167. package/src/components/chat/hooks/use-unified-chat.ts +1 -0
  168. package/src/components/chat/stream/__tests__/chat-stream-reducer-progress.test.ts +40 -0
  169. package/src/components/chat/stream/chat-dialog-store.ts +1 -0
  170. package/src/components/chat/stream/chat-stream-reducer.ts +13 -0
  171. package/src/components/chat/types/component.types.ts +2 -0
  172. package/src/components/chat/types/unified-chat-state.types.ts +6 -0
  173. package/src/components/navigation/app-layout-drawer.tsx +53 -7
  174. package/src/components/navigation/navigation-sidebar-item.tsx +1 -1
  175. package/src/components/ui/__tests__/__snapshots__/markdown-parity.test.tsx.snap +29 -29
  176. package/src/components/ui/markdown/engine.tsx +56 -12
  177. package/src/hooks/use-authed-asset-src.ts +58 -6
  178. package/tailwind.config.ts +13 -0
  179. package/dist/chunk-DKJDO7YM.cjs.map +0 -1
  180. package/dist/chunk-EXWS2QSD.cjs.map +0 -1
  181. package/dist/chunk-GZRU2A4L.cjs.map +0 -1
  182. package/dist/chunk-I27PWVWE.cjs.map +0 -1
  183. package/dist/chunk-JUNOY5HK.js.map +0 -1
  184. package/dist/chunk-PKZGXRU2.js.map +0 -1
  185. package/dist/chunk-QRA2JXE4.cjs.map +0 -1
  186. package/dist/chunk-UVUNBXS6.js.map +0 -1
  187. package/dist/chunk-Y7ZEVTLC.js.map +0 -1
  188. /package/dist/{chunk-GDZ7IC5B.js.map → chunk-234IIQIS.js.map} +0 -0
  189. /package/dist/{chunk-X5XFKI6N.js.map → chunk-33L2IR62.js.map} +0 -0
  190. /package/dist/{chunk-A5NHAHV6.js.map → chunk-42LIHMRA.js.map} +0 -0
  191. /package/dist/{chunk-TEIHEFXP.js.map → chunk-6ZSDKDOV.js.map} +0 -0
  192. /package/dist/{chunk-TXFGG47A.js.map → chunk-7VO6NC67.js.map} +0 -0
  193. /package/dist/{chunk-SC44YJCF.js.map → chunk-A7RKT5SO.js.map} +0 -0
  194. /package/dist/{chunk-RK47E3PP.js.map → chunk-GWQCUC53.js.map} +0 -0
  195. /package/dist/{chunk-AVAZ6BD6.js.map → chunk-HBMGSGZY.js.map} +0 -0
  196. /package/dist/{chunk-HM7ZGABI.js.map → chunk-HEBLLLLD.js.map} +0 -0
  197. /package/dist/{chunk-MCNQKS6I.js.map → chunk-LHYOESIQ.js.map} +0 -0
  198. /package/dist/{chunk-ZAV2F4VX.js.map → chunk-N7HFUBOV.js.map} +0 -0
  199. /package/dist/{chunk-Z7QCNCBN.js.map → chunk-O4RDXDVS.js.map} +0 -0
  200. /package/dist/{chunk-C2SVJVEB.js.map → chunk-SH5GPYSV.js.map} +0 -0
  201. /package/dist/{chunk-7EPGJOKN.js.map → chunk-TA3JJFEO.js.map} +0 -0
  202. /package/dist/{chunk-LYJJH4D6.js.map → chunk-TBR3UTFY.js.map} +0 -0
  203. /package/dist/{chunk-IQTQIBZ3.js.map → chunk-TV5SZJ3N.js.map} +0 -0
  204. /package/dist/{chunk-RLNNV46K.js.map → chunk-TXSQLORA.js.map} +0 -0
  205. /package/dist/{chunk-LYQULSK4.js.map → chunk-UCXZRJIE.js.map} +0 -0
  206. /package/dist/{chunk-XAOAYDGR.js.map → chunk-WZJWIZVH.js.map} +0 -0
  207. /package/dist/{chunk-2YVTGPM7.js.map → chunk-XZILGCXJ.js.map} +0 -0
@@ -16,6 +16,7 @@
16
16
  * `sources`). In the off-mode they're null/undefined.
17
17
  */
18
18
 
19
+ import type { ChatProgress } from '../../../chat-protocol/progress';
19
20
  import type { ChatRef } from '../chat-ref.types';
20
21
  import type { ChatAttachment } from '../utils/chat-attachment-markdown';
21
22
  import type { AuthorType } from './chat.types';
@@ -335,6 +336,11 @@ export interface UnifiedChatState {
335
336
  /** Granular phase for the "Thinking..."/"Streaming..." status row above input. */
336
337
  streamingPhase: StreamingPhase;
337
338
 
339
+ /** What the pending turn is doing before its first token ("searching 28
340
+ * sources"), when the transport reports it. Optional: a transport with no
341
+ * stages leaves it out and the status row keeps its generic phrase. */
342
+ streamingProgress?: ChatProgress | null;
343
+
338
344
  /** True while the adapter is rebuilding the message list from the
339
345
  * server-side transcript store (SSE/Guide mount-time hydration). Optional —
340
346
  * transports without server hydration (NATS manages its own dialog
@@ -8,6 +8,7 @@ import {
8
8
  type ComponentRef,
9
9
  type KeyboardEvent,
10
10
  type PointerEvent,
11
+ type RefObject,
11
12
  createContext,
12
13
  forwardRef,
13
14
  useCallback,
@@ -299,7 +300,22 @@ function useContainedResizableSize({
299
300
  }
300
301
  }, [enabled, size, storageKey]);
301
302
 
302
- return { size, setSize };
303
+ return { size, setSize, clampSize: clampToContainer };
304
+ }
305
+
306
+ /** Ends a drawer resize drag: commits the size it reached and restores the
307
+ * page's cursor and text selection. No-op when no drag is in progress. */
308
+ function finishDrag(
309
+ startRef: RefObject<{ x: number; y: number; size: number } | null>,
310
+ dragSizeRef: RefObject<number | null>,
311
+ commit: (size: number) => void,
312
+ ): void {
313
+ if (!startRef.current) return;
314
+ startRef.current = null;
315
+ if (dragSizeRef.current !== null) commit(dragSizeRef.current);
316
+ dragSizeRef.current = null;
317
+ document.body.style.cursor = '';
318
+ document.body.style.userSelect = '';
303
319
  }
304
320
 
305
321
  interface AppLayoutDrawerResizeHandleProps {
@@ -308,6 +324,10 @@ interface AppLayoutDrawerResizeHandleProps {
308
324
  minSize: number;
309
325
  maxSize: number;
310
326
  onSize: (next: number) => void;
327
+ /** Clamp a candidate size to the min/max and the container. */
328
+ clampSize: (next: number) => number;
329
+ /** The panel the size applies to — written directly while dragging. */
330
+ panelRef: RefObject<HTMLDivElement | null>;
311
331
  ariaLabel?: string;
312
332
  }
313
333
 
@@ -317,10 +337,22 @@ function AppLayoutDrawerResizeHandle({
317
337
  minSize,
318
338
  maxSize,
319
339
  onSize,
340
+ clampSize,
341
+ panelRef,
320
342
  ariaLabel,
321
343
  }: AppLayoutDrawerResizeHandleProps) {
322
344
  const isHorizontal = HORIZONTAL_SIDES.has(side);
323
345
  const startRef = useRef<{ x: number; y: number; size: number } | null>(null);
346
+ // Size reached by the drag in progress, committed to React state on release.
347
+ const dragSizeRef = useRef<number | null>(null);
348
+ const onSizeRef = useRef(onSize);
349
+ useEffect(() => {
350
+ onSizeRef.current = onSize;
351
+ }, [onSize]);
352
+ // The handle can unmount mid-drag (a persist-mode drawer closing), and then
353
+ // no pointer event ends the drag: end it here, or the panel keeps a width
354
+ // React state never received and the page keeps the resize cursor.
355
+ useEffect(() => () => finishDrag(startRef, dragSizeRef, onSizeRef.current), []);
324
356
 
325
357
  const direction = side === 'right' || side === 'bottom' ? -1 : 1;
326
358
 
@@ -333,23 +365,32 @@ function AppLayoutDrawerResizeHandle({
333
365
  document.body.style.userSelect = 'none';
334
366
  };
335
367
 
368
+ // The drag writes the panel's size straight to the DOM and commits it to
369
+ // state once, on release. Committing every pointermove re-rendered the
370
+ // drawer per event — ~16% of a drag's CPU in WebKit on top of the reflow the
371
+ // resize itself costs. ResizeObserver consumers inside the panel still see
372
+ // every change. A re-render of the drawer mid-drag (e.g. a streamed chunk)
373
+ // does not undo the write: React diffs against its previous render, where
374
+ // the size is unchanged, so it leaves the style alone.
336
375
  const handlePointerMove = (e: PointerEvent<HTMLDivElement>) => {
337
376
  const start = startRef.current;
338
- if (!start) return;
377
+ const panel = panelRef.current;
378
+ if (!start || !panel) return;
339
379
  const delta = isHorizontal ? e.clientX - start.x : e.clientY - start.y;
340
- onSize(start.size + delta * direction);
380
+ const next = clampSize(start.size + delta * direction);
381
+ dragSizeRef.current = next;
382
+ panel.style[isHorizontal ? 'width' : 'height'] = `${next}px`;
383
+ e.currentTarget.setAttribute('aria-valuenow', String(Math.round(next)));
341
384
  };
342
385
 
343
386
  const endDrag = (e: PointerEvent<HTMLDivElement>) => {
344
387
  if (!startRef.current) return;
345
- startRef.current = null;
388
+ finishDrag(startRef, dragSizeRef, onSize);
346
389
  try {
347
390
  e.currentTarget.releasePointerCapture(e.pointerId);
348
391
  } catch {
349
392
  // ignore — pointer may already be released
350
393
  }
351
- document.body.style.cursor = '';
352
- document.body.style.userSelect = '';
353
394
  };
354
395
 
355
396
  const handleKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {
@@ -405,6 +446,7 @@ function AppLayoutDrawerResizeHandle({
405
446
  onPointerMove={handlePointerMove}
406
447
  onPointerUp={endDrag}
407
448
  onPointerCancel={endDrag}
449
+ onLostPointerCapture={endDrag}
408
450
  onKeyDown={handleKeyDown}
409
451
  className={cn(
410
452
  'group absolute z-20 flex touch-none select-none',
@@ -585,7 +627,8 @@ const AppLayoutDrawerContent = forwardRef<ComponentRef<typeof DialogPrimitive.Co
585
627
  return () => mq.removeEventListener('change', update);
586
628
  }, [mobileBreakpoint]);
587
629
 
588
- const { size, setSize } = useContainedResizableSize({
630
+ const panelRef = useRef<HTMLDivElement>(null);
631
+ const { size, setSize, clampSize } = useContainedResizableSize({
589
632
  enabled: resizable,
590
633
  isHorizontal,
591
634
  minSize,
@@ -670,10 +713,13 @@ const AppLayoutDrawerContent = forwardRef<ComponentRef<typeof DialogPrimitive.Co
670
713
  minSize={minSize}
671
714
  maxSize={maxSize}
672
715
  onSize={setSize}
716
+ clampSize={clampSize}
717
+ panelRef={panelRef}
673
718
  ariaLabel={resizeAriaLabel}
674
719
  />
675
720
  ) : null}
676
721
  <div
722
+ ref={panelRef}
677
723
  className={cn(
678
724
  appLayoutDrawerPanelVariants({ side, flush }),
679
725
  // Mobile: fill the container (the side already pins one axis) and
@@ -119,7 +119,7 @@ export const NavigationSidebarItemButton = memo(function NavigationSidebarItemBu
119
119
  </span>
120
120
 
121
121
  {hasUnread && showLabel && (
122
- <span className="flex size-6 flex-shrink-0 items-center justify-center rounded-md bg-ods-accent p-2">
122
+ <span className="ml-[var(--spacing-system-xs)] flex size-6 flex-shrink-0 items-center justify-center rounded-md bg-ods-accent p-2">
123
123
  <span className="text-ods-text-on-accent text-h5">{unreadCount > 99 ? '99+' : unreadCount}</span>
124
124
  </span>
125
125
  )}
@@ -23,7 +23,7 @@ exports[`RichMarkdownRenderer golden parity > renders fixture: auto-url-generic-
23
23
 
24
24
  exports[`RichMarkdownRenderer golden parity > renders fixture: auto-url-inside-code-not-embedded 1`] = `
25
25
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">code <code class="rounded border border-ods-border bg-ods-card px-1.5 py-0.5 font-mono text-[0.9em] text-ods-text-primary">https://blog.example.com/post-3</code> inline</p>
26
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">arduino</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-arduino hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">https:<span class="hljs-comment">//blog.example.com/post-4</span>
26
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">https://blog.example.com/post-4
27
27
  </code></pre></div></div></pre></article></div></div>"
28
28
  `;
29
29
 
@@ -181,7 +181,7 @@ exports[`RichMarkdownRenderer golden parity > renders fixture: images 1`] = `
181
181
 
182
182
  exports[`RichMarkdownRenderer golden parity > renders fixture: indented-code-angle-bracket-not-escaped 1`] = `
183
183
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">Para</p>
184
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">css</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-css hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">if <span class="hljs-selector-tag">a</span> &lt;<span class="hljs-selector-tag">b</span> then
184
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">if a &lt;b then
185
185
  done
186
186
  </code></pre></div></div></pre></article></div></div>"
187
187
  `;
@@ -225,9 +225,9 @@ exports[`RichMarkdownRenderer golden parity > renders fixture: list-continuation
225
225
 
226
226
  exports[`RichMarkdownRenderer golden parity > renders fixture: list-marker-inside-fence-does-not-shift-indent-columns 1`] = `
227
227
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">A &lt;textarea&gt;</p>
228
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">css</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-css hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">- <span class="hljs-attribute">x</span>
228
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">- x
229
229
  </code></pre></div></div></pre>
230
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
230
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
231
231
  </code></pre></div></div></pre></article></div></div>"
232
232
  `;
233
233
 
@@ -235,9 +235,9 @@ exports[`RichMarkdownRenderer golden parity > renders fixture: list-marker-insid
235
235
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><div>
236
236
  &lt;textarea&gt;
237
237
  </div>
238
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">css</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-css hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">- <span class="hljs-attribute">x</span>
238
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">- x
239
239
  </code></pre></div></div></pre>
240
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
240
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
241
241
  </code></pre></div></div></pre>
242
242
  <h1 id="heading-after" class="mb-4 mt-8 font-sans font-bold text-ods-text-primary first:mt-0 text-[32px] md:text-[40px] lg:text-[48px] leading-[1.25]">Heading after</h1>
243
243
  <p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">Body after.</p></article></div></div>"
@@ -287,13 +287,13 @@ exports[`RichMarkdownRenderer golden parity > renders fixture: mermaid 1`] = `
287
287
  `;
288
288
 
289
289
  exports[`RichMarkdownRenderer golden parity > renders fixture: mismatched-fence-carve-does-not-shelter-opener 1`] = `
290
- "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">go</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-go hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);"><span class="hljs-string">\`\`</span><span class="hljs-string">\`js
290
+ "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">\`\`\`js
291
291
  ~~~
292
- </span></code></pre></div></div></pre>
292
+ </code></pre></div></div></pre>
293
293
  <p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">&lt;textarea&gt;<br>
294
294
  hello</p>
295
- <pre><code class="rounded border border-ods-border bg-ods-card px-1.5 py-0.5 font-mono text-[0.9em] text-ods-text-primary">after
296
- </code></pre></article></div></div>"
295
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">after
296
+ </code></pre></div></div></pre></article></div></div>"
297
297
  `;
298
298
 
299
299
  exports[`RichMarkdownRenderer golden parity > renders fixture: nested-lists 1`] = `
@@ -430,7 +430,7 @@ exports[`RichMarkdownRenderer golden parity > renders fixture: rawtext-closer-in
430
430
  exports[`RichMarkdownRenderer golden parity > renders fixture: rawtext-closer-in-indented-code-does-not-unescape 1`] = `
431
431
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">Explaining &lt;textarea&gt; in prose.</p>
432
432
  <h2 id="after-heading" class="mb-4 mt-8 border-b border-ods-border pb-2 font-sans font-semibold text-ods-text-primary text-[28px] md:text-[32px]">After heading</h2>
433
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
433
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
434
434
  </code></pre></div></div></pre>
435
435
  <p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">tail</p></article></div></div>"
436
436
  `;
@@ -501,9 +501,9 @@ exports[`RichMarkdownRenderer golden parity > renders fixture: rawtext-closer-in
501
501
  <ul class="my-4 ml-8 list-outside list-disc space-y-2 text-ods-text-primary">
502
502
  <li class="pl-2 text-[16px] md:text-[18px]">
503
503
  <p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">item</p>
504
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">go</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-go hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);"><span class="hljs-string">\`\`</span><span class="hljs-string">\`html
504
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">\`\`\`html
505
505
  &lt;/textarea&gt;
506
- \`</span><span class="hljs-string">\`\`</span>
506
+ \`\`\`
507
507
  </code></pre></div></div></pre>
508
508
  </li>
509
509
  </ul>
@@ -725,7 +725,7 @@ exports[`RichMarkdownRenderer golden parity > renders fixture: rawtext-closer-in
725
725
  exports[`RichMarkdownRenderer golden parity > renders fixture: rawtext-closer-in-tab-indented-code-does-not-unescape 1`] = `
726
726
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">Explaining &lt;textarea&gt; in prose.</p>
727
727
  <h2 id="after-heading" class="mb-4 mt-8 border-b border-ods-border pb-2 font-sans font-semibold text-ods-text-primary text-[28px] md:text-[32px]">After heading</h2>
728
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
728
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
729
729
  </code></pre></div></div></pre>
730
730
  <p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">tail</p></article></div></div>"
731
731
  `;
@@ -1170,7 +1170,7 @@ exports[`RichMarkdownRenderer golden parity > renders fixture: wide-list-marker-
1170
1170
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="text-ods-text-primary first:mt-0 last:mb-0 font-sans text-[16px] md:text-[18px] lg:text-[20px] leading-[1.6] my-4">Explaining &lt;textarea&gt; in HTML.</p>
1171
1171
  <ul class="my-4 ml-8 list-outside list-disc space-y-2 text-ods-text-primary">
1172
1172
  <li class="pl-2 text-[16px] md:text-[18px]">
1173
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);"> foo
1173
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);"> foo
1174
1174
  &lt;/textarea&gt;
1175
1175
  </code></pre></div></div></pre>
1176
1176
  </li>
@@ -1322,7 +1322,7 @@ exports[`SimpleMarkdownRenderer golden parity > renders fixture: images 1`] = `
1322
1322
 
1323
1323
  exports[`SimpleMarkdownRenderer golden parity > renders fixture: indented-code-angle-bracket-not-escaped 1`] = `
1324
1324
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">Para</p>
1325
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">css</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-css hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">if <span class="hljs-selector-tag">a</span> &lt;<span class="hljs-selector-tag">b</span> then
1325
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">if a &lt;b then
1326
1326
  done
1327
1327
  </code></pre></div></div></pre></article></div></div>"
1328
1328
  `;
@@ -1366,9 +1366,9 @@ exports[`SimpleMarkdownRenderer golden parity > renders fixture: list-continuati
1366
1366
 
1367
1367
  exports[`SimpleMarkdownRenderer golden parity > renders fixture: list-marker-inside-fence-does-not-shift-indent-columns 1`] = `
1368
1368
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">A &lt;textarea&gt;</p>
1369
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">css</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-css hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">- <span class="hljs-attribute">x</span>
1369
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">- x
1370
1370
  </code></pre></div></div></pre>
1371
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
1371
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
1372
1372
  </code></pre></div></div></pre></article></div></div>"
1373
1373
  `;
1374
1374
 
@@ -1376,9 +1376,9 @@ exports[`SimpleMarkdownRenderer golden parity > renders fixture: list-marker-ins
1376
1376
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><div>
1377
1377
  &lt;textarea&gt;
1378
1378
  </div>
1379
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">css</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-css hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">- <span class="hljs-attribute">x</span>
1379
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">- x
1380
1380
  </code></pre></div></div></pre>
1381
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
1381
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
1382
1382
  </code></pre></div></div></pre>
1383
1383
  <h1 id="heading-after" class="mb-4 mt-8 font-sans font-bold first:mt-0 text-heading-1">Heading after</h1>
1384
1384
  <p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">Body after.</p></article></div></div>"
@@ -1428,13 +1428,13 @@ exports[`SimpleMarkdownRenderer golden parity > renders fixture: mermaid 1`] = `
1428
1428
  `;
1429
1429
 
1430
1430
  exports[`SimpleMarkdownRenderer golden parity > renders fixture: mismatched-fence-carve-does-not-shelter-opener 1`] = `
1431
- "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">go</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-go hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);"><span class="hljs-string">\`\`</span><span class="hljs-string">\`js
1431
+ "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">\`\`\`js
1432
1432
  ~~~
1433
- </span></code></pre></div></div></pre>
1433
+ </code></pre></div></div></pre>
1434
1434
  <p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">&lt;textarea&gt;<br>
1435
1435
  hello</p>
1436
- <pre><code class="rounded border border-ods-border bg-ods-card px-1.5 py-0.5 font-mono text-[0.9em] text-ods-text-primary">after
1437
- </code></pre></article></div></div>"
1436
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">after
1437
+ </code></pre></div></div></pre></article></div></div>"
1438
1438
  `;
1439
1439
 
1440
1440
  exports[`SimpleMarkdownRenderer golden parity > renders fixture: nested-lists 1`] = `
@@ -1569,7 +1569,7 @@ exports[`SimpleMarkdownRenderer golden parity > renders fixture: rawtext-closer-
1569
1569
  exports[`SimpleMarkdownRenderer golden parity > renders fixture: rawtext-closer-in-indented-code-does-not-unescape 1`] = `
1570
1570
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">Explaining &lt;textarea&gt; in prose.</p>
1571
1571
  <h2 id="after-heading" class="mb-4 mt-8 border-b border-ods-border pb-2 font-sans font-semibold text-heading-2">After heading</h2>
1572
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
1572
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
1573
1573
  </code></pre></div></div></pre>
1574
1574
  <p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">tail</p></article></div></div>"
1575
1575
  `;
@@ -1640,9 +1640,9 @@ exports[`SimpleMarkdownRenderer golden parity > renders fixture: rawtext-closer-
1640
1640
  <ul class="my-4 ml-8 list-outside list-disc space-y-2 text-ods-text-primary">
1641
1641
  <li class="pl-2 text-base md:text-lg">
1642
1642
  <p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">item</p>
1643
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">go</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-go hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);"><span class="hljs-string">\`\`</span><span class="hljs-string">\`html
1643
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">\`\`\`html
1644
1644
  &lt;/textarea&gt;
1645
- \`</span><span class="hljs-string">\`\`</span>
1645
+ \`\`\`
1646
1646
  </code></pre></div></div></pre>
1647
1647
  </li>
1648
1648
  </ul>
@@ -1864,7 +1864,7 @@ exports[`SimpleMarkdownRenderer golden parity > renders fixture: rawtext-closer-
1864
1864
  exports[`SimpleMarkdownRenderer golden parity > renders fixture: rawtext-closer-in-tab-indented-code-does-not-unescape 1`] = `
1865
1865
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">Explaining &lt;textarea&gt; in prose.</p>
1866
1866
  <h2 id="after-heading" class="mb-4 mt-8 border-b border-ods-border pb-2 font-sans font-semibold text-heading-2">After heading</h2>
1867
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
1867
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);">&lt;/textarea&gt;
1868
1868
  </code></pre></div></div></pre>
1869
1869
  <p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">tail</p></article></div></div>"
1870
1870
  `;
@@ -2285,7 +2285,7 @@ exports[`SimpleMarkdownRenderer golden parity > renders fixture: wide-list-marke
2285
2285
  "<div class="simple-markdown-renderer "><div class="content-wrapper max-w-none"><article class="prose prose-lg max-w-none"><p class="mb-4 leading-relaxed text-ods-text-primary first:mt-0 last:mb-0 md:text-h4 lg:text-h4">Explaining &lt;textarea&gt; in HTML.</p>
2286
2286
  <ul class="my-4 ml-8 list-outside list-disc space-y-2 text-ods-text-primary">
2287
2287
  <li class="pl-2 text-base md:text-lg">
2288
- <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">bash</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-bash hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);"> foo
2288
+ <pre><div class="code-block-container my-6 overflow-hidden rounded-lg border border-ods-border bg-ods-card"><div class="code-header border-b border-ods-border bg-ods-card px-4 py-2"><span class="font-sans text-xs uppercase tracking-wide text-ods-text-tertiary">code</span></div><div class="p-4"><pre class="overflow-x-auto"><code class="language-code hljs font-mono text-[14px]" style="background: transparent; color: var(--color-text-primary);"> foo
2289
2289
  &lt;/textarea&gt;
2290
2290
  </code></pre></div></div></pre>
2291
2291
  </li>
@@ -17,10 +17,12 @@
17
17
  * → escapeUnknownHtmlTags (text pre-pass, React 19 crash guard)
18
18
  * → remark: remarkGfm, remarkBreaks, ...additionalRemarkPlugins
19
19
  * → rehype: rehypeRaw → rehypeSanitize(schema) → rehypeStripUnsafe
20
- * → rehypeHighlight
20
+ * → rehypeLabelBareFences → rehypeHighlight (not on the streaming tail)
21
21
  * → urlTransform: cardAwareUrlTransform
22
22
  * → components: buildBaseComponents(...) spread-last componentOverrides
23
23
  */
24
+
25
+ import type { Element, Root } from 'hast';
24
26
  import type React from 'react';
25
27
  import { memo, useMemo } from 'react';
26
28
  import ReactMarkdown, { type Components } from 'react-markdown';
@@ -64,6 +66,36 @@ export type { ResolveLinkResult };
64
66
  */
65
67
  export const NO_BROKEN_LINKS: readonly string[] = [];
66
68
 
69
+ const BARE_FENCE_LANGUAGE = 'code';
70
+
71
+ /**
72
+ * Gives a fenced code block written without a language the `language-code`
73
+ * class. The `code` renderer tells a fenced block from inline code only by a
74
+ * `language-*` class, which unlabelled fences used to get from
75
+ * rehype-highlight's language detection; without detection (and on the
76
+ * streaming tail, which is not highlighted at all) they would render as
77
+ * inline-code pills. `code` is in rehype-highlight's `plainText` list, so
78
+ * the block is left unhighlighted, and its header reads "code".
79
+ */
80
+ function rehypeLabelBareFences() {
81
+ const visit = (node: Root | Element) => {
82
+ for (const child of node.children) {
83
+ if (child.type !== 'element') continue;
84
+ if (child.tagName === 'pre') {
85
+ for (const code of child.children) {
86
+ if (code.type !== 'element' || code.tagName !== 'code') continue;
87
+ const classes = Array.isArray(code.properties.className) ? code.properties.className : [];
88
+ if (!classes.some(c => String(c).startsWith('language-'))) {
89
+ code.properties.className = [...classes, `language-${BARE_FENCE_LANGUAGE}`];
90
+ }
91
+ }
92
+ }
93
+ visit(child);
94
+ }
95
+ };
96
+ return (tree: Root) => visit(tree);
97
+ }
98
+
67
99
  export interface MarkdownEngineProps {
68
100
  content: string;
69
101
  className?: string;
@@ -195,19 +227,31 @@ const MarkdownEngineImpl: React.FC<MarkdownEngineProps> = ({
195
227
  [additionalRemarkPlugins],
196
228
  );
197
229
 
198
- const rehypePlugins = useMemo<PluggableList>(() => {
230
+ const { rehypePlugins, liveRehypePlugins } = useMemo(() => {
199
231
  const schema = buildSanitizeSchema({
200
232
  extraAllowedHtmlTags: extraTagsKey ? extraTagsKey.split('|') : undefined,
201
233
  });
202
- return [
203
- // ORDER MATTERS: rehype-raw parses embedded raw HTML into HAST;
204
- // rehypeSanitize is the allow-list boundary; rehypeStripUnsafe is
205
- // defense-in-depth (srcset scanning, iframe[srcdoc]); highlight last.
206
- rehypeRaw,
207
- [rehypeSanitize, schema],
208
- rehypeStripUnsafe,
209
- [rehypeHighlight, { detect: true, ignoreMissing: true }],
234
+ // ORDER MATTERS: rehype-raw parses embedded raw HTML into HAST;
235
+ // rehypeSanitize is the allow-list boundary; rehypeStripUnsafe is
236
+ // defense-in-depth (srcset scanning, iframe[srcdoc]); the fence label
237
+ // goes on after sanitizing and before highlight, which runs last.
238
+ const safe: PluggableList = [rehypeRaw, [rehypeSanitize, schema], rehypeStripUnsafe, rehypeLabelBareFences];
239
+ const highlighted: PluggableList = [
240
+ ...safe,
241
+ // No language detection: it ran highlightAuto over every registered
242
+ // grammar for each unlabelled fence (~2.5x the cost of opening a
243
+ // thread) and often guessed wrong (PowerShell shown as "VBNET").
244
+ [rehypeHighlight, { plainText: [BARE_FENCE_LANGUAGE] }],
210
245
  ];
246
+ return {
247
+ rehypePlugins: highlighted,
248
+ // The streaming tail re-parses on every chunk, and a code fence being
249
+ // typed is one tail block — highlighting it every chunk was the
250
+ // costliest step of a streamed reply. It is highlighted once it
251
+ // completes: every block before the tail and the final parse use
252
+ // `rehypePlugins`.
253
+ liveRehypePlugins: safe,
254
+ };
211
255
  }, [extraTagsKey]);
212
256
 
213
257
  const components: Components = useMemo(
@@ -238,7 +282,7 @@ const MarkdownEngineImpl: React.FC<MarkdownEngineProps> = ({
238
282
  // spam (polite + additions). Streaming caret/pulse affordances live in
239
283
  // chat components and honor prefers-reduced-motion there.
240
284
  <div aria-live="polite" aria-relevant="additions text">
241
- {streamingBlocks.map(block => (
285
+ {streamingBlocks.map((block, i) => (
242
286
  // Each unit is parsed on its own, so hast positions restart at 1;
243
287
  // the offset maps them back onto the document-wide heading-id map.
244
288
  <HeadingLineOffsetContext.Provider key={block.index} value={block.startLine - 1}>
@@ -252,7 +296,7 @@ const MarkdownEngineImpl: React.FC<MarkdownEngineProps> = ({
252
296
  ) : (
253
297
  <ReactMarkdown
254
298
  remarkPlugins={remarkPlugins}
255
- rehypePlugins={rehypePlugins}
299
+ rehypePlugins={i === streamingBlocks.length - 1 ? liveRehypePlugins : rehypePlugins}
256
300
  urlTransform={cardAwareUrlTransform}
257
301
  components={components}
258
302
  >
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { useEffect, useReducer } from 'react';
4
4
  import { embedAuthedFetch, needsBearerAssetFetch } from '../utils/embed-authed-fetch';
5
+ import { useIsomorphicLayoutEffect } from './ui/use-isomorphic-layout-effect';
5
6
 
6
7
  /**
7
8
  * Resolve ANY asset URL the browser would load natively — `<img src>`,
@@ -21,18 +22,56 @@ import { embedAuthedFetch, needsBearerAssetFetch } from '../utils/embed-authed-f
21
22
  * callers show their existing placeholder / "no captions" branch instead of a
22
23
  * broken asset; a failed fetch retries on the next mount.
23
24
  *
24
- * Cache: module-level, session-lifetime, keyed by full URL — so the two
25
- * `<track>` URLs of one player, or the same avatar in twenty rows, cost one
26
- * request. Gateway URLs carry a `?v=<content-hash>` cache-buster, so changed
27
- * content is a new key; entries are never revoked (a VTT / avatar is a few KB
28
- * — refcount churn isn't worth it) and are dropped wholesale at session end
29
- * via `clearAuthedAssetCache`.
25
+ * Cache: module-level, keyed by full URL — so the two `<track>` URLs of one
26
+ * player, or the same avatar in twenty rows, cost one request. Gateway URLs
27
+ * carry a `?v=<content-hash>` cache-buster, so changed content is a new key.
28
+ * Entries are reference-counted by the mounted hooks using them and revoked
29
+ * RELEASE_DELAY_MS after the last one unmounts (a remount inside that window
30
+ * keeps the blob). They used to live for the whole session, and chat images,
31
+ * org logos and avatars are not "a few KB": in a desktop shell open for days
32
+ * every distinct image ever shown stayed in memory. `clearAuthedAssetCache`
33
+ * still drops everything at session end.
30
34
  */
31
35
 
32
36
  const resolvedCache = new Map<string, string>();
33
37
  const inFlight = new Map<string, Promise<void>>();
34
38
  let cacheGeneration = 0;
35
39
 
40
+ /** How long an unused blob is kept before it is revoked, in ms. */
41
+ const RELEASE_DELAY_MS = 60_000;
42
+ const refCounts = new Map<string, number>();
43
+ const releaseTimers = new Map<string, ReturnType<typeof setTimeout>>();
44
+
45
+ function scheduleRelease(src: string): void {
46
+ clearTimeout(releaseTimers.get(src));
47
+ releaseTimers.set(
48
+ src,
49
+ setTimeout(() => {
50
+ releaseTimers.delete(src);
51
+ if (refCounts.has(src)) return;
52
+ const blobUrl = resolvedCache.get(src);
53
+ if (blobUrl) URL.revokeObjectURL(blobUrl);
54
+ resolvedCache.delete(src);
55
+ }, RELEASE_DELAY_MS),
56
+ );
57
+ }
58
+
59
+ function acquire(src: string): void {
60
+ clearTimeout(releaseTimers.get(src));
61
+ releaseTimers.delete(src);
62
+ refCounts.set(src, (refCounts.get(src) ?? 0) + 1);
63
+ }
64
+
65
+ function release(src: string): void {
66
+ const remaining = (refCounts.get(src) ?? 1) - 1;
67
+ if (remaining > 0) {
68
+ refCounts.set(src, remaining);
69
+ return;
70
+ }
71
+ refCounts.delete(src);
72
+ scheduleRelease(src);
73
+ }
74
+
36
75
  /**
37
76
  * Drop every cached blob and revoke its object URL. Hosts call this at
38
77
  * session end (logout / forced re-login) so a follow-on login as a
@@ -45,6 +84,8 @@ export function clearAuthedAssetCache(): void {
45
84
  for (const url of resolvedCache.values()) URL.revokeObjectURL(url);
46
85
  resolvedCache.clear();
47
86
  inFlight.clear();
87
+ for (const timer of releaseTimers.values()) clearTimeout(timer);
88
+ releaseTimers.clear();
48
89
  }
49
90
 
50
91
  function fetchAsBlobUrl(src: string, accept: string): Promise<void> {
@@ -57,6 +98,8 @@ function fetchAsBlobUrl(src: string, accept: string): Promise<void> {
57
98
  const blobUrl = URL.createObjectURL(await response.blob());
58
99
  if (startedGeneration === cacheGeneration) {
59
100
  resolvedCache.set(src, blobUrl);
101
+ // Everyone who asked for it unmounted while it was loading.
102
+ if (!refCounts.has(src)) scheduleRelease(src);
60
103
  } else {
61
104
  URL.revokeObjectURL(blobUrl);
62
105
  }
@@ -79,6 +122,15 @@ export function useAuthedAssetSrc(src?: string | null, accept = '*/*'): string |
79
122
  const bearerSrc = src && needsBearerAssetFetch(src) ? src : null;
80
123
  const [, rerender] = useReducer((c: number) => c + 1, 0);
81
124
 
125
+ // Layout, not passive: this render hands out the cached blob URL, and a
126
+ // release timer firing before a passive effect ran would revoke it under
127
+ // the committed <img>.
128
+ useIsomorphicLayoutEffect(() => {
129
+ if (!bearerSrc) return undefined;
130
+ acquire(bearerSrc);
131
+ return () => release(bearerSrc);
132
+ }, [bearerSrc]);
133
+
82
134
  useEffect(() => {
83
135
  if (!bearerSrc || resolvedCache.has(bearerSrc)) return undefined;
84
136
  let cancelled = false;