@flamingo-stack/openframe-frontend-core 0.0.598-2039.5713.1 → 0.0.598

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 (225) hide show
  1. package/dist/chat-protocol/index.cjs +1 -8
  2. package/dist/chat-protocol/index.cjs.map +1 -1
  3. package/dist/chat-protocol/index.d.ts +0 -1
  4. package/dist/chat-protocol/index.d.ts.map +1 -1
  5. package/dist/chat-protocol/index.js +2 -7
  6. package/dist/chat-protocol/index.js.map +1 -1
  7. package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
  8. package/dist/{chunk-TSCIVH7T.js → chunk-2JNCZDJR.js} +2 -2
  9. package/dist/{chunk-6NSGAH5H.cjs → chunk-2SYX2Z7R.cjs} +34 -34
  10. package/dist/{chunk-6NSGAH5H.cjs.map → chunk-2SYX2Z7R.cjs.map} +1 -1
  11. package/dist/{chunk-6ZHH37RS.cjs → chunk-3WSS7C2V.cjs} +15 -15
  12. package/dist/{chunk-6ZHH37RS.cjs.map → chunk-3WSS7C2V.cjs.map} +1 -1
  13. package/dist/{chunk-5L4ERWSW.js → chunk-75YW6ET4.js} +4 -4
  14. package/dist/{chunk-VKCETV3C.js → chunk-BK6CCQG6.js} +12 -12
  15. package/dist/{chunk-HM25MFZX.cjs → chunk-BPVHDDNY.cjs} +8 -8
  16. package/dist/{chunk-HM25MFZX.cjs.map → chunk-BPVHDDNY.cjs.map} +1 -1
  17. package/dist/{chunk-VIBREYUK.cjs → chunk-BZEWPW5A.cjs} +3 -3
  18. package/dist/{chunk-VIBREYUK.cjs.map → chunk-BZEWPW5A.cjs.map} +1 -1
  19. package/dist/{chunk-KYWU6F3O.cjs → chunk-DAPOBLAK.cjs} +39 -39
  20. package/dist/{chunk-KYWU6F3O.cjs.map → chunk-DAPOBLAK.cjs.map} +1 -1
  21. package/dist/{chunk-DHCA5BZP.cjs → chunk-DI3SVVY5.cjs} +85 -85
  22. package/dist/{chunk-DHCA5BZP.cjs.map → chunk-DI3SVVY5.cjs.map} +1 -1
  23. package/dist/{chunk-BLUL2TE3.js → chunk-EVMHJB6X.js} +4 -4
  24. package/dist/{chunk-S6WBBSII.js → chunk-EZM5DNII.js} +3 -3
  25. package/dist/{chunk-BVQEU5JB.js → chunk-GGQZBSFN.js} +2 -2
  26. package/dist/{chunk-KTX5B2FW.js → chunk-GHYFVT52.js} +439 -414
  27. package/dist/chunk-GHYFVT52.js.map +1 -0
  28. package/dist/{chunk-CCWI3622.cjs → chunk-H64ZHSYR.cjs} +4 -4
  29. package/dist/{chunk-CCWI3622.cjs.map → chunk-H64ZHSYR.cjs.map} +1 -1
  30. package/dist/{chunk-4T42D6YG.js → chunk-HLPAVYK7.js} +4 -4
  31. package/dist/{chunk-HFHBA3VV.cjs → chunk-HWAYIK4U.cjs} +22 -22
  32. package/dist/{chunk-HFHBA3VV.cjs.map → chunk-HWAYIK4U.cjs.map} +1 -1
  33. package/dist/{chunk-CF4QJPTN.cjs → chunk-JVZVVZOZ.cjs} +9 -9
  34. package/dist/{chunk-CF4QJPTN.cjs.map → chunk-JVZVVZOZ.cjs.map} +1 -1
  35. package/dist/{chunk-XV7RFACE.js → chunk-KHOZ52NR.js} +6 -6
  36. package/dist/{chunk-IW746HJ7.js → chunk-LRQCKSZC.js} +2 -2
  37. package/dist/{chunk-JJUV7Z4L.cjs → chunk-M4YQUHOR.cjs} +15 -15
  38. package/dist/{chunk-JJUV7Z4L.cjs.map → chunk-M4YQUHOR.cjs.map} +1 -1
  39. package/dist/{chunk-FKBM6U43.js → chunk-MYBXCWEI.js} +2 -2
  40. package/dist/{chunk-QTPHBCPI.js → chunk-NIAMPMKV.js} +4 -4
  41. package/dist/{chunk-UXOOVP77.cjs → chunk-O4VZOA2Q.cjs} +3 -3
  42. package/dist/{chunk-UXOOVP77.cjs.map → chunk-O4VZOA2Q.cjs.map} +1 -1
  43. package/dist/{chunk-ABNBTPI2.cjs → chunk-P24VPJTT.cjs} +15 -15
  44. package/dist/{chunk-ABNBTPI2.cjs.map → chunk-P24VPJTT.cjs.map} +1 -1
  45. package/dist/{chunk-4XPPQDEM.js → chunk-PTK3CINU.js} +5 -5
  46. package/dist/{chunk-7FUIRGMU.js → chunk-PX4IPM7Q.js} +3 -3
  47. package/dist/{chunk-NLT5R43J.cjs → chunk-QD64Q4I2.cjs} +9 -9
  48. package/dist/{chunk-NLT5R43J.cjs.map → chunk-QD64Q4I2.cjs.map} +1 -1
  49. package/dist/{chunk-TEVP4KNG.cjs → chunk-QIKBISZM.cjs} +522 -497
  50. package/dist/chunk-QIKBISZM.cjs.map +1 -0
  51. package/dist/{chunk-FGNUI4CC.js → chunk-R4UV366K.js} +6 -6
  52. package/dist/{chunk-UPKZU6QU.cjs → chunk-RDTOMWDN.cjs} +1 -1
  53. package/dist/chunk-RDTOMWDN.cjs.map +1 -0
  54. package/dist/{chunk-YB6FI2G3.js → chunk-RYXIRVDC.js} +1 -1
  55. package/dist/chunk-RYXIRVDC.js.map +1 -0
  56. package/dist/{chunk-QPAPUIF3.cjs → chunk-SAEJGTCI.cjs} +35 -35
  57. package/dist/{chunk-QPAPUIF3.cjs.map → chunk-SAEJGTCI.cjs.map} +1 -1
  58. package/dist/{chunk-66HTVTZZ.js → chunk-SE3PVN64.js} +2 -2
  59. package/dist/{chunk-3IXDZI3R.cjs → chunk-STYNZ4QM.cjs} +3 -3
  60. package/dist/{chunk-3IXDZI3R.cjs.map → chunk-STYNZ4QM.cjs.map} +1 -1
  61. package/dist/{chunk-CQRYXSHL.js → chunk-TZPVRWPU.js} +5 -5
  62. package/dist/{chunk-RU3IKVY2.js → chunk-UAAXUFK6.js} +3 -3
  63. package/dist/{chunk-F5NEZLTG.cjs → chunk-UE7OFLLS.cjs} +14 -14
  64. package/dist/{chunk-F5NEZLTG.cjs.map → chunk-UE7OFLLS.cjs.map} +1 -1
  65. package/dist/{chunk-VUR24QYH.cjs → chunk-UG7JNQZY.cjs} +37 -37
  66. package/dist/{chunk-VUR24QYH.cjs.map → chunk-UG7JNQZY.cjs.map} +1 -1
  67. package/dist/{chunk-UQSOFWXP.cjs → chunk-V2QK5W3O.cjs} +3 -3
  68. package/dist/{chunk-UQSOFWXP.cjs.map → chunk-V2QK5W3O.cjs.map} +1 -1
  69. package/dist/{chunk-ZABAXD4U.js → chunk-VIRTMRS4.js} +7 -7
  70. package/dist/{chunk-D565OOXC.cjs → chunk-VLJTJAHJ.cjs} +25 -25
  71. package/dist/{chunk-D565OOXC.cjs.map → chunk-VLJTJAHJ.cjs.map} +1 -1
  72. package/dist/{chunk-K5QV7ZAY.js → chunk-VNSRNVPD.js} +437 -756
  73. package/dist/chunk-VNSRNVPD.js.map +1 -0
  74. package/dist/{chunk-UQEOAPAI.cjs → chunk-WCBRZCU4.cjs} +9 -9
  75. package/dist/{chunk-UQEOAPAI.cjs.map → chunk-WCBRZCU4.cjs.map} +1 -1
  76. package/dist/{chunk-3XFDRL32.js → chunk-WDWCQD75.js} +9 -9
  77. package/dist/{chunk-QT35C6CW.js → chunk-WPN545FW.js} +12 -12
  78. package/dist/{chunk-F2KBCLUG.js → chunk-WZJOILPU.js} +2 -2
  79. package/dist/{chunk-KAADFO74.js → chunk-XNPAVMPB.js} +5 -5
  80. package/dist/{chunk-5PPYXXUO.cjs → chunk-YBPFIXV4.cjs} +522 -841
  81. package/dist/chunk-YBPFIXV4.cjs.map +1 -0
  82. package/dist/{chunk-EHAYNUOL.cjs → chunk-YH6IQTPI.cjs} +3 -3
  83. package/dist/{chunk-EHAYNUOL.cjs.map → chunk-YH6IQTPI.cjs.map} +1 -1
  84. package/dist/{chunk-AVAENPVE.cjs → chunk-YWBAIFI2.cjs} +105 -105
  85. package/dist/{chunk-AVAENPVE.cjs.map → chunk-YWBAIFI2.cjs.map} +1 -1
  86. package/dist/components/case-studies/index.cjs +14 -14
  87. package/dist/components/case-studies/index.js +8 -8
  88. package/dist/components/chat/embeddable-chat.d.ts +19 -10
  89. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  90. package/dist/components/chat/hooks/index.d.ts +0 -1
  91. package/dist/components/chat/hooks/index.d.ts.map +1 -1
  92. package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts +2 -2
  93. package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts.map +1 -1
  94. package/dist/components/chat/hooks/use-chat-history-hydration.d.ts +3 -13
  95. package/dist/components/chat/hooks/use-chat-history-hydration.d.ts.map +1 -1
  96. package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +16 -2
  97. package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
  98. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  99. package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
  100. package/dist/components/chat/index.cjs +5 -9
  101. package/dist/components/chat/index.cjs.map +1 -1
  102. package/dist/components/chat/index.js +4 -8
  103. package/dist/components/chat/types/unified-chat-state.types.d.ts +6 -67
  104. package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
  105. package/dist/components/chat/utils/index.d.ts +0 -1
  106. package/dist/components/chat/utils/index.d.ts.map +1 -1
  107. package/dist/components/contact/index.cjs +9 -9
  108. package/dist/components/contact/index.js +8 -8
  109. package/dist/components/docs/index.cjs +12 -12
  110. package/dist/components/docs/index.js +11 -11
  111. package/dist/components/embeds/index.cjs +9 -9
  112. package/dist/components/embeds/index.js +8 -8
  113. package/dist/components/faq/index.cjs +10 -10
  114. package/dist/components/faq/index.js +9 -9
  115. package/dist/components/features/index.cjs +8 -8
  116. package/dist/components/features/index.js +7 -7
  117. package/dist/components/help-center-pages/index.cjs +31 -31
  118. package/dist/components/help-center-pages/index.js +22 -22
  119. package/dist/components/index.cjs +66 -70
  120. package/dist/components/index.cjs.map +1 -1
  121. package/dist/components/index.js +22 -26
  122. package/dist/components/index.js.map +1 -1
  123. package/dist/components/meeting-scheduler/index.cjs +49 -49
  124. package/dist/components/meeting-scheduler/index.js +9 -9
  125. package/dist/components/navigation/index.cjs +11 -11
  126. package/dist/components/navigation/index.js +10 -10
  127. package/dist/components/onboarding-guides/index.cjs +12 -12
  128. package/dist/components/onboarding-guides/index.js +11 -11
  129. package/dist/components/related-content/index.cjs +7 -7
  130. package/dist/components/related-content/index.js +6 -6
  131. package/dist/components/tickets/index.cjs +13 -13
  132. package/dist/components/tickets/index.js +12 -12
  133. package/dist/components/ui/data-table/data-table-body.d.ts.map +1 -1
  134. package/dist/components/ui/data-table/data-table-skeleton.d.ts +31 -0
  135. package/dist/components/ui/data-table/data-table-skeleton.d.ts.map +1 -1
  136. package/dist/components/ui/index.cjs +8 -12
  137. package/dist/components/ui/index.cjs.map +1 -1
  138. package/dist/components/ui/index.js +7 -11
  139. package/dist/components/ui/table/table-empty-state.d.ts +1 -1
  140. package/dist/components/ui/table/table-empty-state.d.ts.map +1 -1
  141. package/dist/components/ui/table/table-skeleton.d.ts +1 -14
  142. package/dist/components/ui/table/table-skeleton.d.ts.map +1 -1
  143. package/dist/components/ui/table/table.d.ts +1 -1
  144. package/dist/components/ui/table/table.d.ts.map +1 -1
  145. package/dist/components/ui/table/types.d.ts +33 -6
  146. package/dist/components/ui/table/types.d.ts.map +1 -1
  147. package/dist/contexts/chat-runtime-context.d.ts +0 -12
  148. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  149. package/dist/contexts/index.cjs +2 -2
  150. package/dist/contexts/index.js +1 -1
  151. package/dist/hooks/index.cjs +5 -5
  152. package/dist/hooks/index.js +4 -4
  153. package/dist/index.cjs +12 -16
  154. package/dist/index.cjs.map +1 -1
  155. package/dist/index.js +11 -15
  156. package/dist/index.js.map +1 -1
  157. package/package.json +1 -1
  158. package/src/chat-protocol/index.ts +0 -1
  159. package/src/chat-protocol/nats-decoder.ts +5 -1
  160. package/src/components/chat/.embeddable-chat.md +2 -4
  161. package/src/components/chat/embeddable-chat.tsx +84 -131
  162. package/src/components/chat/hooks/.use-chat-dialog-manager.md +1 -3
  163. package/src/components/chat/hooks/.use-nats-chat-adapter.md +1 -3
  164. package/src/components/chat/hooks/.use-sse-chat-adapter.md +1 -8
  165. package/src/components/chat/hooks/.use-unified-chat.md +2 -2
  166. package/src/components/chat/hooks/index.ts +0 -2
  167. package/src/components/chat/hooks/use-chat-dialog-manager.ts +65 -38
  168. package/src/components/chat/hooks/use-chat-history-hydration.ts +24 -67
  169. package/src/components/chat/hooks/use-nats-chat-adapter.ts +150 -65
  170. package/src/components/chat/hooks/use-sse-chat-adapter.ts +59 -233
  171. package/src/components/chat/hooks/use-unified-chat.ts +0 -5
  172. package/src/components/chat/types/.unified-chat-state.types.md +1 -13
  173. package/src/components/chat/types/unified-chat-state.types.ts +6 -74
  174. package/src/components/chat/utils/index.ts +0 -7
  175. package/src/components/ui/data-table/data-table-body.tsx +8 -49
  176. package/src/components/ui/data-table/data-table-skeleton.tsx +100 -0
  177. package/src/components/ui/table/table-empty-state.tsx +5 -1
  178. package/src/components/ui/table/table-skeleton.tsx +14 -40
  179. package/src/components/ui/table/table.tsx +34 -15
  180. package/src/components/ui/table/types.ts +33 -6
  181. package/src/contexts/.chat-runtime-context.md +1 -3
  182. package/src/contexts/chat-runtime-context.tsx +0 -12
  183. package/dist/chat-protocol/wire-narrow.d.ts +0 -17
  184. package/dist/chat-protocol/wire-narrow.d.ts.map +0 -1
  185. package/dist/chunk-5PPYXXUO.cjs.map +0 -1
  186. package/dist/chunk-K5QV7ZAY.js.map +0 -1
  187. package/dist/chunk-KTX5B2FW.js.map +0 -1
  188. package/dist/chunk-TEVP4KNG.cjs.map +0 -1
  189. package/dist/chunk-UPKZU6QU.cjs.map +0 -1
  190. package/dist/chunk-YB6FI2G3.js.map +0 -1
  191. package/dist/components/chat/hooks/use-managed-dialog-list.d.ts +0 -68
  192. package/dist/components/chat/hooks/use-managed-dialog-list.d.ts.map +0 -1
  193. package/dist/components/chat/utils/chat-conversations-api.d.ts +0 -29
  194. package/dist/components/chat/utils/chat-conversations-api.d.ts.map +0 -1
  195. package/src/chat-protocol/wire-narrow.ts +0 -22
  196. package/src/components/chat/hooks/.use-managed-dialog-list.md +0 -31
  197. package/src/components/chat/hooks/__tests__/managed-dialog-list.test.ts +0 -280
  198. package/src/components/chat/hooks/__tests__/nats-adapter-managed-dialogs.test.ts +0 -172
  199. package/src/components/chat/hooks/__tests__/sse-managed-dialogs.test.ts +0 -310
  200. package/src/components/chat/hooks/use-managed-dialog-list.ts +0 -371
  201. package/src/components/chat/utils/.chat-conversations-api.md +0 -16
  202. package/src/components/chat/utils/__tests__/chat-conversations-api-golden.test.ts +0 -105
  203. package/src/components/chat/utils/chat-conversations-api.ts +0 -83
  204. /package/dist/{chunk-TSCIVH7T.js.map → chunk-2JNCZDJR.js.map} +0 -0
  205. /package/dist/{chunk-5L4ERWSW.js.map → chunk-75YW6ET4.js.map} +0 -0
  206. /package/dist/{chunk-VKCETV3C.js.map → chunk-BK6CCQG6.js.map} +0 -0
  207. /package/dist/{chunk-BLUL2TE3.js.map → chunk-EVMHJB6X.js.map} +0 -0
  208. /package/dist/{chunk-S6WBBSII.js.map → chunk-EZM5DNII.js.map} +0 -0
  209. /package/dist/{chunk-BVQEU5JB.js.map → chunk-GGQZBSFN.js.map} +0 -0
  210. /package/dist/{chunk-4T42D6YG.js.map → chunk-HLPAVYK7.js.map} +0 -0
  211. /package/dist/{chunk-XV7RFACE.js.map → chunk-KHOZ52NR.js.map} +0 -0
  212. /package/dist/{chunk-IW746HJ7.js.map → chunk-LRQCKSZC.js.map} +0 -0
  213. /package/dist/{chunk-FKBM6U43.js.map → chunk-MYBXCWEI.js.map} +0 -0
  214. /package/dist/{chunk-QTPHBCPI.js.map → chunk-NIAMPMKV.js.map} +0 -0
  215. /package/dist/{chunk-4XPPQDEM.js.map → chunk-PTK3CINU.js.map} +0 -0
  216. /package/dist/{chunk-7FUIRGMU.js.map → chunk-PX4IPM7Q.js.map} +0 -0
  217. /package/dist/{chunk-FGNUI4CC.js.map → chunk-R4UV366K.js.map} +0 -0
  218. /package/dist/{chunk-66HTVTZZ.js.map → chunk-SE3PVN64.js.map} +0 -0
  219. /package/dist/{chunk-CQRYXSHL.js.map → chunk-TZPVRWPU.js.map} +0 -0
  220. /package/dist/{chunk-RU3IKVY2.js.map → chunk-UAAXUFK6.js.map} +0 -0
  221. /package/dist/{chunk-ZABAXD4U.js.map → chunk-VIRTMRS4.js.map} +0 -0
  222. /package/dist/{chunk-3XFDRL32.js.map → chunk-WDWCQD75.js.map} +0 -0
  223. /package/dist/{chunk-QT35C6CW.js.map → chunk-WPN545FW.js.map} +0 -0
  224. /package/dist/{chunk-F2KBCLUG.js.map → chunk-WZJOILPU.js.map} +0 -0
  225. /package/dist/{chunk-KAADFO74.js.map → chunk-XNPAVMPB.js.map} +0 -0
