@semiont/react-ui 0.2.34-build.91 → 0.2.34-build.93

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 (195) hide show
  1. package/dist/{EventBusContext-BmzEcGHZ.d.mts → EventBusContext-DMI4uwYk.d.mts} +2 -2
  2. package/dist/{PdfAnnotationCanvas.client-VLNA5O5M.mjs → PdfAnnotationCanvas.client-HNYRKFDS.mjs} +10 -9
  3. package/dist/PdfAnnotationCanvas.client-HNYRKFDS.mjs.map +1 -0
  4. package/dist/{ar-4ZEORRW2.mjs → ar-MDB7HC5S.mjs} +45 -49
  5. package/dist/ar-MDB7HC5S.mjs.map +1 -0
  6. package/dist/{bn-SEDE5BQJ.mjs → bn-3SAV2ZEM.mjs} +45 -49
  7. package/dist/bn-3SAV2ZEM.mjs.map +1 -0
  8. package/dist/{chunk-C63BARI7.mjs → chunk-3FIQXKQF.mjs} +31 -31
  9. package/dist/{chunk-D7NBW4RV.mjs → chunk-JH7BXE2P.mjs} +45 -49
  10. package/dist/chunk-JH7BXE2P.mjs.map +1 -0
  11. package/dist/{chunk-M7SZRRIE.mjs → chunk-MWQ5CNKW.mjs} +13 -13
  12. package/dist/chunk-MWQ5CNKW.mjs.map +1 -0
  13. package/dist/{chunk-ULIET3MW.mjs → chunk-YI5IX5ZA.mjs} +1 -1
  14. package/dist/{chunk-ULIET3MW.mjs.map → chunk-YI5IX5ZA.mjs.map} +1 -1
  15. package/dist/{cs-7W4WF5WD.mjs → cs-AWCETEUV.mjs} +45 -49
  16. package/dist/cs-AWCETEUV.mjs.map +1 -0
  17. package/dist/{da-75XGBCBK.mjs → da-UZZHXYLC.mjs} +45 -49
  18. package/dist/da-UZZHXYLC.mjs.map +1 -0
  19. package/dist/{de-ODJVFLHM.mjs → de-LQFWN6S5.mjs} +45 -49
  20. package/dist/de-LQFWN6S5.mjs.map +1 -0
  21. package/dist/{el-C4PM4WB3.mjs → el-IWOETBJ7.mjs} +45 -49
  22. package/dist/el-IWOETBJ7.mjs.map +1 -0
  23. package/dist/{en-KJCJQ4OO.mjs → en-XWEPVTB4.mjs} +2 -6
  24. package/dist/{es-WD33R7QL.mjs → es-726NTS53.mjs} +45 -49
  25. package/dist/es-726NTS53.mjs.map +1 -0
  26. package/dist/{fa-2BP6V56P.mjs → fa-BVEJZT5S.mjs} +45 -49
  27. package/dist/fa-BVEJZT5S.mjs.map +1 -0
  28. package/dist/{fi-USRRW24J.mjs → fi-JBNCGGA6.mjs} +45 -49
  29. package/dist/fi-JBNCGGA6.mjs.map +1 -0
  30. package/dist/{fr-EC5S6WVF.mjs → fr-OLH7PNGI.mjs} +45 -49
  31. package/dist/fr-OLH7PNGI.mjs.map +1 -0
  32. package/dist/{he-7TBVIKAA.mjs → he-KOJQ4HMA.mjs} +45 -49
  33. package/dist/he-KOJQ4HMA.mjs.map +1 -0
  34. package/dist/{hi-FO4VIZLA.mjs → hi-BKJFZXAY.mjs} +45 -49
  35. package/dist/hi-BKJFZXAY.mjs.map +1 -0
  36. package/dist/{id-7U7GGVWY.mjs → id-DPLHJVNP.mjs} +45 -49
  37. package/dist/id-DPLHJVNP.mjs.map +1 -0
  38. package/dist/index.css +80 -80
  39. package/dist/index.css.map +1 -1
  40. package/dist/index.d.mts +215 -201
  41. package/dist/index.mjs +812 -752
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/{it-Y4OPL6I2.mjs → it-JXHAM7NL.mjs} +45 -49
  44. package/dist/it-JXHAM7NL.mjs.map +1 -0
  45. package/dist/{ja-PK7SQL55.mjs → ja-DQRAO3PU.mjs} +45 -49
  46. package/dist/ja-DQRAO3PU.mjs.map +1 -0
  47. package/dist/{ko-L25PXMYD.mjs → ko-6IFCOP6F.mjs} +45 -49
  48. package/dist/ko-6IFCOP6F.mjs.map +1 -0
  49. package/dist/{ms-STH777QM.mjs → ms-KF5S2TLL.mjs} +45 -49
  50. package/dist/ms-KF5S2TLL.mjs.map +1 -0
  51. package/dist/{nl-Y7LECDDR.mjs → nl-2GUUZLQM.mjs} +45 -49
  52. package/dist/nl-2GUUZLQM.mjs.map +1 -0
  53. package/dist/{no-KEKCEWU6.mjs → no-2IBCZGEF.mjs} +45 -49
  54. package/dist/no-2IBCZGEF.mjs.map +1 -0
  55. package/dist/{pl-7A7OC75O.mjs → pl-ZEUBJ7YU.mjs} +45 -49
  56. package/dist/pl-ZEUBJ7YU.mjs.map +1 -0
  57. package/dist/{pt-35HTM7RA.mjs → pt-WLAFIZWQ.mjs} +45 -49
  58. package/dist/pt-WLAFIZWQ.mjs.map +1 -0
  59. package/dist/{ro-VAWL5KQA.mjs → ro-K56IXFGU.mjs} +45 -49
  60. package/dist/ro-K56IXFGU.mjs.map +1 -0
  61. package/dist/{sv-7ZK5EQEB.mjs → sv-VFJLMJRY.mjs} +45 -49
  62. package/dist/sv-VFJLMJRY.mjs.map +1 -0
  63. package/dist/test-utils.d.mts +2 -2
  64. package/dist/test-utils.mjs +3 -3
  65. package/dist/{th-UDWZ4X34.mjs → th-RICLQ2GW.mjs} +45 -49
  66. package/dist/th-RICLQ2GW.mjs.map +1 -0
  67. package/dist/{tr-4WMPK3UX.mjs → tr-SALXWE2M.mjs} +45 -49
  68. package/dist/tr-SALXWE2M.mjs.map +1 -0
  69. package/dist/{uk-SSLASQYJ.mjs → uk-3U3T3O2E.mjs} +45 -49
  70. package/dist/uk-3U3T3O2E.mjs.map +1 -0
  71. package/dist/{vi-IF42Z5PU.mjs → vi-LIVNZXOB.mjs} +45 -49
  72. package/dist/vi-LIVNZXOB.mjs.map +1 -0
  73. package/dist/{zh-HRQTNTAI.mjs → zh-KDUAZPX3.mjs} +45 -49
  74. package/dist/zh-KDUAZPX3.mjs.map +1 -0
  75. package/package.json +1 -1
  76. package/src/components/AnnotateReferencesProgressWidget.tsx +113 -0
  77. package/src/components/CodeMirrorRenderer.tsx +9 -27
  78. package/src/components/Toolbar.tsx +2 -2
  79. package/src/components/annotation/AnnotateToolbar.tsx +9 -9
  80. package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +17 -17
  81. package/src/components/image-annotation/AnnotationOverlay.tsx +13 -11
  82. package/src/components/image-annotation/SvgDrawingCanvas.tsx +8 -4
  83. package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +11 -9
  84. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +1 -1
  85. package/src/components/resource/AnnotateView.tsx +17 -12
  86. package/src/components/resource/BrowseView.tsx +19 -50
  87. package/src/components/resource/ResourceViewer.tsx +28 -24
  88. package/src/components/resource/__tests__/BrowseView.test.tsx +27 -27
  89. package/src/components/resource/panels/AssessmentEntry.tsx +1 -1
  90. package/src/components/resource/panels/AssessmentPanel.tsx +16 -16
  91. package/src/components/resource/panels/{DetectSection.css → AssistSection.css} +79 -79
  92. package/src/components/resource/panels/{DetectSection.tsx → AssistSection.tsx} +46 -46
  93. package/src/components/resource/panels/CommentEntry.tsx +1 -1
  94. package/src/components/resource/panels/CommentsPanel.tsx +16 -16
  95. package/src/components/resource/panels/HighlightEntry.tsx +1 -1
  96. package/src/components/resource/panels/HighlightPanel.tsx +14 -14
  97. package/src/components/resource/panels/ReferenceEntry.tsx +5 -5
  98. package/src/components/resource/panels/ReferencesPanel.tsx +90 -103
  99. package/src/components/resource/panels/ResourceInfoPanel.tsx +2 -2
  100. package/src/components/resource/panels/TagEntry.tsx +1 -1
  101. package/src/components/resource/panels/TaggingPanel.tsx +53 -53
  102. package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +12 -20
  103. package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +12 -12
  104. package/src/components/resource/panels/__tests__/{DetectSection.test.tsx → AssistSection.test.tsx} +109 -108
  105. package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +8 -8
  106. package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +3 -3
  107. package/src/components/resource/panels/__tests__/{HighlightPanel.detectionProgress.test.tsx → HighlightPanel.annotationProgress.test.tsx} +56 -56
  108. package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +98 -95
  109. package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +3 -3
  110. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +16 -16
  111. package/src/components/settings/SettingsPanel.tsx +29 -1
  112. package/src/features/resource-compose/components/ResourceComposePage.tsx +3 -0
  113. package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +36 -26
  114. package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +26 -16
  115. package/src/features/resource-viewer/__tests__/{DetectionProgressDismissal.test.tsx → AnnotationProgressDismissal.test.tsx} +48 -38
  116. package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +59 -49
  117. package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +55 -33
  118. package/src/features/resource-viewer/__tests__/GenerationFlowIntegration.test.tsx +24 -16
  119. package/src/features/resource-viewer/__tests__/ResolutionFlowIntegration.test.tsx +41 -31
  120. package/src/features/resource-viewer/__tests__/ResourceMutations.test.tsx +10 -10
  121. package/src/features/resource-viewer/__tests__/ToastNotifications.test.tsx +196 -0
  122. package/src/features/resource-viewer/__tests__/{detection-progress-flow.test.tsx → annotation-progress-flow.test.tsx} +51 -28
  123. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +56 -45
  124. package/src/styles/core/buttons.css +3 -3
  125. package/src/styles/core/forms.css +2 -2
  126. package/src/styles/index.css +1 -1
  127. package/src/styles/motivations/motivation-assessment.css +9 -9
  128. package/src/styles/motivations/motivation-comment.css +9 -9
  129. package/src/styles/motivations/motivation-highlight.css +9 -9
  130. package/src/styles/motivations/motivation-reference.css +9 -9
  131. package/src/styles/motivations/motivation-tag.css +9 -9
  132. package/src/styles/utilities/focus-extended.css +6 -6
  133. package/translations/ar.json +44 -44
  134. package/translations/bn.json +44 -44
  135. package/translations/cs.json +44 -44
  136. package/translations/da.json +44 -44
  137. package/translations/de.json +44 -44
  138. package/translations/el.json +44 -44
  139. package/translations/en.json +44 -44
  140. package/translations/es.json +44 -44
  141. package/translations/fa.json +44 -44
  142. package/translations/fi.json +44 -44
  143. package/translations/fr.json +44 -44
  144. package/translations/he.json +44 -44
  145. package/translations/hi.json +44 -44
  146. package/translations/id.json +44 -44
  147. package/translations/it.json +44 -44
  148. package/translations/ja.json +44 -44
  149. package/translations/ko.json +44 -44
  150. package/translations/ms.json +44 -44
  151. package/translations/nl.json +44 -44
  152. package/translations/no.json +44 -44
  153. package/translations/pl.json +44 -44
  154. package/translations/pt.json +44 -44
  155. package/translations/ro.json +44 -44
  156. package/translations/sv.json +44 -44
  157. package/translations/th.json +44 -44
  158. package/translations/tr.json +44 -44
  159. package/translations/uk.json +44 -44
  160. package/translations/vi.json +44 -44
  161. package/translations/zh.json +44 -44
  162. package/dist/PdfAnnotationCanvas.client-VLNA5O5M.mjs.map +0 -1
  163. package/dist/ar-4ZEORRW2.mjs.map +0 -1
  164. package/dist/bn-SEDE5BQJ.mjs.map +0 -1
  165. package/dist/chunk-D7NBW4RV.mjs.map +0 -1
  166. package/dist/chunk-M7SZRRIE.mjs.map +0 -1
  167. package/dist/cs-7W4WF5WD.mjs.map +0 -1
  168. package/dist/da-75XGBCBK.mjs.map +0 -1
  169. package/dist/de-ODJVFLHM.mjs.map +0 -1
  170. package/dist/el-C4PM4WB3.mjs.map +0 -1
  171. package/dist/es-WD33R7QL.mjs.map +0 -1
  172. package/dist/fa-2BP6V56P.mjs.map +0 -1
  173. package/dist/fi-USRRW24J.mjs.map +0 -1
  174. package/dist/fr-EC5S6WVF.mjs.map +0 -1
  175. package/dist/he-7TBVIKAA.mjs.map +0 -1
  176. package/dist/hi-FO4VIZLA.mjs.map +0 -1
  177. package/dist/id-7U7GGVWY.mjs.map +0 -1
  178. package/dist/it-Y4OPL6I2.mjs.map +0 -1
  179. package/dist/ja-PK7SQL55.mjs.map +0 -1
  180. package/dist/ko-L25PXMYD.mjs.map +0 -1
  181. package/dist/ms-STH777QM.mjs.map +0 -1
  182. package/dist/nl-Y7LECDDR.mjs.map +0 -1
  183. package/dist/no-KEKCEWU6.mjs.map +0 -1
  184. package/dist/pl-7A7OC75O.mjs.map +0 -1
  185. package/dist/pt-35HTM7RA.mjs.map +0 -1
  186. package/dist/ro-VAWL5KQA.mjs.map +0 -1
  187. package/dist/sv-7ZK5EQEB.mjs.map +0 -1
  188. package/dist/th-UDWZ4X34.mjs.map +0 -1
  189. package/dist/tr-4WMPK3UX.mjs.map +0 -1
  190. package/dist/uk-SSLASQYJ.mjs.map +0 -1
  191. package/dist/vi-IF42Z5PU.mjs.map +0 -1
  192. package/dist/zh-HRQTNTAI.mjs.map +0 -1
  193. package/src/components/DetectionProgressWidget.tsx +0 -113
  194. /package/dist/{chunk-C63BARI7.mjs.map → chunk-3FIQXKQF.mjs.map} +0 -0
  195. /package/dist/{en-KJCJQ4OO.mjs.map → en-XWEPVTB4.mjs.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Layer 1 Unit Test: DetectSection Component
2
+ * Layer 1 Unit Test: AssistSection Component
3
3
  *
4
- * Tests the DetectSection component in isolation with mocked dependencies.
4
+ * Tests the AssistSection component in isolation with mocked dependencies.
5
5
  *
6
6
  * This test verifies:
7
- * - Detection progress rendering when detectionProgress prop is provided
7
+ * - Detection progress rendering when progress prop is provided
8
8
  * - Progress message display
9
9
  * - Request parameters display
10
10
  * - Form visibility toggling based on progress state
@@ -16,16 +16,16 @@ import React from 'react';
16
16
  import { screen } from '@testing-library/react';
17
17
  import { renderWithProviders } from '../../../../test-utils';
18
18
  import userEvent from '@testing-library/user-event';
19
- import { DetectSection } from '../DetectSection';
19
+ import { AssistSection } from '../AssistSection';
20
20
  import { resetEventBusForTesting } from '../../../../contexts/EventBusContext';
21
21
  import type { EventBus } from "@semiont/core"
22
22
 
23
23
  // Mock translations
24
24
  const mockT = vi.fn((key: string) => {
25
25
  const translations: Record<string, string> = {
26
- detectHighlights: 'Detect Highlights',
27
- detectAssessments: 'Detect Assessments',
28
- detectComments: 'Detect Comments',
26
+ annotateHighlights: 'Annotate Highlights',
27
+ annotateAssessments: 'Annotate Assessments',
28
+ annotateComments: 'Annotate Comments',
29
29
  instructions: 'Instructions',
30
30
  optional: '(optional)',
31
31
  instructionsPlaceholder: 'Enter custom instructions...',
@@ -42,7 +42,8 @@ const mockT = vi.fn((key: string) => {
42
42
  densityLabel: 'Density',
43
43
  densitySparse: 'Sparse',
44
44
  densityDense: 'Dense',
45
- detect: 'Detect',
45
+ annotate: 'Annotate',
46
+ annotating: 'Annotating...',
46
47
  };
47
48
  return translations[key] || key;
48
49
  });
@@ -52,7 +53,7 @@ vi.mock('../../../../contexts/TranslationContext', () => ({
52
53
  TranslationProvider: ({ children }: { children: React.ReactNode }) => children,
53
54
  }));
54
55
 
55
- describe('DetectSection', () => {
56
+ describe('AssistSection', () => {
56
57
  beforeEach(() => {
57
58
  vi.clearAllMocks();
58
59
  resetEventBusForTesting();
@@ -63,12 +64,12 @@ describe('DetectSection', () => {
63
64
  });
64
65
 
65
66
  describe('Progress Display', () => {
66
- it('should render progress message when detectionProgress prop provided', () => {
67
+ it('should render progress message when progress prop provided', () => {
67
68
  renderWithProviders(
68
- <DetectSection
69
+ <AssistSection
69
70
  annotationType="highlight"
70
- isDetecting={true}
71
- detectionProgress={{
71
+ isAssisting={true}
72
+ progress={{
72
73
  status: 'analyzing',
73
74
  percentage: 30,
74
75
  message: 'Analyzing text for highlights...',
@@ -81,10 +82,10 @@ describe('DetectSection', () => {
81
82
 
82
83
  it('should render progress message with sparkle icon', () => {
83
84
  renderWithProviders(
84
- <DetectSection
85
+ <AssistSection
85
86
  annotationType="highlight"
86
- isDetecting={true}
87
- detectionProgress={{
87
+ isAssisting={true}
88
+ progress={{
88
89
  status: 'analyzing',
89
90
  message: 'Processing...',
90
91
  }}
@@ -92,17 +93,17 @@ describe('DetectSection', () => {
92
93
  );
93
94
 
94
95
  // Check for icon and message
95
- const progressDiv = screen.getByText('Processing...').closest('.semiont-detection-progress__message');
96
+ const progressDiv = screen.getByText('Processing...').closest('.semiont-annotation-progress__message');
96
97
  expect(progressDiv).toBeInTheDocument();
97
- expect(progressDiv?.querySelector('.semiont-detection-progress__icon')).toBeInTheDocument();
98
+ expect(progressDiv?.querySelector('.semiont-annotation-progress__icon')).toBeInTheDocument();
98
99
  });
99
100
 
100
101
  it('should render request parameters when provided', () => {
101
102
  renderWithProviders(
102
- <DetectSection
103
+ <AssistSection
103
104
  annotationType="highlight"
104
- isDetecting={true}
105
- detectionProgress={{
105
+ isAssisting={true}
106
+ progress={{
106
107
  status: 'analyzing',
107
108
  message: 'Analyzing...',
108
109
  requestParams: [
@@ -120,12 +121,12 @@ describe('DetectSection', () => {
120
121
  expect(screen.getByText(/Density:/)).toBeInTheDocument();
121
122
  });
122
123
 
123
- it('should hide form when detectionProgress is present', () => {
124
+ it('should hide form when progress is present', () => {
124
125
  renderWithProviders(
125
- <DetectSection
126
+ <AssistSection
126
127
  annotationType="highlight"
127
- isDetecting={true}
128
- detectionProgress={{
128
+ isAssisting={true}
129
+ progress={{
129
130
  status: 'analyzing',
130
131
  message: 'Analyzing...',
131
132
  }}
@@ -134,43 +135,43 @@ describe('DetectSection', () => {
134
135
 
135
136
  // Form should not be visible
136
137
  expect(screen.queryByPlaceholderText('Enter custom instructions...')).not.toBeInTheDocument();
137
- expect(screen.queryByRole('button', { name: /✨ Detect/ })).not.toBeInTheDocument();
138
+ expect(screen.queryByRole('button', { name: /✨ Annotate/ })).not.toBeInTheDocument();
138
139
  });
139
140
 
140
- it('should show form when detectionProgress is null', () => {
141
+ it('should show form when progress is null', () => {
141
142
  renderWithProviders(
142
- <DetectSection
143
+ <AssistSection
143
144
  annotationType="highlight"
144
- isDetecting={false}
145
- detectionProgress={null}
145
+ isAssisting={false}
146
+ progress={null}
146
147
  />
147
148
  );
148
149
 
149
150
  // Form should be visible
150
151
  expect(screen.getByPlaceholderText('Enter custom instructions...')).toBeInTheDocument();
151
- expect(screen.getByRole('button', { name: /✨ Detect/ })).toBeInTheDocument();
152
+ expect(screen.getByRole('button', { name: /✨ Annotate/ })).toBeInTheDocument();
152
153
  });
153
154
 
154
- it('should show form when detectionProgress is undefined', () => {
155
+ it('should show form when progress is undefined', () => {
155
156
  renderWithProviders(
156
- <DetectSection
157
+ <AssistSection
157
158
  annotationType="highlight"
158
- isDetecting={false}
159
- detectionProgress={undefined}
159
+ isAssisting={false}
160
+ progress={undefined}
160
161
  />
161
162
  );
162
163
 
163
164
  // Form should be visible
164
165
  expect(screen.getByPlaceholderText('Enter custom instructions...')).toBeInTheDocument();
165
- expect(screen.getByRole('button', { name: /✨ Detect/ })).toBeInTheDocument();
166
+ expect(screen.getByRole('button', { name: /✨ Annotate/ })).toBeInTheDocument();
166
167
  });
167
168
 
168
- it('should keep progress visible after detection completes (isDetecting=false but progress exists)', () => {
169
+ it('should keep progress visible after detection completes (isAssisting=false but progress exists)', () => {
169
170
  renderWithProviders(
170
- <DetectSection
171
+ <AssistSection
171
172
  annotationType="highlight"
172
- isDetecting={false}
173
- detectionProgress={{
173
+ isAssisting={false}
174
+ progress={{
174
175
  status: 'complete',
175
176
  percentage: 100,
176
177
  message: 'Complete! Created 14 highlights',
@@ -188,46 +189,46 @@ describe('DetectSection', () => {
188
189
  describe('Annotation Type Variations', () => {
189
190
  it('should render for highlight type', () => {
190
191
  renderWithProviders(
191
- <DetectSection
192
+ <AssistSection
192
193
  annotationType="highlight"
193
- isDetecting={false}
194
- detectionProgress={null}
194
+ isAssisting={false}
195
+ progress={null}
195
196
  />
196
197
  );
197
198
 
198
- expect(screen.getByText('Detect Highlights')).toBeInTheDocument();
199
+ expect(screen.getByText('Annotate Highlights')).toBeInTheDocument();
199
200
  });
200
201
 
201
202
  it('should render for assessment type', () => {
202
203
  renderWithProviders(
203
- <DetectSection
204
+ <AssistSection
204
205
  annotationType="assessment"
205
- isDetecting={false}
206
- detectionProgress={null}
206
+ isAssisting={false}
207
+ progress={null}
207
208
  />
208
209
  );
209
210
 
210
- expect(screen.getByText('Detect Assessments')).toBeInTheDocument();
211
+ expect(screen.getByText('Annotate Assessments')).toBeInTheDocument();
211
212
  });
212
213
 
213
214
  it('should render for comment type', () => {
214
215
  renderWithProviders(
215
- <DetectSection
216
+ <AssistSection
216
217
  annotationType="comment"
217
- isDetecting={false}
218
- detectionProgress={null}
218
+ isAssisting={false}
219
+ progress={null}
219
220
  />
220
221
  );
221
222
 
222
- expect(screen.getByText('Detect Comments')).toBeInTheDocument();
223
+ expect(screen.getByText('Annotate Comments')).toBeInTheDocument();
223
224
  });
224
225
 
225
226
  it('should show tone selector for comments', () => {
226
227
  renderWithProviders(
227
- <DetectSection
228
+ <AssistSection
228
229
  annotationType="comment"
229
- isDetecting={false}
230
- detectionProgress={null}
230
+ isAssisting={false}
231
+ progress={null}
231
232
  />
232
233
  );
233
234
 
@@ -237,10 +238,10 @@ describe('DetectSection', () => {
237
238
 
238
239
  it('should show tone selector for assessments', () => {
239
240
  renderWithProviders(
240
- <DetectSection
241
+ <AssistSection
241
242
  annotationType="assessment"
242
- isDetecting={false}
243
- detectionProgress={null}
243
+ isAssisting={false}
244
+ progress={null}
244
245
  />
245
246
  );
246
247
 
@@ -250,10 +251,10 @@ describe('DetectSection', () => {
250
251
 
251
252
  it('should not show tone selector for highlights', () => {
252
253
  renderWithProviders(
253
- <DetectSection
254
+ <AssistSection
254
255
  annotationType="highlight"
255
- isDetecting={false}
256
- detectionProgress={null}
256
+ isAssisting={false}
257
+ progress={null}
257
258
  />
258
259
  );
259
260
 
@@ -263,23 +264,23 @@ describe('DetectSection', () => {
263
264
  });
264
265
 
265
266
  describe('Event Emission', () => {
266
- it('should emit detection:start event when detect button clicked', async () => {
267
+ it('should emit annotate:detect-request event when detect button clicked', async () => {
267
268
  const user = userEvent.setup();
268
269
  const detectionHandler = vi.fn();
269
270
 
270
271
  const { eventBus } = renderWithProviders(
271
- <DetectSection
272
+ <AssistSection
272
273
  annotationType="highlight"
273
- isDetecting={false}
274
- detectionProgress={null}
274
+ isAssisting={false}
275
+ progress={null}
275
276
  />,
276
277
  { returnEventBus: true }
277
278
  );
278
279
 
279
- const subscription = eventBus!.get('detection:start').subscribe(detectionHandler);
280
+ const subscription = eventBus!.get('annotate:assist-request').subscribe(detectionHandler);
280
281
 
281
- const detectButton = screen.getByRole('button', { name: /✨ Detect/ });
282
- await user.click(detectButton);
282
+ const annotateButton = screen.getByRole('button', { name: /✨ Annotate/ });
283
+ await user.click(annotateButton);
283
284
 
284
285
  expect(detectionHandler).toHaveBeenCalledWith({
285
286
  motivation: 'highlighting',
@@ -294,18 +295,18 @@ describe('DetectSection', () => {
294
295
  const detectionHandler = vi.fn();
295
296
 
296
297
  const { eventBus } = renderWithProviders(
297
- <DetectSection
298
+ <AssistSection
298
299
  annotationType="assessment"
299
- isDetecting={false}
300
- detectionProgress={null}
300
+ isAssisting={false}
301
+ progress={null}
301
302
  />,
302
303
  { returnEventBus: true }
303
304
  );
304
305
 
305
- const subscription = eventBus!.get('detection:start').subscribe(detectionHandler);
306
+ const subscription = eventBus!.get('annotate:assist-request').subscribe(detectionHandler);
306
307
 
307
- const detectButton = screen.getByRole('button', { name: /✨ Detect/ });
308
- await user.click(detectButton);
308
+ const annotateButton = screen.getByRole('button', { name: /✨ Annotate/ });
309
+ await user.click(annotateButton);
309
310
 
310
311
  expect(detectionHandler).toHaveBeenCalledWith({
311
312
  motivation: 'assessing',
@@ -320,18 +321,18 @@ describe('DetectSection', () => {
320
321
  const detectionHandler = vi.fn();
321
322
 
322
323
  const { eventBus } = renderWithProviders(
323
- <DetectSection
324
+ <AssistSection
324
325
  annotationType="comment"
325
- isDetecting={false}
326
- detectionProgress={null}
326
+ isAssisting={false}
327
+ progress={null}
327
328
  />,
328
329
  { returnEventBus: true }
329
330
  );
330
331
 
331
- const subscription = eventBus!.get('detection:start').subscribe(detectionHandler);
332
+ const subscription = eventBus!.get('annotate:assist-request').subscribe(detectionHandler);
332
333
 
333
- const detectButton = screen.getByRole('button', { name: /✨ Detect/ });
334
- await user.click(detectButton);
334
+ const annotateButton = screen.getByRole('button', { name: /✨ Annotate/ });
335
+ await user.click(annotateButton);
335
336
 
336
337
  expect(detectionHandler).toHaveBeenCalledWith({
337
338
  motivation: 'commenting',
@@ -346,21 +347,21 @@ describe('DetectSection', () => {
346
347
  const detectionHandler = vi.fn();
347
348
 
348
349
  const { eventBus } = renderWithProviders(
349
- <DetectSection
350
+ <AssistSection
350
351
  annotationType="highlight"
351
- isDetecting={false}
352
- detectionProgress={null}
352
+ isAssisting={false}
353
+ progress={null}
353
354
  />,
354
355
  { returnEventBus: true }
355
356
  );
356
357
 
357
- const subscription = eventBus!.get('detection:start').subscribe(detectionHandler);
358
+ const subscription = eventBus!.get('annotate:assist-request').subscribe(detectionHandler);
358
359
 
359
360
  const textarea = screen.getByPlaceholderText('Enter custom instructions...');
360
361
  await user.type(textarea, 'Find key concepts');
361
362
 
362
- const detectButton = screen.getByRole('button', { name: /✨ Detect/ });
363
- await user.click(detectButton);
363
+ const annotateButton = screen.getByRole('button', { name: /✨ Annotate/ });
364
+ await user.click(annotateButton);
364
365
 
365
366
  expect(detectionHandler).toHaveBeenCalledWith({
366
367
  motivation: 'highlighting',
@@ -377,14 +378,14 @@ describe('DetectSection', () => {
377
378
  describe('Collapsible Behavior', () => {
378
379
  it('should be expanded by default', () => {
379
380
  renderWithProviders(
380
- <DetectSection
381
+ <AssistSection
381
382
  annotationType="highlight"
382
- isDetecting={false}
383
- detectionProgress={null}
383
+ isAssisting={false}
384
+ progress={null}
384
385
  />
385
386
  );
386
387
 
387
- const collapseButton = screen.getByRole('button', { name: /Detect Highlights/ });
388
+ const collapseButton = screen.getByRole('button', { name: /Annotate Highlights/ });
388
389
  expect(collapseButton).toHaveAttribute('aria-expanded', 'true');
389
390
  expect(screen.getByPlaceholderText('Enter custom instructions...')).toBeInTheDocument();
390
391
  });
@@ -393,14 +394,14 @@ describe('DetectSection', () => {
393
394
  const user = userEvent.setup();
394
395
 
395
396
  renderWithProviders(
396
- <DetectSection
397
+ <AssistSection
397
398
  annotationType="highlight"
398
- isDetecting={false}
399
- detectionProgress={null}
399
+ isAssisting={false}
400
+ progress={null}
400
401
  />
401
402
  );
402
403
 
403
- const collapseButton = screen.getByRole('button', { name: /Detect Highlights/ });
404
+ const collapseButton = screen.getByRole('button', { name: /Annotate Highlights/ });
404
405
  await user.click(collapseButton);
405
406
 
406
407
  expect(collapseButton).toHaveAttribute('aria-expanded', 'false');
@@ -411,14 +412,14 @@ describe('DetectSection', () => {
411
412
  const user = userEvent.setup();
412
413
 
413
414
  renderWithProviders(
414
- <DetectSection
415
+ <AssistSection
415
416
  annotationType="highlight"
416
- isDetecting={false}
417
- detectionProgress={null}
417
+ isAssisting={false}
418
+ progress={null}
418
419
  />
419
420
  );
420
421
 
421
- const collapseButton = screen.getByRole('button', { name: /Detect Highlights/ });
422
+ const collapseButton = screen.getByRole('button', { name: /Annotate Highlights/ });
422
423
  await user.click(collapseButton); // Collapse
423
424
  await user.click(collapseButton); // Expand
424
425
 
@@ -430,10 +431,10 @@ describe('DetectSection', () => {
430
431
  describe('Edge Cases', () => {
431
432
  it('should handle empty progress message', () => {
432
433
  renderWithProviders(
433
- <DetectSection
434
+ <AssistSection
434
435
  annotationType="highlight"
435
- isDetecting={true}
436
- detectionProgress={{
436
+ isAssisting={true}
437
+ progress={{
437
438
  status: 'analyzing',
438
439
  message: '',
439
440
  }}
@@ -441,16 +442,16 @@ describe('DetectSection', () => {
441
442
  );
442
443
 
443
444
  // Should render progress section even with empty message
444
- const progressDiv = document.querySelector('.semiont-detection-progress');
445
+ const progressDiv = document.querySelector('.semiont-annotation-progress');
445
446
  expect(progressDiv).toBeInTheDocument();
446
447
  });
447
448
 
448
449
  it('should handle progress without percentage', () => {
449
450
  renderWithProviders(
450
- <DetectSection
451
+ <AssistSection
451
452
  annotationType="highlight"
452
- isDetecting={true}
453
- detectionProgress={{
453
+ isAssisting={true}
454
+ progress={{
454
455
  status: 'analyzing',
455
456
  message: 'Processing...',
456
457
  // no percentage
@@ -463,10 +464,10 @@ describe('DetectSection', () => {
463
464
 
464
465
  it('should handle progress with empty requestParams array', () => {
465
466
  renderWithProviders(
466
- <DetectSection
467
+ <AssistSection
467
468
  annotationType="highlight"
468
- isDetecting={true}
469
- detectionProgress={{
469
+ isAssisting={true}
470
+ progress={{
470
471
  status: 'analyzing',
471
472
  message: 'Processing...',
472
473
  requestParams: [],
@@ -241,7 +241,7 @@ describe('CommentEntry Component', () => {
241
241
  });
242
242
 
243
243
  describe('Click Interactions', () => {
244
- it('should emit annotation:click event when comment is clicked', async () => {
244
+ it('should emit attend:click event when comment is clicked', async () => {
245
245
  const clickHandler = vi.fn();
246
246
 
247
247
  const { container, eventBus } = renderWithProviders(
@@ -250,7 +250,7 @@ describe('CommentEntry Component', () => {
250
250
  );
251
251
 
252
252
  // Subscribe to actual event on real event bus
253
- const subscription = eventBus!.get('annotation:click').subscribe(clickHandler);
253
+ const subscription = eventBus!.get('attend:click').subscribe(clickHandler);
254
254
 
255
255
  const commentDiv = container.firstChild as HTMLElement;
256
256
  await userEvent.click(commentDiv);
@@ -273,7 +273,7 @@ describe('CommentEntry Component', () => {
273
273
  });
274
274
 
275
275
  describe('Hover Interactions', () => {
276
- it('should emit annotation:hover event with annotation id after dwell delay', () => {
276
+ it('should emit attend:hover event with annotation id after dwell delay', () => {
277
277
  vi.useFakeTimers();
278
278
  const hoverHandler = vi.fn();
279
279
 
@@ -283,7 +283,7 @@ describe('CommentEntry Component', () => {
283
283
  );
284
284
 
285
285
  // Subscribe to actual event
286
- const subscription = eventBus!.get('annotation:hover').subscribe(hoverHandler);
286
+ const subscription = eventBus!.get('attend:hover').subscribe(hoverHandler);
287
287
 
288
288
  const commentDiv = container.firstChild as HTMLElement;
289
289
  fireEvent.mouseEnter(commentDiv);
@@ -301,7 +301,7 @@ describe('CommentEntry Component', () => {
301
301
  vi.useRealTimers();
302
302
  });
303
303
 
304
- it('should NOT emit annotation:hover when mouse leaves before dwell delay', () => {
304
+ it('should NOT emit attend:hover when mouse leaves before dwell delay', () => {
305
305
  vi.useFakeTimers();
306
306
  const hoverHandler = vi.fn();
307
307
 
@@ -311,7 +311,7 @@ describe('CommentEntry Component', () => {
311
311
  );
312
312
 
313
313
  // Subscribe to actual event
314
- const subscription = eventBus!.get('annotation:hover').subscribe(hoverHandler);
314
+ const subscription = eventBus!.get('attend:hover').subscribe(hoverHandler);
315
315
 
316
316
  const commentDiv = container.firstChild as HTMLElement;
317
317
  fireEvent.mouseEnter(commentDiv);
@@ -327,7 +327,7 @@ describe('CommentEntry Component', () => {
327
327
  vi.useRealTimers();
328
328
  });
329
329
 
330
- it('should emit annotation:hover null after dwell then leave', () => {
330
+ it('should emit attend:hover null after dwell then leave', () => {
331
331
  vi.useFakeTimers();
332
332
  const hoverHandler = vi.fn();
333
333
 
@@ -336,7 +336,7 @@ describe('CommentEntry Component', () => {
336
336
  { returnEventBus: true }
337
337
  );
338
338
 
339
- const subscription = eventBus!.get('annotation:hover').subscribe(hoverHandler);
339
+ const subscription = eventBus!.get('attend:hover').subscribe(hoverHandler);
340
340
 
341
341
  const commentDiv = container.firstChild as HTMLElement;
342
342
  fireEvent.mouseEnter(commentDiv);
@@ -29,7 +29,7 @@ function createEventTracker() {
29
29
  events.push({ event: eventName, payload });
30
30
  };
31
31
 
32
- const panelEvents = ['annotation:create'] as const;
32
+ const panelEvents = ['annotate:create'] as const;
33
33
 
34
34
  panelEvents.forEach(eventName => {
35
35
  const handler = trackEvent(eventName);
@@ -396,7 +396,7 @@ describe('CommentsPanel Component', () => {
396
396
  expect(textarea).toHaveFocus();
397
397
  });
398
398
 
399
- it('should emit annotation:create event when save is clicked', async () => {
399
+ it('should emit annotate:createevent when save is clicked', async () => {
400
400
  const tracker = createEventTracker();
401
401
  const pendingAnnotation = createPendingAnnotation('Selected text');
402
402
 
@@ -416,7 +416,7 @@ describe('CommentsPanel Component', () => {
416
416
 
417
417
  await waitFor(() => {
418
418
  expect(tracker.events.some(e =>
419
- e.event === 'annotation:create' &&
419
+ e.event === 'annotate:create' &&
420
420
  e.payload?.motivation === 'commenting' &&
421
421
  e.payload?.body?.[0]?.value === 'My new comment'
422
422
  )).toBe(true);