@semiont/react-ui 0.2.35-build.99 → 0.2.35

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 (209) hide show
  1. package/README.md +1 -0
  2. package/dist/{EventBusContext-DMI4uwYk.d.mts → EventBusContext-CLnb2LmB.d.mts} +5 -5
  3. package/dist/{PdfAnnotationCanvas.client-HNYRKFDS.mjs → PdfAnnotationCanvas.client-COQREPXU.mjs} +7 -7
  4. package/dist/PdfAnnotationCanvas.client-COQREPXU.mjs.map +1 -0
  5. package/dist/ar-7SUXNE34.mjs +376 -0
  6. package/dist/ar-7SUXNE34.mjs.map +1 -0
  7. package/dist/bn-XOET3DOI.mjs +376 -0
  8. package/dist/bn-XOET3DOI.mjs.map +1 -0
  9. package/dist/{chunk-YI5IX5ZA.mjs → chunk-2HGWOLVN.mjs} +1 -1
  10. package/dist/{chunk-YI5IX5ZA.mjs.map → chunk-2HGWOLVN.mjs.map} +1 -1
  11. package/dist/{chunk-3FIQXKQF.mjs → chunk-Q2KV6Y2J.mjs} +28 -28
  12. package/dist/{chunk-MWQ5CNKW.mjs → chunk-ZPV43WN2.mjs} +11 -11
  13. package/dist/chunk-ZPV43WN2.mjs.map +1 -0
  14. package/dist/cs-X63DXX7L.mjs +376 -0
  15. package/dist/cs-X63DXX7L.mjs.map +1 -0
  16. package/dist/da-OWTCV57A.mjs +376 -0
  17. package/dist/da-OWTCV57A.mjs.map +1 -0
  18. package/dist/de-77BMFDVF.mjs +376 -0
  19. package/dist/de-77BMFDVF.mjs.map +1 -0
  20. package/dist/el-FIBNLH2V.mjs +376 -0
  21. package/dist/el-FIBNLH2V.mjs.map +1 -0
  22. package/dist/fa-3N4CIWE6.mjs +376 -0
  23. package/dist/fa-3N4CIWE6.mjs.map +1 -0
  24. package/dist/fi-JOM3M7Z4.mjs +376 -0
  25. package/dist/fi-JOM3M7Z4.mjs.map +1 -0
  26. package/dist/fr-56QSXS7E.mjs +376 -0
  27. package/dist/fr-56QSXS7E.mjs.map +1 -0
  28. package/dist/he-SNAXPJEK.mjs +376 -0
  29. package/dist/he-SNAXPJEK.mjs.map +1 -0
  30. package/dist/hi-CRBRD5TB.mjs +376 -0
  31. package/dist/hi-CRBRD5TB.mjs.map +1 -0
  32. package/dist/id-BRCVLICF.mjs +376 -0
  33. package/dist/id-BRCVLICF.mjs.map +1 -0
  34. package/dist/index.d.mts +169 -165
  35. package/dist/index.mjs +317 -313
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/it-M2Z27BNB.mjs +376 -0
  38. package/dist/it-M2Z27BNB.mjs.map +1 -0
  39. package/dist/ja-TZUKW7HD.mjs +376 -0
  40. package/dist/ja-TZUKW7HD.mjs.map +1 -0
  41. package/dist/ko-NKBGGOL6.mjs +376 -0
  42. package/dist/ko-NKBGGOL6.mjs.map +1 -0
  43. package/dist/ms-XFXPN6RX.mjs +376 -0
  44. package/dist/ms-XFXPN6RX.mjs.map +1 -0
  45. package/dist/nl-MVYXAS5C.mjs +379 -0
  46. package/dist/nl-MVYXAS5C.mjs.map +1 -0
  47. package/dist/no-XOLO4JPV.mjs +376 -0
  48. package/dist/no-XOLO4JPV.mjs.map +1 -0
  49. package/dist/pl-TRWLMMC4.mjs +376 -0
  50. package/dist/pl-TRWLMMC4.mjs.map +1 -0
  51. package/dist/pt-M3TE24UI.mjs +376 -0
  52. package/dist/pt-M3TE24UI.mjs.map +1 -0
  53. package/dist/ro-QBFG2T64.mjs +376 -0
  54. package/dist/ro-QBFG2T64.mjs.map +1 -0
  55. package/dist/sv-IUECBXWX.mjs +376 -0
  56. package/dist/sv-IUECBXWX.mjs.map +1 -0
  57. package/dist/test-utils.d.mts +2 -2
  58. package/dist/test-utils.mjs +2 -2
  59. package/dist/th-US7KIN5Q.mjs +376 -0
  60. package/dist/th-US7KIN5Q.mjs.map +1 -0
  61. package/dist/tr-DWJ2FFUK.mjs +376 -0
  62. package/dist/tr-DWJ2FFUK.mjs.map +1 -0
  63. package/dist/uk-M4ZE4DPZ.mjs +376 -0
  64. package/dist/uk-M4ZE4DPZ.mjs.map +1 -0
  65. package/dist/vi-FERZNPSH.mjs +376 -0
  66. package/dist/vi-FERZNPSH.mjs.map +1 -0
  67. package/dist/zh-3J2I3WYK.mjs +376 -0
  68. package/dist/zh-3J2I3WYK.mjs.map +1 -0
  69. package/package.json +1 -1
  70. package/src/components/AnnotateReferencesProgressWidget.tsx +5 -5
  71. package/src/components/CodeMirrorRenderer.tsx +5 -5
  72. package/src/components/Toolbar.tsx +2 -2
  73. package/src/components/annotation/AnnotateToolbar.tsx +9 -9
  74. package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +17 -17
  75. package/src/components/image-annotation/AnnotationOverlay.tsx +10 -10
  76. package/src/components/image-annotation/SvgDrawingCanvas.tsx +4 -4
  77. package/src/components/navigation/CollapsibleResourceNavigation.tsx +7 -7
  78. package/src/components/navigation/ObservableLink.tsx +3 -3
  79. package/src/components/navigation/SimpleNavigation.tsx +2 -2
  80. package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +8 -8
  81. package/src/components/resource/AnnotateView.tsx +12 -12
  82. package/src/components/resource/BrowseView.tsx +9 -9
  83. package/src/components/resource/ResourceViewer.tsx +23 -23
  84. package/src/components/resource/__tests__/BrowseView.test.tsx +27 -27
  85. package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +1 -1
  86. package/src/components/resource/panels/AssessmentEntry.tsx +2 -2
  87. package/src/components/resource/panels/AssessmentPanel.tsx +7 -7
  88. package/src/components/resource/panels/AssistSection.tsx +5 -5
  89. package/src/components/resource/panels/CommentEntry.tsx +2 -2
  90. package/src/components/resource/panels/CommentsPanel.tsx +7 -7
  91. package/src/components/resource/panels/HighlightEntry.tsx +2 -2
  92. package/src/components/resource/panels/HighlightPanel.tsx +5 -5
  93. package/src/components/resource/panels/ReferenceEntry.tsx +8 -8
  94. package/src/components/resource/panels/ReferencesPanel.tsx +10 -10
  95. package/src/components/resource/panels/ResourceInfoPanel.tsx +6 -6
  96. package/src/components/resource/panels/TagEntry.tsx +2 -2
  97. package/src/components/resource/panels/TaggingPanel.tsx +8 -8
  98. package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +2 -2
  99. package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +4 -4
  100. package/src/components/resource/panels/__tests__/AssistSection.test.tsx +4 -4
  101. package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +8 -8
  102. package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +3 -3
  103. package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +1 -1
  104. package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +3 -3
  105. package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +9 -9
  106. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +5 -5
  107. package/src/features/admin-devops/components/AdminDevOpsPage.tsx +2 -1
  108. package/src/features/admin-security/components/AdminSecurityPage.tsx +2 -1
  109. package/src/features/admin-users/components/AdminUsersPage.tsx +2 -1
  110. package/src/features/moderate-entity-tags/components/EntityTagsPage.tsx +2 -1
  111. package/src/features/moderate-recent/components/RecentDocumentsPage.tsx +2 -1
  112. package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +2 -1
  113. package/src/features/resource-compose/components/ResourceComposePage.tsx +2 -1
  114. package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +2 -1
  115. package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +26 -26
  116. package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +21 -21
  117. package/src/features/resource-viewer/__tests__/AnnotationProgressDismissal.test.tsx +23 -23
  118. package/src/features/resource-viewer/__tests__/{ResolutionFlowIntegration.test.tsx → BindFlowIntegration.test.tsx} +49 -49
  119. package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +18 -18
  120. package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +19 -19
  121. package/src/features/resource-viewer/__tests__/ResourceMutations.test.tsx +19 -19
  122. package/src/features/resource-viewer/__tests__/ToastNotifications.test.tsx +13 -13
  123. package/src/features/resource-viewer/__tests__/{GenerationFlowIntegration.test.tsx → YieldFlowIntegration.test.tsx} +34 -34
  124. package/src/features/resource-viewer/__tests__/annotation-progress-flow.test.tsx +11 -11
  125. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +55 -55
  126. package/translations/ar.json +298 -298
  127. package/translations/bn.json +298 -298
  128. package/translations/cs.json +295 -295
  129. package/translations/da.json +282 -282
  130. package/translations/de.json +281 -281
  131. package/translations/el.json +298 -298
  132. package/translations/fa.json +298 -298
  133. package/translations/fi.json +298 -298
  134. package/translations/fr.json +279 -279
  135. package/translations/he.json +298 -298
  136. package/translations/hi.json +298 -298
  137. package/translations/id.json +295 -295
  138. package/translations/it.json +299 -299
  139. package/translations/ja.json +298 -298
  140. package/translations/ko.json +298 -298
  141. package/translations/ms.json +296 -296
  142. package/translations/nl.json +299 -296
  143. package/translations/no.json +292 -292
  144. package/translations/pl.json +297 -297
  145. package/translations/pt.json +294 -294
  146. package/translations/ro.json +298 -298
  147. package/translations/sv.json +293 -293
  148. package/translations/th.json +298 -298
  149. package/translations/tr.json +298 -298
  150. package/translations/uk.json +298 -298
  151. package/translations/vi.json +298 -298
  152. package/translations/zh.json +298 -298
  153. package/dist/PdfAnnotationCanvas.client-HNYRKFDS.mjs.map +0 -1
  154. package/dist/ar-MDB7HC5S.mjs +0 -376
  155. package/dist/ar-MDB7HC5S.mjs.map +0 -1
  156. package/dist/bn-3SAV2ZEM.mjs +0 -376
  157. package/dist/bn-3SAV2ZEM.mjs.map +0 -1
  158. package/dist/chunk-MWQ5CNKW.mjs.map +0 -1
  159. package/dist/cs-AWCETEUV.mjs +0 -376
  160. package/dist/cs-AWCETEUV.mjs.map +0 -1
  161. package/dist/da-UZZHXYLC.mjs +0 -376
  162. package/dist/da-UZZHXYLC.mjs.map +0 -1
  163. package/dist/de-LQFWN6S5.mjs +0 -376
  164. package/dist/de-LQFWN6S5.mjs.map +0 -1
  165. package/dist/el-IWOETBJ7.mjs +0 -376
  166. package/dist/el-IWOETBJ7.mjs.map +0 -1
  167. package/dist/fa-BVEJZT5S.mjs +0 -376
  168. package/dist/fa-BVEJZT5S.mjs.map +0 -1
  169. package/dist/fi-JBNCGGA6.mjs +0 -376
  170. package/dist/fi-JBNCGGA6.mjs.map +0 -1
  171. package/dist/fr-OLH7PNGI.mjs +0 -376
  172. package/dist/fr-OLH7PNGI.mjs.map +0 -1
  173. package/dist/he-KOJQ4HMA.mjs +0 -376
  174. package/dist/he-KOJQ4HMA.mjs.map +0 -1
  175. package/dist/hi-BKJFZXAY.mjs +0 -376
  176. package/dist/hi-BKJFZXAY.mjs.map +0 -1
  177. package/dist/id-DPLHJVNP.mjs +0 -376
  178. package/dist/id-DPLHJVNP.mjs.map +0 -1
  179. package/dist/it-JXHAM7NL.mjs +0 -376
  180. package/dist/it-JXHAM7NL.mjs.map +0 -1
  181. package/dist/ja-DQRAO3PU.mjs +0 -376
  182. package/dist/ja-DQRAO3PU.mjs.map +0 -1
  183. package/dist/ko-6IFCOP6F.mjs +0 -376
  184. package/dist/ko-6IFCOP6F.mjs.map +0 -1
  185. package/dist/ms-KF5S2TLL.mjs +0 -376
  186. package/dist/ms-KF5S2TLL.mjs.map +0 -1
  187. package/dist/nl-2GUUZLQM.mjs +0 -376
  188. package/dist/nl-2GUUZLQM.mjs.map +0 -1
  189. package/dist/no-2IBCZGEF.mjs +0 -376
  190. package/dist/no-2IBCZGEF.mjs.map +0 -1
  191. package/dist/pl-ZEUBJ7YU.mjs +0 -376
  192. package/dist/pl-ZEUBJ7YU.mjs.map +0 -1
  193. package/dist/pt-WLAFIZWQ.mjs +0 -376
  194. package/dist/pt-WLAFIZWQ.mjs.map +0 -1
  195. package/dist/ro-K56IXFGU.mjs +0 -376
  196. package/dist/ro-K56IXFGU.mjs.map +0 -1
  197. package/dist/sv-VFJLMJRY.mjs +0 -376
  198. package/dist/sv-VFJLMJRY.mjs.map +0 -1
  199. package/dist/th-RICLQ2GW.mjs +0 -376
  200. package/dist/th-RICLQ2GW.mjs.map +0 -1
  201. package/dist/tr-SALXWE2M.mjs +0 -376
  202. package/dist/tr-SALXWE2M.mjs.map +0 -1
  203. package/dist/uk-3U3T3O2E.mjs +0 -376
  204. package/dist/uk-3U3T3O2E.mjs.map +0 -1
  205. package/dist/vi-LIVNZXOB.mjs +0 -376
  206. package/dist/vi-LIVNZXOB.mjs.map +0 -1
  207. package/dist/zh-KDUAZPX3.mjs +0 -376
  208. package/dist/zh-KDUAZPX3.mjs.map +0 -1
  209. /package/dist/{chunk-3FIQXKQF.mjs.map → chunk-Q2KV6Y2J.mjs.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  /**
2
- * Regression test: pendingAnnotation cleared after annotate:createsucceeds
2
+ * Regression test: pendingAnnotation cleared after mark:createsucceeds
3
3
  *
4
- * Bug: handleAnnotationCreate in useAnnotationFlow called the API and emitted
5
- * annotate:created, but never called setPendingAnnotation(null). The pending
4
+ * Bug: handleAnnotationCreate in useMarkFlow called the API and emitted
5
+ * mark:created, but never called setPendingAnnotation(null). The pending
6
6
  * creation form (e.g. "Create Reference", "Save" assessment) remained visible
7
7
  * after the user clicked the confirm button.
8
8
  *
9
9
  * Fix: setPendingAnnotation(null) added in handleAnnotationCreate on success,
10
- * before emitting annotate:created.
10
+ * before emitting mark:created.
11
11
  *
12
12
  * This test covers all four motivations that have a pending form:
13
13
  * - linking (ReferencesPanel: "Create Reference" button)
@@ -20,7 +20,7 @@ import React from 'react';
20
20
  import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
21
21
  import { render, screen, waitFor } from '@testing-library/react';
22
22
  import { act } from 'react';
23
- import { useAnnotationFlow } from '../../../hooks/useAnnotationFlow';
23
+ import { useMarkFlow } from '../../../hooks/useMarkFlow';
24
24
  import { EventBusProvider, useEventBus, resetEventBusForTesting } from '../../../contexts/EventBusContext';
25
25
  import { ApiClientProvider } from '../../../contexts/ApiClientContext';
26
26
  import { AuthTokenProvider } from '../../../contexts/AuthTokenContext';
@@ -71,7 +71,7 @@ function renderDetectionFlow(testUri: string) {
71
71
  }
72
72
 
73
73
  function DetectionFlowHarness() {
74
- const { pendingAnnotation } = useAnnotationFlow(testUri as any);
74
+ const { pendingAnnotation } = useMarkFlow(testUri as any);
75
75
  return (
76
76
  <div>
77
77
  <div data-testid="pending-motivation">
@@ -122,16 +122,16 @@ describe('Annotation creation clears pendingAnnotation', () => {
122
122
 
123
123
  // Set a pending annotation
124
124
  act(() => {
125
- emit('annotate:requested', { selector: TEXT_SELECTOR, motivation: 'linking' });
125
+ emit('mark:requested', { selector: TEXT_SELECTOR, motivation: 'linking' });
126
126
  });
127
127
 
128
128
  await waitFor(() => {
129
129
  expect(screen.getByTestId('pending-motivation')).toHaveTextContent('linking');
130
130
  });
131
131
 
132
- // Emit annotate:create(what ReferencesPanel does when user clicks "Create Reference")
132
+ // Emit mark:create(what ReferencesPanel does when user clicks "Create Reference")
133
133
  await act(async () => {
134
- emit('annotate:create', {
134
+ emit('mark:create', {
135
135
  motivation: 'linking',
136
136
  selector: TEXT_SELECTOR,
137
137
  body: [{ type: 'TextualBody', value: 'Person', purpose: 'tagging' }],
@@ -150,7 +150,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
150
150
  const { emit } = renderDetectionFlow(TEST_URI);
151
151
 
152
152
  act(() => {
153
- emit('annotate:requested', { selector: SVG_SELECTOR, motivation: 'assessing' });
153
+ emit('mark:requested', { selector: SVG_SELECTOR, motivation: 'assessing' });
154
154
  });
155
155
 
156
156
  await waitFor(() => {
@@ -158,7 +158,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
158
158
  });
159
159
 
160
160
  await act(async () => {
161
- emit('annotate:create', {
161
+ emit('mark:create', {
162
162
  motivation: 'assessing',
163
163
  selector: SVG_SELECTOR,
164
164
  body: [{ type: 'TextualBody', value: 'Looks good', purpose: 'assessing' }],
@@ -174,7 +174,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
174
174
  const { emit } = renderDetectionFlow(TEST_URI);
175
175
 
176
176
  act(() => {
177
- emit('annotate:requested', { selector: SVG_SELECTOR, motivation: 'assessing' });
177
+ emit('mark:requested', { selector: SVG_SELECTOR, motivation: 'assessing' });
178
178
  });
179
179
 
180
180
  await waitFor(() => {
@@ -183,7 +183,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
183
183
 
184
184
  // Empty body is valid for assessments
185
185
  await act(async () => {
186
- emit('annotate:create', {
186
+ emit('mark:create', {
187
187
  motivation: 'assessing',
188
188
  selector: SVG_SELECTOR,
189
189
  body: [],
@@ -199,7 +199,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
199
199
  const { emit } = renderDetectionFlow(TEST_URI);
200
200
 
201
201
  act(() => {
202
- emit('annotate:requested', { selector: TEXT_SELECTOR, motivation: 'commenting' });
202
+ emit('mark:requested', { selector: TEXT_SELECTOR, motivation: 'commenting' });
203
203
  });
204
204
 
205
205
  await waitFor(() => {
@@ -207,7 +207,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
207
207
  });
208
208
 
209
209
  await act(async () => {
210
- emit('annotate:create', {
210
+ emit('mark:create', {
211
211
  motivation: 'commenting',
212
212
  selector: TEXT_SELECTOR,
213
213
  body: [{ type: 'TextualBody', value: 'Great point', purpose: 'commenting' }],
@@ -223,7 +223,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
223
223
  const { emit } = renderDetectionFlow(TEST_URI);
224
224
 
225
225
  act(() => {
226
- emit('annotate:requested', { selector: SVG_SELECTOR, motivation: 'tagging' });
226
+ emit('mark:requested', { selector: SVG_SELECTOR, motivation: 'tagging' });
227
227
  });
228
228
 
229
229
  await waitFor(() => {
@@ -231,7 +231,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
231
231
  });
232
232
 
233
233
  await act(async () => {
234
- emit('annotate:create', {
234
+ emit('mark:create', {
235
235
  motivation: 'tagging',
236
236
  selector: SVG_SELECTOR,
237
237
  body: [{ type: 'TextualBody', value: 'concept:trust', purpose: 'tagging' }],
@@ -243,20 +243,20 @@ describe('Annotation creation clears pendingAnnotation', () => {
243
243
  });
244
244
  });
245
245
 
246
- it('emits annotate:created after successful creation', async () => {
246
+ it('emits mark:created after successful creation', async () => {
247
247
  const { emit, getEventBus } = renderDetectionFlow(TEST_URI);
248
248
 
249
249
  const createdListener = vi.fn();
250
250
  // Set listener after first render so eventBus is captured
251
251
  await waitFor(() => expect(getEventBus()).toBeDefined());
252
- const subscription = getEventBus().get('annotate:created').subscribe(createdListener);
252
+ const subscription = getEventBus().get('mark:created').subscribe(createdListener);
253
253
 
254
254
  act(() => {
255
- emit('annotate:requested', { selector: TEXT_SELECTOR, motivation: 'linking' });
255
+ emit('mark:requested', { selector: TEXT_SELECTOR, motivation: 'linking' });
256
256
  });
257
257
 
258
258
  await act(async () => {
259
- emit('annotate:create', {
259
+ emit('mark:create', {
260
260
  motivation: 'linking',
261
261
  selector: TEXT_SELECTOR,
262
262
  body: [],
@@ -277,7 +277,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
277
277
  const { emit } = renderDetectionFlow(TEST_URI);
278
278
 
279
279
  act(() => {
280
- emit('annotate:requested', { selector: TEXT_SELECTOR, motivation: 'linking' });
280
+ emit('mark:requested', { selector: TEXT_SELECTOR, motivation: 'linking' });
281
281
  });
282
282
 
283
283
  await waitFor(() => {
@@ -285,7 +285,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
285
285
  });
286
286
 
287
287
  await act(async () => {
288
- emit('annotate:create', {
288
+ emit('mark:create', {
289
289
  motivation: 'linking',
290
290
  selector: TEXT_SELECTOR,
291
291
  body: [],
@@ -299,11 +299,11 @@ describe('Annotation creation clears pendingAnnotation', () => {
299
299
  });
300
300
  });
301
301
 
302
- it('clears pendingAnnotation on cancel (annotate:cancel-pending)', async () => {
302
+ it('clears pendingAnnotation on cancel (mark:cancel-pending)', async () => {
303
303
  const { emit } = renderDetectionFlow(TEST_URI);
304
304
 
305
305
  act(() => {
306
- emit('annotate:requested', { selector: TEXT_SELECTOR, motivation: 'assessing' });
306
+ emit('mark:requested', { selector: TEXT_SELECTOR, motivation: 'assessing' });
307
307
  });
308
308
 
309
309
  await waitFor(() => {
@@ -311,7 +311,7 @@ describe('Annotation creation clears pendingAnnotation', () => {
311
311
  });
312
312
 
313
313
  act(() => {
314
- emit('annotate:cancel-pending', undefined);
314
+ emit('mark:cancel-pending', undefined);
315
315
  });
316
316
 
317
317
  await waitFor(() => {
@@ -4,7 +4,7 @@
4
4
  * Tests the COMPLETE annotation deletion flow with real component composition:
5
5
  * - EventBusProvider (REAL)
6
6
  * - ApiClientProvider (REAL, with MOCKED client)
7
- * - useAnnotationFlow (REAL) — single registration point for useResolutionFlow
7
+ * - useMarkFlow (REAL) — single registration point for useBindFlow
8
8
  * - useEventSubscriptions (REAL)
9
9
  *
10
10
  * This test focuses on ARCHITECTURE and EVENT WIRING:
@@ -15,18 +15,18 @@
15
15
  *
16
16
  * CRITICAL: This test prevents regressions where:
17
17
  * - Multiple deletion paths exist (event-driven vs direct)
18
- * - useResolutionFlow called in more than one hook (causes duplicate subscriptions)
18
+ * - useBindFlow called in more than one hook (causes duplicate subscriptions)
19
19
  * - Auth token missing from API calls (401 errors)
20
20
  *
21
- * ARCHITECTURE: useResolutionFlow is called ONLY in useAnnotationFlow.
22
- * useAnnotationFlow handles all detection state (manual annotation selection
23
- * and AI-driven SSE detection) plus all API operations via useResolutionFlow.
21
+ * ARCHITECTURE: useBindFlow is called ONLY in useMarkFlow.
22
+ * useMarkFlow handles all detection state (manual annotation selection
23
+ * and AI-driven SSE detection) plus all API operations via useBindFlow.
24
24
  */
25
25
 
26
26
  import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
27
27
  import { render, waitFor } from '@testing-library/react';
28
28
  import { act } from 'react';
29
- import { useAnnotationFlow } from '../../../hooks/useAnnotationFlow';
29
+ import { useMarkFlow } from '../../../hooks/useMarkFlow';
30
30
  import { EventBusProvider, useEventBus, resetEventBusForTesting } from '../../../contexts/EventBusContext';
31
31
 
32
32
  // Mock Toast module to prevent "useToast must be used within a ToastProvider" errors
@@ -70,9 +70,9 @@ describe('Annotation Deletion - Feature Integration', () => {
70
70
 
71
71
  function TestComponent() {
72
72
  eventBusInstance = useEventBus();
73
- // useAnnotationFlow is the single registration point for useResolutionFlow
74
- // (handles annotate:delete annotate:create annotate:detect-request, etc.)
75
- useAnnotationFlow(testUri);
73
+ // useMarkFlow is the single registration point for useBindFlow
74
+ // (handles mark:delete mark:create annotate:detect-request, etc.)
75
+ useMarkFlow(testUri);
76
76
  return null;
77
77
  }
78
78
 
@@ -89,14 +89,14 @@ describe('Annotation Deletion - Feature Integration', () => {
89
89
  return {
90
90
  emitDelete: (annotationId: string) => {
91
91
  act(() => {
92
- eventBusInstance!.get('annotate:delete').next({ annotationId });
92
+ eventBusInstance!.get('mark:delete').next({ annotationId });
93
93
  });
94
94
  },
95
95
  eventBus: eventBusInstance!,
96
96
  };
97
97
  }
98
98
 
99
- it('should call deleteAnnotation API exactly ONCE when annotate:deleteevent is emitted', async () => {
99
+ it('should call deleteAnnotation API exactly ONCE when mark:deleteevent is emitted', async () => {
100
100
  const { emitDelete } = renderAnnotationFlow();
101
101
  const annotationId = 'annotation-123';
102
102
 
@@ -133,12 +133,12 @@ describe('Annotation Deletion - Feature Integration', () => {
133
133
  expect(callArgs[1].auth).toBe(accessToken(testToken));
134
134
  });
135
135
 
136
- it('should emit annotate:deleted event on successful deletion', async () => {
136
+ it('should emit mark:deleted event on successful deletion', async () => {
137
137
  const { emitDelete, eventBus } = renderAnnotationFlow();
138
138
  const deletedListener = vi.fn();
139
139
 
140
140
  // Subscribe to success event
141
- eventBus.get('annotate:deleted').subscribe(deletedListener);
141
+ eventBus.get('mark:deleted').subscribe(deletedListener);
142
142
 
143
143
  emitDelete('annotation-789');
144
144
 
@@ -155,7 +155,7 @@ describe('Annotation Deletion - Feature Integration', () => {
155
155
  });
156
156
  });
157
157
 
158
- it('should emit annotate:delete-failed event on API error', async () => {
158
+ it('should emit mark:delete-failed event on API error', async () => {
159
159
  // Make API call fail
160
160
  deleteAnnotationSpy.mockRejectedValue(new Error('Network error'));
161
161
 
@@ -163,7 +163,7 @@ describe('Annotation Deletion - Feature Integration', () => {
163
163
  const failedListener = vi.fn();
164
164
 
165
165
  // Subscribe to failure event
166
- eventBus.get('annotate:delete-failed').subscribe(failedListener);
166
+ eventBus.get('mark:delete-failed').subscribe(failedListener);
167
167
 
168
168
  emitDelete('annotation-error');
169
169
 
@@ -202,13 +202,13 @@ describe('Annotation Deletion - Feature Integration', () => {
202
202
  expect(deleteAnnotationSpy.mock.calls[1][0]).toContain('annotation-2');
203
203
  });
204
204
 
205
- it('ARCHITECTURE: useResolutionFlow is called in useAnnotationFlow (single registration point)', async () => {
205
+ it('ARCHITECTURE: useBindFlow is called in useMarkFlow (single registration point)', async () => {
206
206
  /**
207
207
  * This test validates that there's only ONE event-driven deletion path:
208
- * - useAnnotationFlow calls useResolutionFlow (the single registration point)
209
- * - useResolutionFlow subscribes to annotation:delete
208
+ * - useMarkFlow calls useBindFlow (the single registration point)
209
+ * - useBindFlow subscribes to annotation:delete
210
210
  *
211
- * If this test fails with 2 API calls, it means useResolutionFlow was added
211
+ * If this test fails with 2 API calls, it means useBindFlow was added
212
212
  * to a second hook, causing duplicate subscriptions (ARCHITECTURE VIOLATION).
213
213
  */
214
214
 
@@ -229,8 +229,8 @@ describe('Annotation Deletion - Feature Integration', () => {
229
229
  * that bypassed the event bus.
230
230
  *
231
231
  * The correct pattern is event-driven only:
232
- * - UI emits annotate:deleteevent
233
- * - useResolutionFlow handles it
232
+ * - UI emits mark:deleteevent
233
+ * - useBindFlow handles it
234
234
  * - No direct function calls
235
235
  */
236
236
 
@@ -8,20 +8,20 @@
8
8
  * 4. BUG: Progress modal stays visible showing "Processing: Location" indefinitely
9
9
  *
10
10
  * ROOT CAUSE:
11
- * - useAnnotationFlow.ts (line 54-62): annotate:assist-finished clears `assistingMotivation` but keeps `progress`
11
+ * - useMarkFlow.ts (line 54-62): mark:assist-finished clears `assistingMotivation` but keeps `progress`
12
12
  * - AssistSection.tsx (line 214): Shows progress UI whenever `progress` is not null
13
13
  * - No mechanism to auto-dismiss or manually close the progress display
14
14
  *
15
15
  * FIX OPTIONS:
16
16
  * A) Auto-dismiss after timeout (3s after completion)
17
17
  * B) Add "Close" button to progress display
18
- * C) Clear progress on next annotate:assist-request (already works but not ideal UX)
18
+ * C) Clear progress on next mark:assist-request (already works but not ideal UX)
19
19
  */
20
20
 
21
21
  import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
22
22
  import { render, screen, waitFor } from '@testing-library/react';
23
23
  import { act } from 'react';
24
- import { useAnnotationFlow } from '../../../hooks/useAnnotationFlow';
24
+ import { useMarkFlow } from '../../../hooks/useMarkFlow';
25
25
  import { EventBusProvider, resetEventBusForTesting, useEventBus } from '../../../contexts/EventBusContext';
26
26
  import { ApiClientProvider } from '../../../contexts/ApiClientContext';
27
27
  import { AuthTokenProvider } from '../../../contexts/AuthTokenContext';
@@ -65,7 +65,7 @@ describe('Detection Progress Dismissal Bug', () => {
65
65
 
66
66
  function TestHarness() {
67
67
  eventBusInstance = useEventBus();
68
- const { assistingMotivation, progress } = useAnnotationFlow(rUri);
68
+ const { assistingMotivation, progress } = useMarkFlow(rUri);
69
69
 
70
70
  return (
71
71
  <div>
@@ -91,9 +91,9 @@ describe('Detection Progress Dismissal Bug', () => {
91
91
  expect(screen.getByTestId('detecting')).toHaveTextContent('none');
92
92
  expect(screen.getByTestId('progress')).toHaveTextContent('no progress');
93
93
 
94
- // User clicks detect button (emits annotate:assist-request)
94
+ // User clicks detect button (emits mark:assist-request)
95
95
  act(() => {
96
- eventBusInstance.get('annotate:assist-request').next({
96
+ eventBusInstance.get('mark:assist-request').next({
97
97
  motivation: 'linking',
98
98
  options: { entityTypes: ['Location'] }
99
99
  });
@@ -106,7 +106,7 @@ describe('Detection Progress Dismissal Bug', () => {
106
106
 
107
107
  // SSE sends progress update
108
108
  act(() => {
109
- eventBusInstance.get('annotate:progress').next({
109
+ eventBusInstance.get('mark:progress').next({
110
110
  status: 'scanning',
111
111
  message: 'Processing: Location',
112
112
  currentEntityType: 'Location',
@@ -118,9 +118,9 @@ describe('Detection Progress Dismissal Bug', () => {
118
118
  expect(screen.getByTestId('progress')).toHaveTextContent('Processing: Location');
119
119
  });
120
120
 
121
- // Detection completes (SSE finishes, backend emits annotate:assist-finished)
121
+ // Detection completes (SSE finishes, backend emits mark:assist-finished)
122
122
  act(() => {
123
- eventBusInstance.get('annotate:assist-finished').next({ motivation: 'linking' });
123
+ eventBusInstance.get('mark:assist-finished').next({ motivation: 'linking' });
124
124
  });
125
125
 
126
126
  // assistingMotivation cleared immediately
@@ -138,7 +138,7 @@ describe('Detection Progress Dismissal Bug', () => {
138
138
 
139
139
  function TestHarness() {
140
140
  eventBusInstance = useEventBus();
141
- const { progress } = useAnnotationFlow(rUri);
141
+ const { progress } = useMarkFlow(rUri);
142
142
 
143
143
  return (
144
144
  <div data-testid="progress">
@@ -159,15 +159,15 @@ describe('Detection Progress Dismissal Bug', () => {
159
159
 
160
160
  // First detection with stuck progress
161
161
  act(() => {
162
- eventBusInstance.get('annotate:assist-request').next({ motivation: 'linking', options: {} });
162
+ eventBusInstance.get('mark:assist-request').next({ motivation: 'linking', options: {} });
163
163
  });
164
164
 
165
165
  act(() => {
166
- eventBusInstance.get('annotate:progress').next({ message: 'Old progress stuck here' });
166
+ eventBusInstance.get('mark:progress').next({ message: 'Old progress stuck here' });
167
167
  });
168
168
 
169
169
  act(() => {
170
- eventBusInstance.get('annotate:assist-finished').next({ motivation: 'linking' });
170
+ eventBusInstance.get('mark:assist-finished').next({ motivation: 'linking' });
171
171
  });
172
172
 
173
173
  await waitFor(() => {
@@ -176,7 +176,7 @@ describe('Detection Progress Dismissal Bug', () => {
176
176
 
177
177
  // WORKAROUND: Start new detection clears old progress
178
178
  act(() => {
179
- eventBusInstance.get('annotate:assist-request').next({ motivation: 'highlighting', options: {} });
179
+ eventBusInstance.get('mark:assist-request').next({ motivation: 'highlighting', options: {} });
180
180
  });
181
181
 
182
182
  await waitFor(() => {
@@ -191,7 +191,7 @@ describe('Detection Progress Dismissal Bug', () => {
191
191
 
192
192
  function TestHarness() {
193
193
  eventBusInstance = useEventBus();
194
- const { progress } = useAnnotationFlow(rUri);
194
+ const { progress } = useMarkFlow(rUri);
195
195
 
196
196
  return (
197
197
  <div data-testid="progress">
@@ -212,18 +212,18 @@ describe('Detection Progress Dismissal Bug', () => {
212
212
 
213
213
  // Show progress
214
214
  act(() => {
215
- eventBusInstance.get('annotate:assist-request').next({ motivation: 'linking', options: {} });
215
+ eventBusInstance.get('mark:assist-request').next({ motivation: 'linking', options: {} });
216
216
  });
217
217
 
218
218
  act(() => {
219
- eventBusInstance.get('annotate:progress').next({
219
+ eventBusInstance.get('mark:progress').next({
220
220
  status: 'complete',
221
221
  message: 'Complete! Created 5 annotations'
222
222
  });
223
223
  });
224
224
 
225
225
  act(() => {
226
- eventBusInstance.get('annotate:assist-finished').next({ motivation: 'linking' });
226
+ eventBusInstance.get('mark:assist-finished').next({ motivation: 'linking' });
227
227
  });
228
228
 
229
229
  // Progress visible initially
@@ -242,7 +242,7 @@ describe('Detection Progress Dismissal Bug', () => {
242
242
  it('FIXED: SSE emits final completion chunk data as annotate:assist-progress', async () => {
243
243
  /**
244
244
  * This test verifies that SSE emits the final chunk as annotate:assist-progress
245
- * BEFORE emitting annotate:assist-finished.
245
+ * BEFORE emitting mark:assist-finished.
246
246
  *
247
247
  * This ensures the UI can display the final completion message with status:'complete'.
248
248
  */
@@ -251,7 +251,7 @@ describe('Detection Progress Dismissal Bug', () => {
251
251
 
252
252
  function TestHarness() {
253
253
  eventBusInstance = useEventBus();
254
- const { progress } = useAnnotationFlow(rUri);
254
+ const { progress } = useMarkFlow(rUri);
255
255
 
256
256
  return (
257
257
  <div>
@@ -273,7 +273,7 @@ describe('Detection Progress Dismissal Bug', () => {
273
273
 
274
274
  // Start detection (triggers SSE stream creation)
275
275
  act(() => {
276
- eventBusInstance.get('annotate:assist-request').next({
276
+ eventBusInstance.get('mark:assist-request').next({
277
277
  motivation: 'linking',
278
278
  options: { entityTypes: ['Location'] }
279
279
  });
@@ -281,7 +281,7 @@ describe('Detection Progress Dismissal Bug', () => {
281
281
 
282
282
  // Simulate SSE scanning chunk
283
283
  act(() => {
284
- eventBusInstance.get('annotate:progress').next({
284
+ eventBusInstance.get('mark:progress').next({
285
285
  status: 'scanning',
286
286
  message: 'Processing: Location',
287
287
  });
@@ -293,7 +293,7 @@ describe('Detection Progress Dismissal Bug', () => {
293
293
 
294
294
  // Simulate SSE emitting final chunk as annotate:assist-progress
295
295
  act(() => {
296
- eventBusInstance.get('annotate:progress').next({
296
+ eventBusInstance.get('mark:progress').next({
297
297
  status: 'complete',
298
298
  message: 'Complete! Found 5 entities',
299
299
  foundCount: 5,