@@ -1,371 +0,0 @@
1
- 'use client';
2
-
3
- /**
4
- * useManagedDialogList — the ONE cursor-paged dialog-list state machine. Three
5
- * consumers: the NATS/Mingo adapter's managed-dialog mode, the SSE/Guide
6
- * adapter (when `ChatRuntime.endpoints.chatConversationsUrl` is set), and the
7
- * Chat Archive page inside `useChatDialogManager`.
8
- *
9
- * Owns: the loaded page of `DialogItem`s, the server cursor, first-page
10
- * loading/error state (with the retry re-arm), cursor pagination, an
11
- * optional server-side search term (a change re-runs page 1), and the
12
- * optimistic rename / archive / delete mutations with rollback.
13
- *
14
- * Does NOT own: which dialog is active, message history for a dialog, or
15
- * the transport (`fetchDialogMessages`, subscriptions, catch-up). Those stay
16
- * in the adapters — they are transport-specific. The adapters react to a
17
- * row leaving the list through `onDialogRemoved` (drop the active id, evict
18
- * the reducer store …) so ordering stays: host callback → local removal →
19
- * adapter side effect, exactly as the NATS adapter did before extraction.
20
- *
21
- * Host callbacks are all optional: without `fetchDialogs` the hook is inert
22
- * (empty list, no network) and a mutation without its callback is a no-op —
23
- * the presence of a callback IS the capability, mirroring the NATS config.
24
- */
25
-
26
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
27
- import type { DialogItem } from '../types/component.types';
28
- import type { FetchDialogsParams, FetchDialogsResult } from '../types/unified-chat-state.types';
29
-
30
- export interface UseManagedDialogListArgs {
31
- /** Gates the AUTOMATIC first-page load only (every other operation is
32
- * caller-driven). The adapters pass their own `active` gate so an idle
33
- * transport does no network; the Chat Archive passes `false` because it
34
- * loads on OPEN, which `openArchive` drives explicitly. */
35
- autoLoad: boolean;
36
- /** Pages the active dialog list. Absent = the hook is inert. */
37
- fetchDialogs?: (params: FetchDialogsParams) => Promise<FetchDialogsResult>;
38
- /** Backend rename — absent = `renameDialog` is a no-op. */
39
- renameDialog?: (id: string, title: string) => Promise<void>;
40
- /** Backend archive — absent = `archiveDialog` is a no-op. */
41
- archiveDialog?: (id: string) => Promise<void>;
42
- /** Backend delete — absent = `deleteDialog` is a no-op. */
43
- deleteDialog?: (id: string) => Promise<void>;
44
- /** Page size sent as `limit`. */
45
- pageSize: number;
46
- /** Delay before a FIRST-PAGE load raises `isDialogsLoading` (the full-view
47
- * skeleton), so a cached/fast fetch never flashes one. `0` (default) raises
48
- * it immediately. Pagination always shows its indicator at once — the list
49
- * stays visible. Use `isDialogsPending` for "a fetch is in flight". */
50
- skeletonDelayMs?: number;
51
- /** Server-side search term. `undefined` = no search support (the NATS
52
- * adapter never sets it, so its wire params stay `{cursor, limit}`); any
53
- * string change — including back to `''` — reloads page 1 with `search`. */
54
- search?: string;
55
- /** Fires AFTER a row was removed locally by a successful archive/delete.
56
- * Read through a latest-ref so its identity never enters the mutation
57
- * callbacks' deps. */
58
- onDialogRemoved?: (id: string, reason: 'archived' | 'deleted') => void;
59
- /** Console prefix for failure logs (`[useNatsChatAdapter]`, `[useSseChatAdapter]`). */
60
- logTag: string;
61
- }
62
-
63
- export interface UseManagedDialogListResult {
64
- dialogs: DialogItem[];
65
- dialogsNextCursor: string | null;
66
- /** Skeleton flag — true while a page request is in flight, subject to
67
- * `skeletonDelayMs` on a first-page load. */
68
- isDialogsLoading: boolean;
69
- /** A fetch is in flight, set SYNCHRONOUSLY and independent of
70
- * `skeletonDelayMs` — so an empty state stays suppressed during the delay
71
- * instead of flashing "no results" before the skeleton appears. */
72
- isDialogsPending: boolean;
73
- /** True when the FIRST page failed — a pagination failure keeps the loaded rows. */
74
- dialogsError: boolean;
75
- hasMoreDialogs: boolean;
76
- /** Load a page: `undefined` cursor = (re)load the first page. */
77
- loadDialogsPage: (cursor?: string) => Promise<void>;
78
- /** Retry / refresh the first page. */
79
- reloadDialogs: () => void;
80
- loadMoreDialogs: () => Promise<void>;
81
- renameDialog: (id: string, title: string) => Promise<void>;
82
- archiveDialog: (id: string) => Promise<void>;
83
- deleteDialog: (id: string) => Promise<void>;
84
- /** Prepend a row (dedupes by id) — a freshly created conversation. */
85
- upsertDialogTop: (item: DialogItem) => void;
86
- /** Drop a row locally, WITHOUT calling a backend callback — for a mutation
87
- * the caller performed itself (e.g. restoring an archived dialog removes it
88
- * from the archived list). No-op for an unknown id. */
89
- removeDialog: (id: string) => void;
90
- /** Move an existing row to the head of the list with a fresh `timestamp` —
91
- * what a new turn does server-side (`last_message_at desc`). No-op for an
92
- * id the list doesn't hold. */
93
- bumpDialogToTop: (id: string) => void;
94
- }
95
-
96
- export function useManagedDialogList({
97
- autoLoad,
98
- fetchDialogs,
99
- renameDialog: renameDialogCallback,
100
- archiveDialog: archiveDialogCallback,
101
- deleteDialog: deleteDialogCallback,
102
- pageSize,
103
- skeletonDelayMs = 0,
104
- search,
105
- onDialogRemoved,
106
- logTag,
107
- }: UseManagedDialogListArgs): UseManagedDialogListResult {
108
- const [dialogs, setDialogs] = useState<DialogItem[]>([]);
109
- const [dialogsNextCursor, setDialogsNextCursor] = useState<string | null>(null);
110
- const [isDialogsLoading, setIsDialogsLoading] = useState<boolean>(false);
111
- // Which `search` value's FIRST PAGE has settled (`null` = the no-search
112
- // case). `undefined` = nothing has settled yet. Seeded unsettled exactly when
113
- // a load is coming, so `isDialogsLoading` reads true from the FIRST render
114
- // rather than only once the effect fires — a consumer that branches on "the
115
- // list is empty" would otherwise see a one-frame empty list on mount, and
116
- // again on every search change, before the request starts.
117
- const [settledSearch, setSettledSearch] = useState<string | null | undefined>(
118
- autoLoad && fetchDialogs ? undefined : null,
119
- );
120
- // The seed above is a FIRST-RENDER value, so it misses a consumer that mounts
121
- // with `autoLoad: false` and turns it on later (a panel opened in the other
122
- // transport's mode, then switched into this one). Re-arm on that transition
123
- // — adjusting state during render, the documented React pattern, guarded so
124
- // the extra pass takes the early exit.
125
- const [autoLoadWas, setAutoLoadWas] = useState(autoLoad);
126
- if (autoLoad !== autoLoadWas) {
127
- setAutoLoadWas(autoLoad);
128
- if (autoLoad && fetchDialogs) setSettledSearch(undefined);
129
- }
130
- const [isDialogsPending, setIsDialogsPending] = useState<boolean>(false);
131
- // Synchronous mirror: `loadMoreDialogs` must see a page-1 load dispatched in
132
- // the SAME tick, which the state value (a stale render closure) would miss.
133
- const pendingRef = useRef(false);
134
- const [dialogsError, setDialogsError] = useState<boolean>(false);
135
-
136
- // Latest-list mirror for the optimistic mutations: the rollback title must
137
- // be read SYNCHRONOUSLY at call time. Capturing it inside a `setDialogs`
138
- // updater is not reliable — React may run the updater only at render time,
139
- // after an immediately-rejecting callback has already reached the catch.
140
- const dialogsRef = useRef<DialogItem[]>(dialogs);
141
- useEffect(() => {
142
- dialogsRef.current = dialogs;
143
- });
144
-
145
- const onDialogRemovedRef = useRef(onDialogRemoved);
146
- useEffect(() => {
147
- onDialogRemovedRef.current = onDialogRemoved;
148
- });
149
-
150
- // Released on a first-page failure so a retry / re-activation re-runs the
151
- // initial load.
152
- const initialDialogsLoadedRef = useRef(false);
153
-
154
- // Monotonic request id. Page-1 loads overlap in normal use — a search-term
155
- // change, the end-of-turn refresh and an unarchive all trigger one — so
156
- // without this the LAST-RESOLVING response wins: the list can show results
157
- // for an earlier search term under a newer query, paginate with the wrong
158
- // cursor, or have its loading flag cleared while another fetch is still in
159
- // flight. Only the latest request may touch the list/cursor/flags. (Same
160
- // guard `useChatDialogManager.loadArchivedPage` has always carried.)
161
- const requestIdRef = useRef(0);
162
-
163
- const loadDialogsPage = useCallback(
164
- async (cursor?: string): Promise<void> => {
165
- if (!fetchDialogs) return;
166
- const requestId = ++requestIdRef.current;
167
- const isCurrent = () => requestIdRef.current === requestId;
168
- pendingRef.current = true;
169
- setIsDialogsPending(true);
170
- let skeletonTimer: ReturnType<typeof setTimeout> | undefined;
171
- if (cursor === undefined && skeletonDelayMs > 0) {
172
- skeletonTimer = setTimeout(() => {
173
- if (isCurrent()) setIsDialogsLoading(true);
174
- }, skeletonDelayMs);
175
- } else {
176
- setIsDialogsLoading(true);
177
- }
178
- // Clear a prior first-page error when (re)loading the first page.
179
- if (cursor === undefined) setDialogsError(false);
180
- try {
181
- const result = await fetchDialogs({
182
- cursor,
183
- limit: pageSize,
184
- // Only hosts that run a search ever see the key.
185
- ...(search !== undefined ? { search } : {}),
186
- });
187
- // Superseded by a newer load — drop the response entirely.
188
- if (!isCurrent()) return;
189
- setDialogsNextCursor(result.nextCursor);
190
- if (cursor === undefined) {
191
- setDialogs(result.dialogs);
192
- } else {
193
- // Dedupe on append: a row whose `last_message_at` moved between page
194
- // fetches can come back on a later page, and duplicate ids mean
195
- // duplicate React keys.
196
- setDialogs(prev => {
197
- const seen = new Set(prev.map(d => d.id));
198
- return [...prev, ...result.dialogs.filter(d => !seen.has(d.id))];
199
- });
200
- }
201
- } catch (err) {
202
- if (!isCurrent()) return;
203
- console.error(`${logTag} fetchDialogs failed:`, err);
204
- // Only the FIRST page failing is a "can't show the list" error — a
205
- // pagination failure keeps the already-loaded list intact. Flag it and
206
- // release the initial-load guard so a retry (or re-activation) re-runs.
207
- if (cursor === undefined) {
208
- setDialogsError(true);
209
- initialDialogsLoadedRef.current = false;
210
- }
211
- } finally {
212
- if (skeletonTimer) clearTimeout(skeletonTimer);
213
- // Only the latest request owns the shared flags.
214
- if (isCurrent()) {
215
- pendingRef.current = false;
216
- if (cursor === undefined) setSettledSearch(search ?? null);
217
- setIsDialogsLoading(false);
218
- setIsDialogsPending(false);
219
- }
220
- }
221
- },
222
- [fetchDialogs, pageSize, skeletonDelayMs, search, logTag],
223
- );
224
-
225
- const reloadDialogs = useCallback(() => {
226
- void loadDialogsPage();
227
- }, [loadDialogsPage]);
228
-
229
- // Initial dialog list load — and, for hosts that run a search, the page-1
230
- // reload on every term change (the term the loaded page was fetched for is
231
- // remembered so the same term never double-loads). Inert for hosts that
232
- // never set `search` (NATS): `loadedSearchRef` stays `undefined` there and
233
- // the once-guard alone decides.
234
- const loadedSearchRef = useRef<string | undefined>(undefined);
235
- useEffect(() => {
236
- if (!fetchDialogs) return;
237
- if (!autoLoad) return;
238
- if (initialDialogsLoadedRef.current && loadedSearchRef.current === search) return;
239
- initialDialogsLoadedRef.current = true;
240
- loadedSearchRef.current = search;
241
- void loadDialogsPage();
242
- }, [autoLoad, fetchDialogs, search, loadDialogsPage]);
243
-
244
- const removeLocal = useCallback((id: string) => {
245
- setDialogs(prev => prev.filter(d => d.id !== id));
246
- }, []);
247
-
248
- const deleteDialog = useCallback(
249
- async (id: string): Promise<void> => {
250
- if (!deleteDialogCallback) return;
251
- try {
252
- await deleteDialogCallback(id);
253
- removeLocal(id);
254
- onDialogRemovedRef.current?.(id, 'deleted');
255
- } catch (err) {
256
- console.error(`${logTag} deleteDialog failed:`, err);
257
- // Re-thrown: a caller that opened a confirmation modal must be able to
258
- // keep it open and NOT tear down the open thread for a write that
259
- // never landed (`useChatDialogManager.handleConfirmArchive`).
260
- throw err;
261
- }
262
- },
263
- [deleteDialogCallback, removeLocal, logTag],
264
- );
265
-
266
- const renameDialog = useCallback(
267
- async (id: string, title: string): Promise<void> => {
268
- if (!renameDialogCallback) return;
269
- // Optimistic — update the local title immediately, roll back on error.
270
- const previous = dialogsRef.current.find(d => d.id === id)?.title;
271
- setDialogs(prev => prev.map(d => (d.id === id ? { ...d, title } : d)));
272
- try {
273
- await renameDialogCallback(id, title);
274
- } catch (err) {
275
- console.error(`${logTag} renameDialog failed:`, err);
276
- if (previous !== undefined) {
277
- setDialogs(prev => prev.map(d => (d.id === id ? { ...d, title: previous } : d)));
278
- }
279
- // Re-thrown like archive/delete: without it the optimistic title just
280
- // silently reverts a moment later and the user is never told the
281
- // rename did not land.
282
- throw err;
283
- }
284
- },
285
- [renameDialogCallback, logTag],
286
- );
287
-
288
- const archiveDialog = useCallback(
289
- async (id: string): Promise<void> => {
290
- if (!archiveDialogCallback) return;
291
- try {
292
- await archiveDialogCallback(id);
293
- removeLocal(id);
294
- onDialogRemovedRef.current?.(id, 'archived');
295
- } catch (err) {
296
- console.error(`${logTag} archiveDialog failed:`, err);
297
- // Re-thrown so `useChatDialogManager.handleConfirmArchive` can keep the
298
- // confirmation modal open for a retry instead of closing it and wiping
299
- // the open conversation over a write the server rejected.
300
- throw err;
301
- }
302
- },
303
- [archiveDialogCallback, removeLocal, logTag],
304
- );
305
-
306
- const loadMoreDialogs = useCallback(async (): Promise<void> => {
307
- if (!dialogsNextCursor) return;
308
- // A page-1 reload in flight will REPLACE the list and the cursor, so an
309
- // append started now would land on a list that no longer exists, using a
310
- // stale cursor. Skip it; the reload's own result is the fresh page 1.
311
- if (pendingRef.current) return;
312
- await loadDialogsPage(dialogsNextCursor);
313
- }, [dialogsNextCursor, loadDialogsPage]);
314
-
315
- const upsertDialogTop = useCallback((item: DialogItem) => {
316
- setDialogs(prev => [item, ...prev.filter(d => d.id !== item.id)]);
317
- }, []);
318
-
319
- const removeDialog = removeLocal;
320
-
321
- const bumpDialogToTop = useCallback((id: string) => {
322
- setDialogs(prev => {
323
- const row = prev.find(d => d.id === id);
324
- if (!row) return prev;
325
- return [{ ...row, timestamp: new Date() }, ...prev.filter(d => d.id !== id)];
326
- });
327
- }, []);
328
-
329
- const hasMoreDialogs = dialogsNextCursor != null;
330
- // Reported as loading until the first page for the CURRENT search settles —
331
- // see `settledSearch`.
332
- const awaitingFirstPage = !!fetchDialogs && settledSearch !== (search ?? null);
333
- const dialogsLoading = isDialogsLoading || awaitingFirstPage;
334
-
335
- return useMemo<UseManagedDialogListResult>(
336
- () => ({
337
- dialogs,
338
- dialogsNextCursor,
339
- isDialogsLoading: dialogsLoading,
340
- isDialogsPending,
341
- dialogsError,
342
- hasMoreDialogs,
343
- loadDialogsPage,
344
- reloadDialogs,
345
- loadMoreDialogs,
346
- renameDialog,
347
- archiveDialog,
348
- deleteDialog,
349
- upsertDialogTop,
350
- removeDialog,
351
- bumpDialogToTop,
352
- }),
353
- [
354
- dialogs,
355
- dialogsNextCursor,
356
- dialogsLoading,
357
- isDialogsPending,
358
- dialogsError,
359
- hasMoreDialogs,
360
- loadDialogsPage,
361
- reloadDialogs,
362
- loadMoreDialogs,
363
- renameDialog,
364
- archiveDialog,
365
- deleteDialog,
366
- upsertDialogTop,
367
- removeDialog,
368
- bumpDialogToTop,
369
- ],
370
- );
371
- }
@@ -1,16 +0,0 @@
1
- <!-- source-hash: a771c833d70e73ea6c8571343495d470 -->
2
- Wire client for the SSE/Guide conversation list — the ONE place the `ChatRuntime.endpoints.chatConversationsUrl` contract is spelled out.
3
-
4
- ## Key Components
5
-
6
- ### `createChatConversationsApi(baseUrl)` → `ChatConversationsApi`
7
- - `fetchDialogs({ status, cursor, limit, search })` — `GET <base>?status=active|archived&limit=&cursor=&search=` (empty params omitted); unwraps the route-base `{ data }` envelope; maps rows to `DialogItem` (ISO `timestamp` → `Date`, empty title → `'Untitled chat'`)
8
- - `renameDialog(id, title)` — `PATCH <base>/<id>` body `{ title }`
9
- - `archiveDialog(id)` — `PATCH <base>/<id>` body `{ archived: true }`
10
- - `unarchiveDialog(id)` — `PATCH <base>/<id>` body `{ archived: false }`
11
-
12
- All calls go through `embedAuthedFetch` with its DEFAULT credentials mode: the hub identifies anonymous visitors with an httpOnly cookie and `same-origin` is what carries it — never override `credentials`. Failures throw the server's own error copy (`readServerErrorMessage`) or a status fallback.
13
-
14
- ## Source
15
-
16
- [`chat-conversations-api.ts`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/chat-conversations-api.ts)
@@ -1,105 +0,0 @@
1
- /**
2
- * GOLDEN CONTRACT TESTS — the `chatConversationsUrl` wire client. Pins the
3
- * exact URLs, query strings and PATCH bodies the hub route serves, the
4
- * `{ data }` envelope unwrap, the ISO→Date mapping, and the server-copy
5
- * error surfacing.
6
- */
7
-
8
- import { describe, it, expect, vi, afterEach } from 'vitest';
9
- import { createChatConversationsApi } from '../chat-conversations-api';
10
-
11
- const jsonResponse = (body: unknown, status = 200) =>
12
- ({ ok: status >= 200 && status < 300, status, json: () => Promise.resolve(body) }) as unknown as Response;
13
-
14
- afterEach(() => {
15
- vi.unstubAllGlobals();
16
- });
17
-
18
- describe('createChatConversationsApi', () => {
19
- it('GET builds the query string, unwraps the envelope, maps timestamps to Date', async () => {
20
- const fetchMock = vi.fn(() =>
21
- Promise.resolve(
22
- jsonResponse({
23
- data: {
24
- dialogs: [
25
- { id: 'a', title: 'Alpha', timestamp: '2026-09-06T10:00:00.000Z' },
26
- { id: 'b', title: '', timestamp: 'not-a-date' },
27
- { nope: true },
28
- ],
29
- nextCursor: 'c1',
30
- },
31
- }),
32
- ),
33
- );
34
- vi.stubGlobal('fetch', fetchMock);
35
- const api = createChatConversationsApi('/api/docs/chat/conversations/');
36
-
37
- const result = await api.fetchDialogs({ status: 'active', limit: 20, cursor: 'c0', search: 'al pha' });
38
-
39
- const [url, init] = fetchMock.mock.calls[0] as unknown as [string, RequestInit];
40
- expect(url).toBe('/api/docs/chat/conversations?status=active&limit=20&cursor=c0&search=al+pha');
41
- expect(init.method).toBe('GET');
42
- expect(init.credentials).toBe('same-origin');
43
- expect(result.nextCursor).toBe('c1');
44
- expect(result.dialogs).toEqual([
45
- { id: 'a', title: 'Alpha', timestamp: new Date('2026-09-06T10:00:00.000Z') },
46
- { id: 'b', title: 'Untitled chat' },
47
- ]);
48
- });
49
-
50
- it('accepts a RAW body as well as the { data } envelope', async () => {
51
- // `successResponse` is `NextResponse.json(data)` — no envelope. The
52
- // envelope branch exists for embedders proxying a wrapped payload.
53
- const fetchMock = vi.fn(() =>
54
- Promise.resolve(
55
- jsonResponse({ dialogs: [{ id: 'r', title: 'Raw', timestamp: '2026-09-06T10:00:00.000Z' }], nextCursor: null }),
56
- ),
57
- );
58
- vi.stubGlobal('fetch', fetchMock);
59
- const api = createChatConversationsApi('/api/docs/chat/conversations');
60
- const result = await api.fetchDialogs({ status: 'active' });
61
- expect(result.dialogs).toEqual([{ id: 'r', title: 'Raw', timestamp: new Date('2026-09-06T10:00:00.000Z') }]);
62
- expect(result.nextCursor).toBeNull();
63
- });
64
-
65
- it('GET omits empty optional params', async () => {
66
- const fetchMock = vi.fn(() => Promise.resolve(jsonResponse({ data: { dialogs: [], nextCursor: null } })));
67
- vi.stubGlobal('fetch', fetchMock);
68
- const api = createChatConversationsApi('/api/docs/chat/conversations');
69
- await api.fetchDialogs({ status: 'archived', search: '' });
70
- expect((fetchMock.mock.calls[0] as unknown as [string])[0]).toBe('/api/docs/chat/conversations?status=archived');
71
- });
72
-
73
- it('PATCH bodies: rename / archive / restore', async () => {
74
- const fetchMock = vi.fn(() => Promise.resolve(jsonResponse({ data: { id: 'x' } })));
75
- vi.stubGlobal('fetch', fetchMock);
76
- const api = createChatConversationsApi('/api/docs/chat/conversations');
77
- await api.renameDialog('id/with slash', 'New title');
78
- await api.archiveDialog('x');
79
- await api.unarchiveDialog('x');
80
- const calls = fetchMock.mock.calls as unknown as Array<[string, RequestInit]>;
81
- expect(calls[0][0]).toBe('/api/docs/chat/conversations/id%2Fwith%20slash');
82
- expect(calls[0][1].method).toBe('PATCH');
83
- expect(JSON.parse(String(calls[0][1].body))).toEqual({ title: 'New title' });
84
- expect(JSON.parse(String(calls[1][1].body))).toEqual({ archived: true });
85
- expect(JSON.parse(String(calls[2][1].body))).toEqual({ archived: false });
86
- });
87
-
88
- it('surfaces the server error copy from the route-base envelope', async () => {
89
- vi.stubGlobal(
90
- 'fetch',
91
- vi.fn(() => Promise.resolve(jsonResponse({ error: 'Conversation not found', code: 'NOT_FOUND' }, 404))),
92
- );
93
- const api = createChatConversationsApi('/api/docs/chat/conversations');
94
- await expect(api.renameDialog('x', 'y')).rejects.toThrow('Conversation not found');
95
- });
96
-
97
- it('falls back to a status line when the error body is not the envelope', async () => {
98
- vi.stubGlobal(
99
- 'fetch',
100
- vi.fn(() => Promise.resolve(jsonResponse('<html/>', 502))),
101
- );
102
- const api = createChatConversationsApi('/api/docs/chat/conversations');
103
- await expect(api.fetchDialogs({ status: 'active' })).rejects.toThrow('Conversation list failed: 502');
104
- });
105
- });
@@ -1,83 +0,0 @@
1
- /**
2
- * Conversation-list wire client for the SSE/Guide chat — the ONE place the
3
- * `ChatRuntime.endpoints.chatConversationsUrl` contract is spelled out:
4
- *
5
- * GET `<base>?status=active|archived&limit=&cursor=&search=`
6
- * → route-base envelope `{ data: { dialogs, nextCursor } }`
7
- * PATCH `<base>/<id>` body `{ title }` (rename)
8
- * PATCH `<base>/<id>` body `{ archived: true }` (archive)
9
- * PATCH `<base>/<id>` body `{ archived: false }` (restore)
10
- *
11
- * Goes through `embedAuthedFetch` with its DEFAULT credentials mode — the
12
- * hub identifies anonymous visitors with an httpOnly cookie, and
13
- * `same-origin` is exactly what carries it. Never override `credentials`.
14
- *
15
- * Wire rows are mapped to `DialogItem`; the ISO `timestamp` becomes a
16
- * `Date` so the list's Today/Yesterday/Older grouping is deterministic.
17
- */
18
-
19
- import { readServerErrorMessage } from '../../../chat-protocol/confirm-tool';
20
- import { isRecord, unwrapEnvelope } from '../../../chat-protocol/wire-narrow';
21
- import { embedAuthedFetch } from '../../../utils/embed-authed-fetch';
22
- import type { DialogItem } from '../types/component.types';
23
- import type { FetchDialogsParams, FetchDialogsResult } from '../types/unified-chat-state.types';
24
-
25
- export type ChatConversationStatus = 'active' | 'archived';
26
-
27
- export interface ChatConversationsApi {
28
- fetchDialogs(params: FetchDialogsParams & { status: ChatConversationStatus }): Promise<FetchDialogsResult>;
29
- renameDialog(id: string, title: string): Promise<void>;
30
- archiveDialog(id: string): Promise<void>;
31
- unarchiveDialog(id: string): Promise<void>;
32
- }
33
-
34
- function toDialogItem(row: unknown): DialogItem | null {
35
- if (!isRecord(row)) return null;
36
- const id = typeof row.id === 'string' ? row.id : '';
37
- if (!id) return null;
38
- const title = typeof row.title === 'string' && row.title.length > 0 ? row.title : 'Untitled chat';
39
- const ts = typeof row.timestamp === 'string' ? new Date(row.timestamp) : undefined;
40
- return {
41
- id,
42
- title,
43
- ...(ts && !Number.isNaN(ts.getTime()) ? { timestamp: ts } : {}),
44
- ...(typeof row.lastMessage === 'string' ? { lastMessage: row.lastMessage } : {}),
45
- };
46
- }
47
-
48
- async function failWith(response: Response, fallback: string): Promise<never> {
49
- const message = await readServerErrorMessage(response);
50
- throw new Error(message ?? `${fallback}: ${response.status}`);
51
- }
52
-
53
- export function createChatConversationsApi(baseUrl: string): ChatConversationsApi {
54
- const base = baseUrl.replace(/\/+$/, '');
55
-
56
- const patch = async (id: string, body: Record<string, unknown>, what: string): Promise<void> => {
57
- const response = await embedAuthedFetch(`${base}/${encodeURIComponent(id)}`, {
58
- method: 'PATCH',
59
- body: JSON.stringify(body),
60
- });
61
- if (!response.ok) await failWith(response, `${what} failed`);
62
- };
63
-
64
- return {
65
- async fetchDialogs({ status, cursor, limit, search }) {
66
- const qs = new URLSearchParams();
67
- qs.set('status', status);
68
- if (limit !== undefined) qs.set('limit', String(limit));
69
- if (cursor) qs.set('cursor', cursor);
70
- if (search) qs.set('search', search);
71
- const response = await embedAuthedFetch(`${base}?${qs.toString()}`, { method: 'GET' });
72
- if (!response.ok) await failWith(response, 'Conversation list failed');
73
- const body = unwrapEnvelope(await response.json());
74
- const rawDialogs = isRecord(body) && Array.isArray(body.dialogs) ? body.dialogs : [];
75
- const dialogs = rawDialogs.map(toDialogItem).filter((d): d is DialogItem => d !== null);
76
- const nextCursor = isRecord(body) && typeof body.nextCursor === 'string' ? body.nextCursor : null;
77
- return { dialogs, nextCursor };
78
- },
79
- renameDialog: (id, title) => patch(id, { title }, 'Rename'),
80
- archiveDialog: id => patch(id, { archived: true }, 'Archive'),
81
- unarchiveDialog: id => patch(id, { archived: false }, 'Restore'),
82
- };
83
- }