@micha.bigler/ui-core-micha 3.14.4 → 4.0.1

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 (341) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +7 -0
  3. package/dist/chat/kitSxRegistry.js +9 -0
  4. package/dist/components/charts/kitSxRegistry.js +6 -0
  5. package/dist/entries/charts.js +6 -0
  6. package/dist/entries/chat.js +8 -0
  7. package/dist/entries/markdown.js +1 -0
  8. package/dist/index.js +0 -14
  9. package/dist/pages/AccountPage.js +1 -2
  10. package/dist/pages/LoginPage.js +1 -2
  11. package/dist/pages/PasswordChangePage.js +1 -2
  12. package/dist/pages/PasswordInvitePage.js +1 -2
  13. package/dist/pages/PasswordResetRequestPage.js +1 -2
  14. package/dist/pages/SignUpPage.js +1 -2
  15. package/dist/pages/SignupConfirmPage.js +1 -2
  16. package/dist/theme/kitSxEntry.js +11 -0
  17. package/dist/theme/kitSxRegistry.js +2 -15
  18. package/package.json +31 -7
  19. package/.github/workflows/ci.yml +0 -35
  20. package/.github/workflows/publish.yml +0 -126
  21. package/DESIGN.md +0 -60
  22. package/WORK_ORDERS.md +0 -150
  23. package/dev/entries.jsx +0 -721
  24. package/dev/fixtures.js +0 -26
  25. package/dev/main.jsx +0 -75
  26. package/dev/mockTransport.jsx +0 -128
  27. package/docs/CHART-LAYOUT.md +0 -157
  28. package/docs/DARK-TOKENS.md +0 -140
  29. package/docs/TYPE-SCALE.md +0 -111
  30. package/docs/messaging-deviations.md +0 -118
  31. package/index.html +0 -12
  32. package/renovate.json +0 -10
  33. package/scripts/chart-api-census.mjs +0 -415
  34. package/src/auth/AuthContext.jsx +0 -158
  35. package/src/auth/ReauthModal.jsx +0 -82
  36. package/src/auth/UserMenu.jsx +0 -121
  37. package/src/auth/apiClient.jsx +0 -232
  38. package/src/auth/authApi.jsx +0 -539
  39. package/src/auth/authConfig.jsx +0 -34
  40. package/src/auth/reauth.js +0 -47
  41. package/src/chat/ChatComposer.jsx +0 -36
  42. package/src/chat/ChatList.jsx +0 -87
  43. package/src/chat/ChatThread.jsx +0 -128
  44. package/src/chat/ChatWorkspace.jsx +0 -244
  45. package/src/chat/MarkdownReply.jsx +0 -22
  46. package/src/chat/ModelPicker.jsx +0 -85
  47. package/src/chat/api.js +0 -18
  48. package/src/chat/useChatSocket.js +0 -32
  49. package/src/chat/wire.js +0 -7
  50. package/src/components/AccessCodeManager.jsx +0 -288
  51. package/src/components/AccessCodeSingleUseToggle.jsx +0 -92
  52. package/src/components/AllowedEmailDomainsManager.jsx +0 -92
  53. package/src/components/AuthFactorRequirementCard.jsx +0 -95
  54. package/src/components/BulkInviteCsvTab.jsx +0 -198
  55. package/src/components/EmptyState.jsx +0 -38
  56. package/src/components/LoginForm.jsx +0 -159
  57. package/src/components/MFAComponent.jsx +0 -350
  58. package/src/components/MfaLoginComponent.jsx +0 -252
  59. package/src/components/MobileBottomNav.jsx +0 -82
  60. package/src/components/PasskeysComponent.jsx +0 -252
  61. package/src/components/PasswordChangeForm.jsx +0 -87
  62. package/src/components/PasswordResetRequestForm.jsx +0 -43
  63. package/src/components/PasswordSetForm.jsx +0 -97
  64. package/src/components/ProfileComponent.jsx +0 -348
  65. package/src/components/QrSignupManager.jsx +0 -404
  66. package/src/components/QrSignupValidityManager.jsx +0 -106
  67. package/src/components/RegistrationMethodsManager.jsx +0 -150
  68. package/src/components/SecurityComponent.jsx +0 -141
  69. package/src/components/SocialLoginButtons.jsx +0 -83
  70. package/src/components/SoftChip.jsx +0 -93
  71. package/src/components/StatTile.jsx +0 -39
  72. package/src/components/SupportRecoveryRequestsTab.jsx +0 -482
  73. package/src/components/TurnstileWidget.jsx +0 -99
  74. package/src/components/UserInviteComponent.jsx +0 -76
  75. package/src/components/UserListComponent.jsx +0 -618
  76. package/src/components/charts/BarChart.jsx +0 -102
  77. package/src/components/charts/ChartFrame.jsx +0 -214
  78. package/src/components/charts/LineChart.jsx +0 -126
  79. package/src/components/charts/ScatterChart.jsx +0 -299
  80. package/src/components/charts/TimeSeriesChart.jsx +0 -300
  81. package/src/components/charts/chartDefaults.js +0 -644
  82. package/src/components/charts/chartLabels.js +0 -36
  83. package/src/components/charts/exportChart.js +0 -258
  84. package/src/components/charts/formatters.js +0 -39
  85. package/src/components/charts/palette.js +0 -33
  86. package/src/components/charts/yearTickInterval.js +0 -7
  87. package/src/i18n/authTranslations.ts +0 -2651
  88. package/src/i18n/chartsTranslations.ts +0 -91
  89. package/src/i18n/chatTranslations.ts +0 -55
  90. package/src/i18n/messagingTranslations.ts +0 -120
  91. package/src/i18n/notificationsTranslations.ts +0 -32
  92. package/src/i18n/onboardingTranslations.ts +0 -29
  93. package/src/i18n/sectionNavTranslations.ts +0 -20
  94. package/src/i18n/uiCoreTranslations.js +0 -29
  95. package/src/i18n/userMenuTranslations.ts +0 -5
  96. package/src/index.js +0 -158
  97. package/src/layout/PageLayout.jsx +0 -36
  98. package/src/layout/SectionNav.jsx +0 -320
  99. package/src/messaging/AttachmentList.jsx +0 -145
  100. package/src/messaging/Composer.jsx +0 -197
  101. package/src/messaging/ConversationLaunchers.jsx +0 -51
  102. package/src/messaging/ConversationList.jsx +0 -109
  103. package/src/messaging/DirectMessageLauncher.jsx +0 -112
  104. package/src/messaging/MessageBubble.jsx +0 -183
  105. package/src/messaging/MessagingProvider.jsx +0 -0
  106. package/src/messaging/MessagingScopeConfig.jsx +0 -24
  107. package/src/messaging/PollCard.jsx +0 -163
  108. package/src/messaging/ReactionBar.jsx +0 -43
  109. package/src/messaging/ReadTicks.jsx +0 -82
  110. package/src/messaging/Thread.jsx +0 -195
  111. package/src/messaging/api.js +0 -48
  112. package/src/messaging/composerImageCompression.js +0 -35
  113. package/src/messaging/linkifyText.jsx +0 -37
  114. package/src/notifications/NotificationBell.jsx +0 -84
  115. package/src/notifications/NotificationSettings.jsx +0 -330
  116. package/src/notifications/NotificationsProvider.jsx +0 -224
  117. package/src/notifications/PopupSurface.jsx +0 -105
  118. package/src/notifications/api.js +0 -55
  119. package/src/notifications/feedApi.js +0 -18
  120. package/src/notifications/realtime.jsx +0 -138
  121. package/src/notifications/serviceWorker/sw.js +0 -50
  122. package/src/onboarding/OnboardingProvider.jsx +0 -326
  123. package/src/onboarding/OnboardingWizard.jsx +0 -61
  124. package/src/onboarding/WizardDialogShell.jsx +0 -51
  125. package/src/onboarding/api.js +0 -13
  126. package/src/onboarding/stepSelection.js +0 -16
  127. package/src/onboarding/steps/BrowserPushStep.jsx +0 -121
  128. package/src/onboarding/steps/CompleteNameStep.jsx +0 -46
  129. package/src/onboarding/steps/CookieConsentStep.jsx +0 -133
  130. package/src/onboarding/steps/PwaInstallStep.jsx +0 -47
  131. package/src/pages/AccountPage.jsx +0 -394
  132. package/src/pages/LoginPage.jsx +0 -343
  133. package/src/pages/PasswordChangePage.jsx +0 -62
  134. package/src/pages/PasswordInvitePage.jsx +0 -177
  135. package/src/pages/PasswordResetRequestPage.jsx +0 -68
  136. package/src/pages/SignUpPage.jsx +0 -268
  137. package/src/pages/SignupConfirmPage.jsx +0 -155
  138. package/src/testing/checkKitIntegration.js +0 -233
  139. package/src/theme/createAppTheme.js +0 -423
  140. package/src/theme/fonts.js +0 -3
  141. package/src/theme/index.js +0 -21
  142. package/src/theme/kitSxRegistry.js +0 -285
  143. package/src/theme/themeCompleteness.js +0 -1045
  144. package/src/theme/tokens.js +0 -478
  145. package/src/utils/auth-errors.js +0 -76
  146. package/src/utils/authService.js +0 -223
  147. package/src/utils/resolveErrorText.js +0 -28
  148. package/src/utils/webauthn.js +0 -51
  149. package/tests/AccountPage.profileStatements.test.jsx +0 -162
  150. package/tests/AccountPage.test.jsx +0 -200
  151. package/tests/AuthContext.test.jsx +0 -129
  152. package/tests/BarChart.test.jsx +0 -112
  153. package/tests/BrowserPushStep.test.jsx +0 -110
  154. package/tests/ChartFrame.test.jsx +0 -336
  155. package/tests/ConversationList.test.jsx +0 -144
  156. package/tests/CookieConsentStep.test.jsx +0 -69
  157. package/tests/EmptyState.test.jsx +0 -62
  158. package/tests/LineChart.test.jsx +0 -80
  159. package/tests/MessagingProvider.test.jsx +0 -50
  160. package/tests/MobileBottomNav.test.jsx +0 -319
  161. package/tests/NotificationBell.test.jsx +0 -60
  162. package/tests/NotificationSettings.test.jsx +0 -276
  163. package/tests/NotificationsProvider.test.jsx +0 -240
  164. package/tests/OnboardingProvider.test.jsx +0 -294
  165. package/tests/OnboardingWizard.test.jsx +0 -143
  166. package/tests/PasswordChangeForm.test.jsx +0 -70
  167. package/tests/PasswordInvitePage.test.jsx +0 -142
  168. package/tests/PasswordSetForm.test.jsx +0 -70
  169. package/tests/PopupSurface.test.jsx +0 -142
  170. package/tests/ProfileComponent.refresh.test.jsx +0 -194
  171. package/tests/QrSignupManager.registrationContext.test.jsx +0 -106
  172. package/tests/QrSignupManagerInfoBox.test.jsx +0 -49
  173. package/tests/ScatterChart.test.jsx +0 -270
  174. package/tests/SectionNav.test.jsx +0 -363
  175. package/tests/SignUpPage.test.jsx +0 -208
  176. package/tests/SoftChip.test.jsx +0 -105
  177. package/tests/StatTile.test.jsx +0 -57
  178. package/tests/Thread.test.jsx +0 -151
  179. package/tests/TimeSeriesChart.test.jsx +0 -367
  180. package/tests/UserListComponent.test.jsx +0 -192
  181. package/tests/UserMenu.test.jsx +0 -171
  182. package/tests/apiClientLanguage.test.js +0 -33
  183. package/tests/apiClientPublicPaths.test.js +0 -178
  184. package/tests/authApiLogin.test.js +0 -42
  185. package/tests/authApiRegistration.test.js +0 -31
  186. package/tests/authErrorCodeRendering.test.jsx +0 -77
  187. package/tests/authErrors.test.js +0 -74
  188. package/tests/authTranslations.test.js +0 -74
  189. package/tests/chart-api-census.test.js +0 -366
  190. package/tests/chartAxisTickBand.test.jsx +0 -95
  191. package/tests/chartDefaults.test.js +0 -902
  192. package/tests/chartLabels.test.js +0 -50
  193. package/tests/chartsPalette.test.js +0 -99
  194. package/tests/chatApi.test.js +0 -48
  195. package/tests/chatDriverNames.test.jsx +0 -71
  196. package/tests/chatExports.test.js +0 -3
  197. package/tests/chatList.test.jsx +0 -84
  198. package/tests/chatPicker.test.jsx +0 -82
  199. package/tests/chatSocket.test.jsx +0 -26
  200. package/tests/chatThread.test.jsx +0 -116
  201. package/tests/chatTranslations.test.js +0 -47
  202. package/tests/chatWorkspace.test.jsx +0 -234
  203. package/tests/checkKitIntegration.test.jsx +0 -219
  204. package/tests/createAppTheme.test.js +0 -132
  205. package/tests/createAppThemeDark.test.js +0 -127
  206. package/tests/createAppThemeLightGuard.test.js +0 -40
  207. package/tests/createAppThemePageContrast.test.js +0 -108
  208. package/tests/createAppThemeTypography.test.js +0 -53
  209. package/tests/errorCallSiteGuard.test.js +0 -32
  210. package/tests/exportChart.test.js +0 -313
  211. package/tests/feedApi.test.js +0 -46
  212. package/tests/fixtures/light-theme-baseline.json +0 -2234
  213. package/tests/i18nAggregate.test.js +0 -120
  214. package/tests/i18nGermanVariant.test.js +0 -65
  215. package/tests/loginPageErrorResolution.test.jsx +0 -102
  216. package/tests/messagingApi.test.js +0 -32
  217. package/tests/messagingChunk6.test.jsx +0 -116
  218. package/tests/messagingCompactBubble.test.jsx +0 -64
  219. package/tests/messagingComposer.test.jsx +0 -136
  220. package/tests/messagingComposerChunk5.test.jsx +0 -113
  221. package/tests/messagingContractConformance.test.js +0 -69
  222. package/tests/messagingDirectMessageLauncher.test.jsx +0 -151
  223. package/tests/messagingExports.test.js +0 -21
  224. package/tests/messagingInteractions.test.jsx +0 -136
  225. package/tests/messagingLastMessagePreview.test.jsx +0 -93
  226. package/tests/messagingLinkify.test.jsx +0 -51
  227. package/tests/messagingMessageActions.test.jsx +0 -163
  228. package/tests/messagingMsg6.test.jsx +0 -105
  229. package/tests/messagingMsg6f.test.jsx +0 -155
  230. package/tests/messagingMsg6g.test.jsx +0 -166
  231. package/tests/messagingMsg6h.test.jsx +0 -136
  232. package/tests/messagingMsg6i.test.jsx +0 -129
  233. package/tests/messagingPollRendering.test.jsx +0 -142
  234. package/tests/messagingReactionMerge.test.jsx +0 -77
  235. package/tests/messagingReadTicksTooltip.test.jsx +0 -36
  236. package/tests/messagingThreadReceipts.test.jsx +0 -178
  237. package/tests/messagingThreadingQuoting.test.jsx +0 -87
  238. package/tests/messagingUnreadLifecycle.test.jsx +0 -78
  239. package/tests/notificationsApi.test.js +0 -41
  240. package/tests/notificationsExports.test.js +0 -34
  241. package/tests/onboardingDescriptors.test.js +0 -132
  242. package/tests/packageTreeShaking.test.js +0 -126
  243. package/tests/realtime.test.jsx +0 -219
  244. package/tests/resolveErrorText.test.js +0 -72
  245. package/tests/stepSelection.test.js +0 -53
  246. package/tests/themeCompleteness.test.js +0 -626
  247. package/tests/timeSeriesLegend.test.js +0 -99
  248. package/tests/userScreenTranslations.test.jsx +0 -218
  249. package/tsconfig.build.json +0 -18
  250. package/vite.config.mjs +0 -6
  251. package/work-orders/AUTH-1.md +0 -74
  252. package/work-orders/AUTH-2.md +0 -74
  253. package/work-orders/AUTH-4.md +0 -183
  254. package/work-orders/AUTH-5.md +0 -154
  255. package/work-orders/AUTH-7.md +0 -181
  256. package/work-orders/AUTH-8.md +0 -184
  257. package/work-orders/CHART-1.md +0 -285
  258. package/work-orders/CHART-2.md +0 -222
  259. package/work-orders/CHART-3.md +0 -163
  260. package/work-orders/CHART-4.md +0 -203
  261. package/work-orders/CHART-5.md +0 -226
  262. package/work-orders/CHART-6.md +0 -428
  263. package/work-orders/CHART-7.md +0 -175
  264. package/work-orders/DX-1.md +0 -169
  265. package/work-orders/DX-2.md +0 -188
  266. package/work-orders/DX-3.md +0 -195
  267. package/work-orders/I18N-1.md +0 -254
  268. package/work-orders/I18N-3.md +0 -207
  269. package/work-orders/MSG-3.md +0 -375
  270. package/work-orders/MSG-3b.md +0 -1002
  271. package/work-orders/MSG-3c.md +0 -378
  272. package/work-orders/MSG-3d.md +0 -268
  273. package/work-orders/MSG-3e.md +0 -164
  274. package/work-orders/MSG-3f.md +0 -391
  275. package/work-orders/MSG-6e.md +0 -308
  276. package/work-orders/MSG-6f.md +0 -214
  277. package/work-orders/MSG-6g.md +0 -244
  278. package/work-orders/MSG-6h.md +0 -238
  279. package/work-orders/MSG-6i.md +0 -271
  280. package/work-orders/MSG-6j.md +0 -117
  281. package/work-orders/NOTIF-12.md +0 -214
  282. package/work-orders/NOTIF-13.md +0 -142
  283. package/work-orders/NOTIF-14.md +0 -151
  284. package/work-orders/PRIM-1.md +0 -177
  285. package/work-orders/SHELL-1.md +0 -255
  286. package/work-orders/SHELL-2.md +0 -197
  287. package/work-orders/SHELL-3.md +0 -359
  288. package/work-orders/SHELL-4.md +0 -351
  289. package/work-orders/SHELL-5.md +0 -345
  290. package/work-orders/SHELL-6.md +0 -210
  291. package/work-orders/THEME-1.md +0 -587
  292. package/work-orders/THEME-10.md +0 -303
  293. package/work-orders/THEME-11.md +0 -208
  294. package/work-orders/THEME-2.md +0 -339
  295. package/work-orders/THEME-3.md +0 -210
  296. package/work-orders/THEME-4.md +0 -271
  297. package/work-orders/THEME-5.md +0 -341
  298. package/work-orders/THEME-6.md +0 -247
  299. package/work-orders/THEME-7.md +0 -82
  300. package/work-orders/THEME-8.md +0 -211
  301. package/work-orders/THEME-9.md +0 -194
  302. package/work-orders/UCM-AUTH-10.md +0 -490
  303. package/work-orders/UCM-AUTH-11.md +0 -185
  304. package/work-orders/UCM-AUTH-12.md +0 -98
  305. package/work-orders/UCM-AUTH-13.md +0 -47
  306. package/work-orders/UCM-AUTH-9.md +0 -207
  307. package/work-orders/UCM-CHART-10.md +0 -150
  308. package/work-orders/UCM-CHART-11.md +0 -132
  309. package/work-orders/UCM-CHART-12.md +0 -348
  310. package/work-orders/UCM-CHART-13.md +0 -122
  311. package/work-orders/UCM-CHART-14.md +0 -198
  312. package/work-orders/UCM-CHART-15.md +0 -187
  313. package/work-orders/UCM-CHART-16.md +0 -169
  314. package/work-orders/UCM-CHART-17.md +0 -195
  315. package/work-orders/UCM-CHART-18.md +0 -200
  316. package/work-orders/UCM-CHART-8.md +0 -147
  317. package/work-orders/UCM-CHART-9.md +0 -265
  318. package/work-orders/UCM-CHAT-1.md +0 -190
  319. package/work-orders/UCM-CHAT-2.md +0 -75
  320. package/work-orders/UCM-CI-1.md +0 -65
  321. package/work-orders/UCM-DEP-1.md +0 -63
  322. package/work-orders/UCM-I18N-4.md +0 -226
  323. package/work-orders/UCM-I18N-5.md +0 -211
  324. package/work-orders/UCM-MSG-20.md +0 -192
  325. package/work-orders/UCM-PRIM-2.md +0 -114
  326. package/work-orders/UCM-SHELL-7.md +0 -134
  327. package/work-orders/UCM-SHELL-8.md +0 -125
  328. package/work-orders/UCM-TEST-1.md +0 -304
  329. package/work-orders/UCM-THEME-13.md +0 -69
  330. package/work-orders/UCM-THEME-14.md +0 -312
  331. package/work-orders/UCM-THEME-15.md +0 -356
  332. package/work-orders/UCM-THEME-16.md +0 -80
  333. package/work-orders/UCM-THEME-17.md +0 -111
  334. package/work-orders/UCM-THEME-18.md +0 -184
  335. package/work-orders/assets/AUTH-4-user-list-card.html +0 -407
  336. package/work-orders/assets/PRIM-1-dashboard-primitives.html +0 -624
  337. package/work-orders/assets/SHELL-2-account-navigation.html +0 -1159
  338. package/work-orders/assets/THEME-1-baseline-reference-sheet.html +0 -1352
  339. package/work-orders/assets/UCM-CHAT-1-ai-chat.html +0 -447
  340. package/work-orders/assets/UCM-THEME-13-dark-prototype.html +0 -390
  341. package/work-orders/assets/UCM-THEME-17-type-scale.html +0 -391
@@ -1,184 +0,0 @@
1
- # AUTH-8 — `extractErrorInfo`'s hardcoded `'GENERIC'` code must not out-rank the caller's own default
2
-
3
- ---
4
-
5
- # A. Envelope — authored by the Expertenchat
6
-
7
- ## Goal & expected outcome
8
- - Ziel: `extractErrorInfo` (`src/utils/auth-errors.js:2-27`) gibt für jeden Backend-Fehler der
9
- Form `{"detail": "..."}` (Djangos generisches Fehlerformat — u.a. DRF `Throttled`, `Http404`,
10
- `PermissionDenied`, jede unbehandelte `APIException`; exakt die Form des 429/409, das die
11
- gesamte `KIRA-TRACK-3`/`AUTH-7`-Untersuchung ausgelöst hat) den hartcodierten Code `'GENERIC'`
12
- zurück. `normaliseApiError` (Zeile 29-38) wählt dann `info.code || defaultCode` — da `'GENERIC'`
13
- ein truthy String ist, GEWINNT er IMMER gegen den von JEDER der 39 bestehenden Aufrufstellen in
14
- diesem Repo übergebenen, spezifischen `defaultCode` (z. B. `'Auth.LOGIN_FAILED'`,
15
- `'Auth.PROFILE_UPDATE_FAILED'`, …). `'GENERIC'` ist an KEINER Stelle als i18n-Key registriert
16
- (verifiziert: kein Treffer in `src/i18n/`, keine Erwähnung ausserhalb dieser einen Zeile) — die
17
- UI zeigt also für JEDEN `{detail}`-förmigen Backend-Fehler den rohen String `"GENERIC"` statt
18
- einer übersetzten Meldung, gleich welcher Aufrufer betroffen ist.
19
- - Expected outcome: ein `{detail}`-förmiger Fehler liefert `code === <übergebener defaultCode>`
20
- (übersetzt, wie jeder andere fehlende/unbekannte Code auch) — `data.detail`s Text bleibt weiterhin
21
- in `.message` erhalten (nützlich für Logs/Debugging), beeinflusst aber nicht mehr `.code`.
22
-
23
- ## Scope + non-goals
24
- - In scope: ausschliesslich `src/utils/auth-errors.js` — die EINE Zeile, die `code: 'GENERIC'`
25
- zurückgibt, wird zu `code: null` (dann gewinnt in `normaliseApiError` korrekt der übergebene
26
- `defaultCode`, exakt wie bei jedem anderen Fehler ohne erkennbaren Code).
27
- - Explizite Non-Goals / nicht anfassen: die ANDEREN beiden Zweige von `extractErrorInfo`
28
- (`data.errors[0].code`, `data.code`) liefern einen ECHTEN, vom Backend gesetzten Code — dieses
29
- Verhalten ist korrekt und bleibt unverändert; nicht "verbessern" oder umbauen.
30
- `normaliseApiError`s Signatur/Rückgabeform (`Error` mit `.code`/`.status`/`.raw`) bleibt gleich.
31
- Keine neue i18n-Übersetzung für `'GENERIC'` selbst nötig — der Fix macht den String obsolet,
32
- statt ihn übersetzbar zu machen. Keine Änderung an `LoginPage.jsx`/`SecurityComponent.jsx`/
33
- anderen Konsumenten — die lesen bereits `err.code || '<eigener Default>'` und profitieren
34
- automatisch, ohne selbst geändert zu werden.
35
-
36
- ## Tier · precondition / gate
37
- - Tier: 3 — Shared-Core (`ui-core-micha`), betrifft laut Aufrufstellen-Scan ALLE 39 bestehenden
38
- `normaliseApiError(...)`-Aufrufe in diesem Repo (jede Funktion in `src/auth/authApi.jsx` und
39
- `src/utils/authService.js`). Kein Precondition/Gate.
40
- - **Wichtig fürs Versionsschema:** anders als `AUTH-7` (rein additiv) ändert dieser Fix
41
- BEOBACHTBARES Verhalten für jeden Aufrufer, der aktuell (fehlerhaft) `.code === 'GENERIC'`
42
- bekommt — das ist der Bug selbst, aber jede konsumierende App, die diese Version zieht, sieht ab
43
- sofort eine ANDERE (korrekte) übersetzte Meldung an Stellen, wo bisher der rohe String
44
- `"GENERIC"` erschien. Deshalb MINOR-Bump (nicht PATCH) vorgesehen, siehe Teil C.
45
-
46
- ## Risks
47
- - Wird der Fix zu breit gefasst (z. B. `'GENERIC'` komplett aus dem Vokabular entfernt statt nur
48
- die eine Codepfad-Priorität zu korrigieren), könnte das `.message`-Feld (der rohe `data.detail`-
49
- Text) verlorengehen — das wird von KEINEM bekannten Aufrufer als Anzeige-Text verwendet (alle
50
- lesen `.code` fürs Rendering, s.o.), aber sicherheitshalber in den Tests absichern.
51
- - Die beiden UNVERÄNDERTEN Zweige (`data.errors[].code`, `data.code`) müssen per Regressionstest
52
- nachweislich unverändert bleiben.
53
-
54
- ## Required tests to WRITE
55
- Neue Datei `tests/authErrors.test.js` (reiner Unit-Test, kein React/Testing-Library nötig — direkter
56
- Import von `normaliseApiError`/`extractErrorInfo` aus `../src/utils/auth-errors.js`):
57
- 1. `{ response: { status: 429, data: { detail: 'Die Anfrage wurde gedrosselt...' } } }` mit
58
- `normaliseApiError(err, 'Auth.LOGIN_FAILED')` aufgerufen → `.code === 'Auth.LOGIN_FAILED'` (NICHT
59
- `'GENERIC'`), `.message === 'Die Anfrage wurde gedrosselt...'`, `.status === 429`.
60
- 2. Ohne übergebenen `defaultCode` (Default-Parameter) mit demselben `{detail}`-Fehler → `.code ===
61
- 'Auth.GENERIC_ERROR'` (der Funktions-Default, nicht `'GENERIC'`).
62
- 3. Regression: `{ response: { data: { errors: [{ code: 'enter_current_password', message: 'x' }] } } }`
63
- → `.code === 'enter_current_password'` (übergebener `defaultCode` NICHT verwendet — echter
64
- Backend-Code gewinnt weiterhin, unverändert).
65
- 4. Regression: `{ response: { data: { code: 'invalid_credentials' } } }` → `.code ===
66
- 'invalid_credentials'` (unverändert).
67
-
68
- ---
69
-
70
- # B. Implementation map — filled by the Orchestrator — ADDRESSED TO THE IMPLEMENTER
71
-
72
- ## Context package
73
-
74
- **Named file to change:** `src/utils/auth-errors.js:21-24`:
75
-
76
- ```js
77
- // Fallback for generic Django errors
78
- if (typeof data.detail === 'string') {
79
- return { status, code: 'GENERIC', message: data.detail, raw: data };
80
- }
81
- ```
82
-
83
- Ändere die zurückgegebene `code`-Property von `'GENERIC'` zu `null`:
84
-
85
- ```js
86
- // Fallback for generic Django errors. `code: null` here (not a fake sentinel)
87
- // lets normaliseApiError's `info.code || defaultCode` correctly prefer the
88
- // caller's own specific default — `data.detail` is Django's generic
89
- // human-readable message field, never a machine code, and no caller of
90
- // normaliseApiError anywhere in this repo expects to see 'GENERIC' as a code
91
- // (grepped: zero references outside this one line, zero i18n key for it).
92
- if (typeof data.detail === 'string') {
93
- return { status, code: null, message: data.detail, raw: data };
94
- }
95
- ```
96
-
97
- **Do NOT touch** the other two branches (lines 11-15 `data.errors[0]`, lines 17-19 `data.code`) or
98
- `normaliseApiError` itself (lines 29-38) — its `info.code || defaultCode` logic is already correct;
99
- the bug was entirely in what `extractErrorInfo` fed it.
100
-
101
- **Invariants / Pitfalls:**
102
- - `normaliseApiError`'s OWN default parameter is `defaultCode = 'Auth.GENERIC_ERROR'` (line 29) —
103
- this is a DIFFERENT string (`'Auth.GENERIC_ERROR'`, already namespaced like every other code in
104
- this file) from the bug's `'GENERIC'` sentinel. Do not confuse the two or "fix" the wrong one.
105
- - `data.detail` being falsy/absent already falls through correctly to the final `return { status,
106
- code: null, message: null, raw: data }` (line 26) — that path is already correct and untouched.
107
- - No i18n file needs a new key — this fix does not introduce any new user-visible string; it makes
108
- the ALREADY-TRANSLATED caller-specific keys (e.g. `Auth.LOGIN_FAILED`, confirmed translated in
109
- de/fr/en/sw) reachable again.
110
-
111
- Directive: Arbeite ausschliesslich aus diesem Kontext-Paket; öffne nur `src/utils/auth-errors.js`
112
- und die neue Testdatei zur Verifikation. Kein breites Erkunden in `authApi.jsx`/`authService.js` —
113
- deren 39 Aufrufstellen sind bereits korrekt (sie übergeben schon einen sinnvollen `defaultCode`);
114
- sie müssen nicht einzeln angeschaut werden.
115
-
116
- ## Target repo working directory (absolute)
117
-
118
- `C:\Users\Micha Bigler\Documents\webapps\ui-core-micha`
119
-
120
- ## Preamble — REQUIRED, part of this file
121
-
122
- > The text above is the COMPLETE spec — the committed WO file's content, not a plan to refine;
123
- > there is no separate plan file. Read the nearest `AGENTS.md`, the relevant
124
- > `.codex/skills/<role>/SKILL.md`, and the app `MEMORY.md` ONLY for conventions. Stay in scope; do
125
- > not touch auth/permissions/deps/schema/CI unless the spec says so; do not update `MEMORY.md`.
126
- > **Do NOT edit `WORK_ORDERS.md`** — the register row and the review verdicts are the
127
- > orchestrator's alone. **Your tools are for editing source and test files and for running the
128
- > tests you wrote — nothing else.** Do NOT install dependencies, touch a lockfile, run a package
129
- > manager, or tidy up stray files; if something in the repo state blocks you, stop and report it as
130
- > `RESULT: BLOCKED <reason>` instead of fixing it. Do NOT `git add`/`commit`/`push` — leave every
131
- > change uncommitted in the working tree for the orchestrator's independent review. WRITE the
132
- > tests the `Required tests` section calls for AND **RUN the tests you just wrote** to confirm
133
- > they execute and pass — that is the ONLY test run you do (NOT the app's affected/full suite, NOT
134
- > any review). The orchestrator re-runs the authoritative set + does the independent review after
135
- > you finish — those are the gate; your own run does not count as the gate.
136
- >
137
- > Narrate continuously: a `PLAN: <step1> | <step2> | …` line up front, then a single-line
138
- > `PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `… done` on
139
- > completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final
140
- > `RESULT: DONE|BLOCKED <reason>`.
141
-
142
- ---
143
-
144
- # C. Orchestrator only — NOT ADDRESSED TO THE IMPLEMENTER
145
-
146
- > **If you are the implementer reading this work order as your own specification: STOP at this
147
- > line. Everything below describes what the Orchestrator does AFTER you finish. You do none of it
148
- > — no reviewers, no verification run, no register edit, no commit.** You ARE the invocation
149
- > described below; do NOT shell out to `codex exec`.
150
-
151
- ## Execution directive
152
-
153
- Implement through `codex exec` in the background, invoked directly via Bash with both mandatory
154
- flags. Fallback to direct Claude implementation only on Codex quota/rate-limit/non-zero exit
155
- (flips authorship — independent reviewer becomes mandatory, already mandatory at Tier 3). Codex
156
- confirmed available today (two successful dispatches already this session, `KIRA-TRACK-3`/
157
- `AUTH-7`) — no fresh probe needed.
158
-
159
- ## Review routing
160
-
161
- Tier 3, full set, all concurrent in one background batch: `reviewer` (all 4 lenses — `regression`
162
- matters most here given 39 call sites; `envelope` needs Part A inline), `ui_reviewer` (this is
163
- specifically an i18n/error-rendering correctness fix — narrow context: the diff + confirmation that
164
- every `defaultCode` used across `authApi.jsx`/`authService.js` is actually a translated key in all
165
- shipped locales), `sec_reviewer` (confirm `.message`/`.raw` still expose no more than before — this
166
- diff should REDUCE not increase what reaches the UI, since `'GENERIC'` is replaced by `null`).
167
- Orchestrator's own targeted pass runs alongside.
168
-
169
- ## Verification
170
-
171
- Authoritative test run: `npx vitest run tests/authErrors.test.js tests/authErrorCodeRendering.test.jsx
172
- tests/authApiLogin.test.js tests/authApiRegistration.test.js` (affected area — everything touching
173
- `auth-errors.js` and its consumers). No prototype artifact, no rendered side-by-side (no markup
174
- changed).
175
-
176
- ## Register + commit
177
-
178
- Bump `package.json`'s `version` — **MINOR**, not PATCH, per the Envelope's tier note (observable
179
- behavior change for existing `{detail}`-shaped-error callers, not purely additive) — from whatever
180
- `AUTH-7` landed at, to the next `3.x.0`. `CHANGELOG.md` entry MUST explicitly warn: existing
181
- consumers who upgrade will see a DIFFERENT (correct, translated) message wherever they previously
182
- saw the raw string `"GENERIC"` for a `{detail}`-shaped backend error — re-check that UI surface
183
- after bumping the pin, don't assume silent compatibility the way `AUTH-7`'s bump was. Commit on
184
- `main`. `WORK_ORDERS.md` row for `AUTH-8` → `done`, named review verdict, landing SHA.
@@ -1,285 +0,0 @@
1
- # CHART-1 — Shared chart kit: themed `ChartFrame` + MUI X-Charts Bar/Line presets
2
-
3
- - **Repo:** `ui-core-micha` (`@micha.bigler/ui-core-micha`), branch `main` (library, publish-from-main; no `develop`)
4
- - **Tier:** 2 (new shared-library public API + a dependency change + governance-anchored contract)
5
- - **Status:** done (f1b3614)
6
- - **Workstream:** `CHART-*` (chart / data-viz kit)
7
-
8
- > This file has two halves. **Part A (Envelope)** below is authored by the Expertenchat and is the
9
- > authoritative WHAT/WHY — changing it is a scope change that returns to the operator. **Part B
10
- > (Implementation map)** is filled by the Orchestrator on `git pull` from repo knowledge, refined
11
- > against the landed code, without altering Part A.
12
-
13
- ---
14
-
15
- ## Part A — Envelope (authoritative WHAT/WHY)
16
-
17
- ### Goal (Ziel)
18
-
19
- Build the **shared chart kit** that this stack's governance already references as a not-yet-existing
20
- dependency (`.codex/skills/frontend-engineering/SKILL.md` §"Charts / data-viz": *"use the shared
21
- chart kit (a themed `ChartFrame` + MUI X-Charts primitives) once it exists"*; `ui_reviewer`
22
- checklist mirrors it). Today every hram Results/Research panel re-implements the same
23
- `Paper + title + toolbar + loading/error/empty + fixed-height box + export buttons` scaffolding
24
- (~20 panels, ~200 lines of boilerplate each), and there is no reusable frame. This WO delivers the
25
- reusable estate-wide primitives so charts stop being the recurring quality trap.
26
-
27
- ### Expected outcome
28
-
29
- A new additive, barrel-exported (`src/index.js`) chart module in `ui-core-micha`, published as an
30
- additive **minor** version bump (`2.12.0 → 2.15.0`, publish-from-main per the dcm/ucm publish
31
- topology), providing exactly:
32
-
33
- 1. **`ChartFrame` — the chart-type-agnostic scaffolding.** This is the primary value; it wraps *any*
34
- chart body via `children` (an MUI X-Charts primitive **or** a bespoke raw-`<svg>` body), so it
35
- serves all ~20 hram panels including the SVG specialists. It owns:
36
- - a `Paper` container (default `variant="outlined"`, matching hram's Research panels),
37
- - `title` (required) + optional `subtitle`,
38
- - a `toolbar` slot (`ReactNode`, rendered in the header row — for the panels' `ToggleButtonGroup`/
39
- selectors),
40
- - mutually-exclusive state rendering with precedence **loading → error → empty → children**:
41
- `loading` (spinner), `error` (`Alert severity="error"`), `isEmpty` + `emptyMessage`
42
- (`Alert severity="info"`),
43
- - a **responsive, container-sized** chart area (governance: *"container-sized, not fixed px"*),
44
- with an optional `minHeight`/`aspect` fallback so migrated panels don't reflow unexpectedly,
45
- - optional **Export SVG / Export PNG** controls in the footer (consolidating the per-panel export
46
- hram already hand-rolls), shown only when export is enabled, operating on the rendered chart
47
- container,
48
- - basic **a11y** (frame `title`/`aria-label`, `role="img"` or equivalent on the chart region).
49
- All of ChartFrame's own user-facing strings (empty/error defaults, export button labels) go
50
- through `react-i18next` — no hardcoded copy.
51
-
52
- 2. **`BarChart` preset** — a thin wrapper over MUI X-Charts `BarChart` that bakes in the governance
53
- chart contract so callers cannot forget it: **axis labels on both axes (with units)** required via
54
- props, **legend auto-shown only when >1 series**, **tooltip on**, **theme-token colours** (accepts
55
- a caller palette / per-series colours, defaults to the kit's neutral palette — never hardcoded
56
- hex), **responsive container**. Must cover the variants hram actually uses: single-series, grouped
57
- (multi-metric), and stacked (incl. the dual-axis case in `GenericAnalysisPlot`).
58
-
59
- 3. **`LineChart` preset** — same contract, for multi-series time-series (covers
60
- `ResultsTimelinePanel` / `ExpertTimelinePanel`).
61
-
62
- 4. **Neutral palette + locale-aware formatter helpers** — a theme-aware (light **and** dark)
63
- categorical + sequential palette and number formatters (percentage, compact, ratio) that the
64
- presets default to and that apps may pass through. The kit provides the **neutral default and the
65
- pass-through seam only**; domain palettes and domain labels stay in the consuming app (see
66
- non-goals).
67
-
68
- **Acceptance = the `ui_reviewer` chart checklist is satisfiable by construction:** any chart built
69
- with the presets has axis labels (both axes), a legend when multi-series, a tooltip, theme-token
70
- colours, container-sized responsiveness, i18n-able labels, and empty/loading states + basic a11y
71
- from the frame.
72
-
73
- ### Scope
74
-
75
- - New chart module (e.g. `src/components/charts/`), exported from `src/index.js` (additive only).
76
- - `ChartFrame`, `BarChart`, `LineChart`, and the neutral palette/formatter helpers.
77
- - Add `@mui/x-charts` as a **`peerDependency`** (see Precondition — this is the one approval-gated
78
- item). Peer, not a direct dep, so the consuming app owns the version and there is no double-bundle;
79
- hram already depends on `@mui/x-charts` and satisfies the peer.
80
- - Kit-owned strings wired through the existing ucm `react-i18next` setup (`src/i18n`).
81
- - Additive minor version bump + publish (`2.15.0`).
82
-
83
- ### Non-goals / do-not-touch (explicit)
84
-
85
- - **No SVG chart primitives in v1.** No generic scatter/bubble, tornado, heatmap, confidence-interval,
86
- or Pareto-frontier component. hram's bespoke SVG panels keep their own `<svg>` **body**, rendered
87
- **inside `ChartFrame`** (so they gain the shared frame + export). This is a **deliberately surfaced
88
- partial state**, not a silent half-solution: retiring the raw SVG by lifting these into MUI
89
- X-Charts / kit primitives is a tracked future **CHART-2**, gated separately. (Governance's
90
- "extend the kit, don't hand-roll" is the direction; v1 intentionally does not yet cover these.)
91
- - **No geo/maps** — `react-leaflet` stays app-side.
92
- - **No tables** — MUI `Table` stays app-side.
93
- - **No domain palettes or domain labels** — hram's `dataViz` palette (coverage/dalys/cost/…) and its
94
- `Results.*` i18n keys stay in hram; the kit ships only the neutral default + pass-through seam.
95
- - **Do not migrate hram in this WO.** hram adoption (pin bump + panel migration) is a separate
96
- follow-on WO in the `hram` repo, gated on `2.15.0` being published (see Precondition).
97
- - Do not touch auth, CI, or any existing ucm export beyond additively adding the chart exports.
98
-
99
- ### Precondition / execution-gate / ordering
100
-
101
- 1. **Dependency-change approval (blocking):** adding `@mui/x-charts` as a `peerDependency` is a
102
- dependency change → **explicit operator approval required before the Orchestrator adds it**
103
- (AGENTS.md "Require explicit approval before touching: dependency changes").
104
- 2. **Publish before adoption:** the kit lands + publishes as the **next free additive minor**. At
105
- authoring, `2.13.0` (NOTIF-13) and `2.14.0` (NOTIF-12) are already claimed, so the target is
106
- `2.15.0` — but the registry is the source of truth (publish-from-main; the ucm `version_check`
107
- compares against it). The Orchestrator confirms the next free minor against the registry at
108
- publish time and adjusts if the NOTIF workstream has advanced further; then confirms it is live
109
- before any consumer pins it (per the dcm/ucm publish-topology note).
110
- 3. **hram adoption is gated** on `2.15.0` published; its follow-on WO pins `ui-core-micha >= 2.15.0`.
111
-
112
- ### Risks
113
-
114
- - **API-fit risk (primary):** ChartFrame's props must let all ~20 hram panels — including the
115
- SVG-bodied ones — slot in as `children` without escape hatches; if the frame is too opinionated the
116
- migration fights it. Mitigation: frame stays deliberately thin and children-based; the presets, not
117
- the frame, own chart specifics.
118
- - **Responsive vs. fixed height:** governance wants container-sized; hram currently hardcodes
119
- `height: 300`. The frame defaults responsive but must offer a `minHeight`/`aspect` fallback so the
120
- later migration doesn't silently reflow every panel.
121
- - **Export consolidation:** hram hand-rolls per-panel SVG/PNG export. A generic export from a
122
- container ref must handle both an MUI X-Charts body (SVG under the hood) and a raw-`<svg>` body.
123
- **Reuse hram's existing export mechanism / a stdlib-level approach; do NOT add a heavy new
124
- dependency for PNG rendering without separate approval** (that would be another dependency gate).
125
- If a clean generic export can't be done without a new dep, ship the SVG-serialize path and defer
126
- PNG — surface the choice, don't silently drop it.
127
- - **Theme/dark-mode:** the neutral palette must resolve correctly in both light and dark MUI themes.
128
- - **i18n:** no hardcoded user-facing strings in the kit; all through ucm's `react-i18next`.
129
-
130
- ### Required tests to WRITE (narrow — component-level, scoped to this change)
131
-
132
- Written as part of implementation (the implementer writes the test code); **run only by the
133
- Orchestrator**. Use ucm's existing frontend test setup (Vitest + React Testing Library, per prior
134
- ucm WOs). Scoped to the new components — not the ucm full suite.
135
-
136
- - **ChartFrame:** renders `title`/`subtitle`; `loading` shows the spinner and hides children;
137
- `error` shows an error Alert; `isEmpty` shows `emptyMessage`; **state precedence
138
- loading → error → empty → children** holds; the `toolbar` slot renders; export controls appear
139
- only when export is enabled and invoke the handler / produce output; a11y `title`/`aria`/role
140
- present on the chart region.
141
- - **BarChart preset:** axis labels render on **both** axes; **legend appears only when >1 series**;
142
- tooltip is enabled; colours come from theme tokens / passed palette (assert **no hardcoded hex**);
143
- container is responsive (not a fixed px width); single, grouped, and stacked variants each render.
144
- - **LineChart preset:** multi-series renders; both-axis labels; legend when multi-series; tooltip on.
145
- - **Palette + formatters:** neutral palette resolves in both light and dark theme; number formatters
146
- are locale-aware (percentage + compact) across at least two locales.
147
- - **i18n:** the kit's own strings resolve via i18n, not hardcoded (missing-key / alternate-locale
148
- check).
149
-
150
- (Do **not** run the ucm full suite for this WO — that is the promotion gate's job. Run only the new
151
- components' scoped tests, once, as the per-WO gate, alongside the single independent review on the
152
- full assembled diff.)
153
-
154
- ---
155
-
156
- ## Part B — Implementation map (filled by the Orchestrator on `git pull`)
157
-
158
- **Dependency approval:** operator explicitly approved adding `@mui/x-charts` as a `peerDependency`
159
- (2026-07-30, in-chat). Cleared to proceed.
160
-
161
- **Target version:** current `package.json` `version` is `2.14.0` (NOTIF-12 already published) →
162
- next free additive minor is **`2.15.0`**, matching the Envelope's target. Confirm still free against
163
- the npm registry immediately before publish.
164
-
165
- ### Named files to change
166
-
167
- - `src/components/charts/ChartFrame.jsx` — new. Frame component (Paper/title/toolbar/state
168
- precedence/export/a11y).
169
- - `src/components/charts/BarChart.jsx` — new. Preset over `@mui/x-charts` `BarChart`.
170
- - `src/components/charts/LineChart.jsx` — new. Preset over `@mui/x-charts` `LineChart`.
171
- - `src/components/charts/palette.js` — new. Neutral theme-aware categorical + sequential palette,
172
- resolved from the active MUI theme (light/dark), NOT hardcoded hex in consumer-visible API.
173
- - `src/components/charts/formatters.js` — new. Locale-aware number formatters (percentage, compact,
174
- ratio) built on `Intl.NumberFormat`, driven off `i18next.language`.
175
- - `src/components/charts/exportChart.js` — new. Generic SVG/PNG export util operating on a container
176
- `ref`, mirroring hram's `XMLSerializer` → `Blob` → (PNG: `canvas` 2x-scale) → anchor-download
177
- pattern (see hram `AllocationPerformancePanel.jsx` `handleExportSvg`/`handleExportPng`, no new
178
- dependency).
179
- - `src/index.js` — add barrel exports for `ChartFrame`, `BarChart`, `LineChart`, palette/formatter
180
- helpers, additive only, alongside the existing "Components" export block (~lines 1-72).
181
- - `src/i18n/chartsTranslations.ts` — new namespace, mirrors the existing
182
- `notificationsTranslations.ts` shape (`{ 'ChartFrame.KEY': { de, fr, en, sw } }`); register it
183
- wherever `notificationsTranslations`/`onboardingTranslations` are aggregated into the i18n bundle.
184
- - `package.json` — add `"@mui/x-charts": "^8.0.0"` (or the loosest range compatible with hram's
185
- pinned `8.28.2`) to `peerDependencies`; bump `"version"` to `2.15.0` (confirm free at publish time
186
- per above); add `@mui/x-charts` to `devDependencies` too (peer deps aren't auto-installed, tests
187
- need it present).
188
- - `tests/ChartFrame.test.jsx`, `tests/BarChart.test.jsx`, `tests/LineChart.test.jsx`,
189
- `tests/chartsPalette.test.js` (or similar) — new, in the existing `/tests/` root dir (not
190
- co-located), `@vitest-environment jsdom` pragma, Vitest + RTL per `tests/NotificationSettings.test.jsx`
191
- conventions.
192
-
193
- ### Architecture/contract slice
194
-
195
- - **Component style:** plain `.jsx` (no TypeScript, no PropTypes — JSDoc only), MUI `sx` prop for
196
- styling, functional components with hooks. Mirror `src/components/ProfileComponent.jsx`.
197
- - **i18n:** `useTranslation()` from `react-i18next`; keys namespaced `Category.KEY_NAME` (e.g.
198
- `ChartFrame.EXPORT_SVG_LABEL`, `ChartFrame.EMPTY_DEFAULT`). Translation objects are flat
199
- `{ key: { de, fr, en, sw } }` dictionaries per `src/i18n/notificationsTranslations.ts` — follow
200
- that exact shape for `chartsTranslations.ts`, all four locales required.
201
- - **Barrel export:** `src/index.js` groups exports by category with comment headers (Auth Context,
202
- API/Services, Layouts, Pages, Components, Translations, Notifications, Onboarding) — add a
203
- `// Charts` section, export components + `chartsTranslations` alongside the others.
204
- - **Theme:** no centralized theme file exists in ucm today (components rely on the MUI default
205
- theme via `sx` and `useTheme()`). The palette module must read `theme.palette.mode` via
206
- `useTheme()` to select light/dark variants — do not assume a specific app theme shape beyond
207
- standard MUI.
208
- - **Peer deps:** current `peerDependencies` list (`@mui/material ^7.3.11`, `react ^19.2.6`, etc.) —
209
- add `@mui/x-charts` alongside, do not touch existing entries.
210
- - **hram reference (adoption target, NOT touched in this WO):** `hram/frontend/src/components/
211
- OutputComponents/Results/ResultsTimelinePanel.jsx` and `ExpertTimelinePanel.jsx` show the
212
- Paper→Typography(h6)→toolbar(ToggleButtonGroup)→loading/error/empty(Alert)→chart→footer skeleton
213
- ChartFrame must replicate structurally; `AllocationPerformancePanel.jsx` (~lines 198-238) has the
214
- reference export functions; `hram/frontend/src/.../theme.js` `dataViz` palette (~lines 20-30) is
215
- the domain palette that stays app-side — the kit's neutral palette is a separate, generic
216
- categorical/sequential set, not a copy of `dataViz`.
217
-
218
- ### Key snippets (for the implementer to mirror, not copy verbatim)
219
-
220
- hram's existing Paper/title/toolbar/state scaffolding (`ResultsTimelinePanel.jsx`/
221
- `ExpertTimelinePanel.jsx`):
222
- ```jsx
223
- <Paper variant="outlined" sx={{ p: 2 }}>
224
- <Box sx={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}>
225
- <Typography variant="h6">{t("...")}</Typography>
226
- <ToggleButtonGroup exclusive size="small" ...>...</ToggleButtonGroup>
227
- </Box>
228
- {loading && <CircularProgress />}
229
- {error && <Alert severity="error">...</Alert>}
230
- {isEmpty && <Alert severity="info">...</Alert>}
231
- {!loading && !error && !isEmpty && children}
232
- </Paper>
233
- ```
234
- hram's export pattern (`AllocationPerformancePanel.jsx`): `XMLSerializer().serializeToString(svgRef.current)`
235
- → `Blob(['image/svg+xml'])` → anchor download for SVG; for PNG, load the SVG blob into an `Image`,
236
- draw to a 2x-scaled `<canvas>` with a white background fill, then `canvas.toBlob()` → anchor download.
237
- `exportChart.js` should generalize this to accept a container ref (find the first `<svg>` descendant)
238
- so it works for both an MUI X-Charts body and a raw-`<svg>` body.
239
-
240
- ### Invariants / do-not-touch / pitfalls
241
-
242
- - Additive exports only — do not modify or remove any existing `src/index.js` export line.
243
- - `@mui/x-charts` is a **peerDependency**, never a direct `dependency` (hram supplies its own
244
- installed copy; ucm must not double-bundle it).
245
- - No hardcoded hex/palette values in the public API surface — palette resolves from
246
- `useTheme().palette.mode`; tests must assert this (e.g. render under both a light and dark MUI
247
- theme, assert different resolved values).
248
- - Container-sized/responsive by default — do not hardcode chart pixel width; offer `minHeight`/
249
- `aspect` as an opt-in fallback only.
250
- - Every user-facing string in the kit goes through `t('ChartFrame....')` — no literal English
251
- strings in JSX.
252
- - Do not touch hram, `dataViz`, or any hram i18n keys — this WO is ucm-only.
253
- - State precedence is strict: `loading` beats `error` beats `isEmpty` beats `children` — write the
254
- test asserting this order, not just each state individually.
255
- - No new heavy dependency for PNG export (e.g. no `html2canvas`/`dom-to-image`) — reuse the
256
- serialize+canvas approach; if a clean generic path is not achievable without a new dep, ship
257
- SVG-export only and explicitly note PNG deferred in the `RESULT:` — do not silently drop it.
258
-
259
- ### Progress contract
260
-
261
- Codex must emit: one `PLAN: <step1> | <step2> | …` line up front; a single-line
262
- `PROGRESS: [<n>/<total>] <present-tense action>` before every file/edit/step and `… done` on
263
- completion, spaced so no gap exceeds ~2 min; exactly one final `RESULT: DONE|BLOCKED <reason>`.
264
- stdout unbuffered.
265
-
266
- ### Execution directive
267
-
268
- Implement through `codex exec` in the background, invoked **directly via Bash** (never the
269
- `debugger`/`*_coder` Agent wrappers), with **both** `--skip-git-repo-check` and
270
- `--dangerously-bypass-approvals-and-sandbox`, prompt passed as a positional argument read from this
271
- committed file (`"$(cat work-orders/CHART-1.md)"`). cwd = `ui-core-micha` repo root (this repo),
272
- **never** the workspace root `…/webapps`. Fall back to direct Claude implementation only on Codex
273
- quota/rate-limit/non-zero exit. Codex WRITES the required tests but MUST NOT RUN them and MUST NOT
274
- run any review or `git add`/`commit`/`push` — leave the working tree uncommitted for the
275
- Orchestrator's independent review, which runs after Codex finishes.
276
-
277
- ---
278
-
279
- ## Pastable mini-handover (for the fresh Orchestrator session)
280
-
281
- > Orchestrator: implement `work-orders/CHART-1.md` in `ui-core-micha` (branch `main`). `git pull`
282
- > first, read the WO, then follow the `orchestrate-codex` skill (Codex-first, fill Part B, run your
283
- > own independent review + scoped tests, commit on green). NOTE the blocking precondition: adding
284
- > `@mui/x-charts` as a `peerDependency` is a dependency change needing explicit operator approval
285
- > before it is added.