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

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 (77) hide show
  1. package/.github/workflows/ci.yml +35 -0
  2. package/.github/workflows/publish.yml +4 -4
  3. package/CHANGELOG.md +35 -0
  4. package/WORK_ORDERS.md +7 -1
  5. package/dist/auth/UserMenu.js +1 -1
  6. package/dist/auth/apiClient.js +7 -6
  7. package/dist/chat/ChatComposer.js +23 -0
  8. package/dist/chat/ChatList.js +30 -0
  9. package/dist/chat/ChatThread.js +70 -0
  10. package/dist/chat/ChatWorkspace.js +218 -0
  11. package/dist/chat/MarkdownReply.js +21 -0
  12. package/dist/chat/ModelPicker.js +35 -0
  13. package/dist/chat/api.js +17 -0
  14. package/dist/chat/useChatSocket.js +68 -0
  15. package/dist/chat/wire.js +7 -0
  16. package/dist/components/LoginForm.js +1 -1
  17. package/dist/components/SecurityComponent.js +1 -1
  18. package/dist/components/UserListComponent.js +2 -8
  19. package/dist/components/charts/ChartFrame.js +1 -1
  20. package/dist/components/charts/ScatterChart.js +2 -1
  21. package/dist/i18n/chatTranslations.js +55 -0
  22. package/dist/i18n/uiCoreTranslations.js +2 -1
  23. package/dist/index.js +10 -0
  24. package/dist/layout/SectionNav.js +1 -1
  25. package/dist/messaging/AttachmentList.js +2 -2
  26. package/dist/messaging/Composer.js +2 -1
  27. package/dist/messaging/ConversationLaunchers.js +1 -4
  28. package/dist/messaging/ConversationList.js +1 -1
  29. package/dist/messaging/DirectMessageLauncher.js +1 -1
  30. package/dist/messaging/MessagingProvider.js +0 -0
  31. package/dist/messaging/PollCard.js +7 -5
  32. package/dist/messaging/ReadTicks.js +2 -2
  33. package/dist/messaging/Thread.js +5 -3
  34. package/dist/notifications/NotificationBell.js +4 -7
  35. package/dist/notifications/NotificationSettings.js +1 -1
  36. package/dist/onboarding/OnboardingProvider.js +3 -6
  37. package/dist/pages/LoginPage.js +1 -1
  38. package/dist/pages/PasswordChangePage.js +1 -1
  39. package/dist/pages/PasswordInvitePage.js +1 -1
  40. package/dist/pages/PasswordResetRequestPage.js +1 -1
  41. package/dist/pages/SignUpPage.js +1 -1
  42. package/dist/pages/SignupConfirmPage.js +1 -1
  43. package/dist/theme/createAppTheme.js +5 -4
  44. package/dist/theme/kitSxRegistry.js +10 -0
  45. package/dist/theme/themeCompleteness.js +3 -12
  46. package/dist/utils/auth-errors.js +4 -3
  47. package/package.json +13 -11
  48. package/src/chat/ChatComposer.jsx +36 -0
  49. package/src/chat/ChatList.jsx +87 -0
  50. package/src/chat/ChatThread.jsx +128 -0
  51. package/src/chat/ChatWorkspace.jsx +244 -0
  52. package/src/chat/MarkdownReply.jsx +22 -0
  53. package/src/chat/ModelPicker.jsx +85 -0
  54. package/src/chat/api.js +18 -0
  55. package/src/chat/useChatSocket.js +32 -0
  56. package/src/chat/wire.js +7 -0
  57. package/src/i18n/chatTranslations.ts +55 -0
  58. package/src/i18n/uiCoreTranslations.js +2 -0
  59. package/src/index.js +11 -0
  60. package/src/theme/kitSxRegistry.js +10 -0
  61. package/tests/chatApi.test.js +48 -0
  62. package/tests/chatDriverNames.test.jsx +71 -0
  63. package/tests/chatExports.test.js +3 -0
  64. package/tests/chatList.test.jsx +84 -0
  65. package/tests/chatPicker.test.jsx +82 -0
  66. package/tests/chatSocket.test.jsx +26 -0
  67. package/tests/chatThread.test.jsx +116 -0
  68. package/tests/chatTranslations.test.js +47 -0
  69. package/tests/chatWorkspace.test.jsx +234 -0
  70. package/tests/i18nAggregate.test.js +2 -0
  71. package/tsconfig.build.json +1 -1
  72. package/work-orders/UCM-AUTH-13.md +2 -0
  73. package/work-orders/UCM-CHAT-1.md +190 -0
  74. package/work-orders/UCM-CHAT-2.md +75 -0
  75. package/work-orders/UCM-CI-1.md +65 -0
  76. package/work-orders/UCM-DEP-1.md +63 -0
  77. package/work-orders/assets/UCM-CHAT-1-ai-chat.html +447 -0
@@ -0,0 +1,75 @@
1
+ # UCM-CHAT-2 — Readable driver names in the chat model picker
2
+
3
+ Prepared: 2026-10-15. Target repository: `ui-core-micha` (`main`). Correction to `UCM-CHAT-1`, found at acceptance.
4
+
5
+ # A. Envelope — addressed to everyone
6
+
7
+ ## Goal and expected outcome
8
+
9
+ The model picker of the shared chat surface groups its entries by driver. In the UCM-CHAT-1 implementation, each group heading shows the raw driver id the catalogue returns (`claude_cli`, `anthropic_api`, `openai_api`). The prototype `work-orders/assets/UCM-CHAT-1-ai-chat.html` shows readable names instead.
10
+
11
+ Expected outcome: the three drivers that `django-core-micha/DCM-CHAT-1` ships appear under readable, translated names, both in the picker and wherever else ui-core-micha shows a driver. An unknown driver id still appears as its raw id, so a driver added later (`django-core-micha/DCM-CHAT-2`) stays usable before it gets a name.
12
+
13
+ ## Scope
14
+
15
+ - A mapping from the three driver ids to translated names, registered in ui-core-micha's chat translations:
16
+
17
+ | Driver id | en | de | fr | sw |
18
+ |---|---|---|---|---|
19
+ | `claude_cli` | Claude Code subscription | Claude Code (Abo) | Claude Code (abonnement) | Claude Code (usajili) |
20
+ | `anthropic_api` | Anthropic API | Anthropic API | API Anthropic | API ya Anthropic |
21
+ | `openai_api` | OpenAI API | OpenAI API | API OpenAI | API ya OpenAI |
22
+
23
+ - The picker's group heading and the group's accessible name use the translated name.
24
+ - Any other place in the chat surface that shows a driver uses the same name. One example is the model-change divider in the thread.
25
+ - Unknown driver ids fall back to the raw id.
26
+
27
+ ## Copy list (released with this Envelope)
28
+
29
+ The twelve names in the table above, verbatim. No other new text.
30
+
31
+ ## Non-goals
32
+
33
+ - Any change to the catalogue contract or to django-core-micha. The names live in ui-core-micha.
34
+ - Other picker behaviour, layout or styling.
35
+ - The post-landing re-review of UCM-CHAT-1's last fix batch. That is UCM-CHAT-1's own follow-up.
36
+
37
+ ## Tier
38
+
39
+ Tier 3: a change inside shared-core. Small and copy-only in effect.
40
+
41
+ ## Risks
42
+
43
+ - **Id mismatch:** the ids must match exactly what DCM-CHAT-1 returns (`django_core_micha/assistant/catalogue.py`, `DRIVERS`). A mismatch silently falls back to raw ids. The existing picker test fixture uses `openai`, which is not a real driver id.
44
+
45
+ ## Required tests to write
46
+
47
+ - Picker: groups for `claude_cli`, `anthropic_api` and `openai_api` show their translated names as heading and accessible name. Fixtures use the real driver ids.
48
+ - Unknown driver: an entry with an unknown driver id is grouped under its raw id.
49
+ - Translations: the three new keys exist in all four languages.
50
+
51
+ # B. Implementation map — addressed to the implementer
52
+
53
+ ## Context package
54
+
55
+ Tier 3 · tests: picker + translations (see Part A). Work from this package; do not explore broadly. Target working directory: `C:/Users/Micha Bigler/Documents/webapps/ui-core-micha` (never the workspace root).
56
+
57
+ - `src/chat/ModelPicker.jsx` — `groupByDriver` groups `entries` by `entry.driver`; the group is rendered at about line 38 as `<Box key={driver} role="group" aria-label={driver}>` with `<Typography variant="overline">{driver}</Typography>`. Both the accessible name and the heading must show the translated name. `t` comes from `useTranslation()` already in the file.
58
+ - `src/i18n/chatTranslations.ts` — one `chatTranslations` const, entries `'Chat.xxx': { de, en, fr, sw }`. Add exactly three keys, flat like the existing `Chat.effort.low`: `Chat.driver.claude_cli`, `Chat.driver.anthropic_api`, `Chat.driver.openai_api`, with the Envelope's twelve names verbatim (en/de/fr/sw columns). No other new text.
59
+ - A small helper keeps the lookup in one place: export `driverName(t, id)` from `src/chat/ModelPicker.jsx` (or a new `src/chat/driverName.js` if cleaner) returning `t(`Chat.driver.${id}`, { defaultValue: id })`, so an unknown id falls back to the raw id with real i18next. Use it in the picker. The thread's model-change divider (`src/chat/ChatThread.jsx`, `selectionLine`) shows only model and effort, no driver; leave it unchanged. No other place in `src/chat/**` renders a driver id (verify with a search for `driver`).
60
+ - Tests: `tests/chatPicker.test.jsx` mocks `react-i18next` with `t: (key) => key`; make the mock return `values.defaultValue` when the key starts with `Chat.driver.` and a `defaultValue` is given and the id is not one of the three known ids, and the key otherwise, so every other assertion keeps expecting keys. Update the fixture entries to the real ids `claude_cli`, `anthropic_api` (replace the fake `openai`), keep one extra fixture with an unknown id (for example `mystery_driver`). Assert: group role name and heading text for each known driver equal the translation KEY `Chat.driver.<id>` (the mocked t returns keys); the unknown id group is named by the raw id. Also assert with the REAL `chatTranslations` that the three keys exist with the Envelope's exact English names, and that each key is non-empty in de/en/fr/sw (add to `tests/chatTranslations.test.js`). `tests/chatWorkspace.test.jsx` uses `openai`/`claude_cli` ids in its catalogue fixture and finds the group by name `openai`: update that lookup to the new key-based name.
61
+ - Do not edit: `package.json`, lockfile, CHANGELOG, README, `WORK_ORDERS.md`, anything outside `src/chat/**`, `src/i18n/chatTranslations.ts`, `tests/chat*.test.*`. No catalogue contract change.
62
+ - Pitfall: the existing aggregate test `tests/i18nAggregate.test.js` iterates all bundle keys; every value needs all four locales as non-empty strings.
63
+
64
+ ## Preamble
65
+
66
+ > The text above is the COMPLETE spec — the committed WO file's content, not a plan to refine; there is no separate plan file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and the app `MEMORY.md` ONLY for conventions. Stay in scope; do not touch auth/permissions/deps/schema/CI unless the spec says so; do not update `MEMORY.md`. **Do NOT edit `WORK_ORDERS.md` — the register row and the review verdicts are the orchestrator's alone.** **Your tools are for editing source and test files and for running the tests you wrote — nothing else.** Do NOT install dependencies, touch a lockfile, run a package manager, or tidy up stray files; if something in the repo state blocks you, stop and report it as `RESULT: BLOCKED <reason>` instead of fixing it. Do NOT `git add`/`commit`/`push` — leave every change uncommitted in the working tree for the orchestrator's independent review. WRITE the tests the `Required tests` section calls for AND **RUN the tests you just wrote** to confirm they execute and pass — that is the ONLY test run you do (NOT the app's affected/full suite, NOT any review). The orchestrator re-runs the authoritative set + does the independent review after you finish — those are the gate; your own run does not count as the gate.
67
+ >
68
+ > Narrate continuously: a `PLAN: <step1> | <step2> | …` line up front, then a single-line `PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `… done` on completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final `RESULT: DONE|BLOCKED <reason>`.
69
+
70
+
71
+ # C. Orchestrator only — not addressed to the implementer
72
+
73
+ > **If this WO was dispatched to you as an implementer: STOP here.**
74
+
75
+ Gate #1 open until recorded in the register row. Publish as a patch release; cockpit/CP-CHAT-4 pins the release that contains it.
@@ -0,0 +1,65 @@
1
+ # UCM-CI-1 — A dispatch-only CI workflow for ui-core-micha
2
+
3
+ Prepared: 2026-10-15. Target repository: `ui-core-micha` (`main`).
4
+
5
+ # A. Envelope — addressed to everyone
6
+
7
+ ## Goal and expected outcome
8
+
9
+ ui-core-micha has one workflow, `publish.yml`, which tests and then publishes on a push to `main`. A change cannot be proven on a candidate ref without publishing, so work such as `UCM-DEP-1` has no safe CI run. This order adds `.github/workflows/ci.yml`: install, build and test on Linux, started only by hand (`workflow_dispatch`), with no publish step and no secrets.
10
+
11
+ Expected outcome: `gh workflow run ci.yml -R <owner>/ui-core-micha --ref ci-test/<ID>` runs the same install, build and test steps as `publish.yml` against that ref, and nothing else.
12
+
13
+ ## Operator decision this Envelope records (2026-10-15)
14
+
15
+ The operator asked for this workflow in session, as the way to verify `UCM-DEP-1`: "Lege für ui-core-micha einen kleinen ci.yml (nur install, build, test, workflow_dispatch) als eigenes Register-Item an und nutze ihn für UCM-DEP-1."
16
+
17
+ ## Scope
18
+
19
+ - One new file `.github/workflows/ci.yml`:
20
+ - trigger: `workflow_dispatch` only;
21
+ - `permissions: contents: read`;
22
+ - one job on `ubuntu-latest` with the steps of `publish.yml` that precede publishing, using the same action versions and the same Node and pnpm versions as `publish.yml`: checkout, setup-node, setup-pnpm, `pnpm install --frozen-lockfile`, `pnpm run build`, `pnpm run test`;
23
+ - no `npm publish`, no `id-token` permission, no secrets, no `registry-url`.
24
+ - A register row and the `CI-*` prefix in `WORK_ORDERS.md` (Orchestrator).
25
+
26
+ ## Non-goals
27
+
28
+ - No change to `publish.yml`, to any test, or to the package.
29
+ - No push or pull-request trigger: the workflow runs only when dispatched.
30
+ - No matrix, cache tuning or extra jobs.
31
+
32
+ ## Tier
33
+
34
+ Tier 3: CI. Small in effect.
35
+
36
+ ## Risks
37
+
38
+ - A `workflow_dispatch` workflow must exist on the default branch before it can be dispatched at a ref; it lands on `main` first and is then used from `ci-test/<ID>` refs.
39
+ - The Node and pnpm pins duplicate those of `publish.yml`; `UCM-DEP-1` bumps both.
40
+
41
+ ## Required tests to write
42
+
43
+ None: the evidence is one dispatched run of the new workflow on a `ci-test/UCM-CI-1` ref.
44
+
45
+ # B. Implementation map — addressed to the implementer
46
+
47
+ ## Context package
48
+
49
+ Work from this package; do not explore broadly. Target working directory: `C:/Users/Micha Bigler/Documents/webapps/ui-core-micha`.
50
+
51
+ - Read `.github/workflows/publish.yml` once. Copy, verbatim, the `uses:` pins and versions of its checkout, setup-node (`node-version`) and pnpm/action-setup (`version`) steps. Do not copy the version-check script, the `if:` conditions, the npm update or the publish step.
52
+ - Create `.github/workflows/ci.yml`: `name: CI`; `on: workflow_dispatch`; top-level `permissions: contents: read`; one job `test` on `ubuntu-latest` with steps: Check out code, Set up Node, Set up pnpm, Install dependencies (`pnpm install --frozen-lockfile`), Build (`pnpm run build`), Run tests (`pnpm run test`). Same indentation and step-name style as `publish.yml`.
53
+ - Do not edit anything else.
54
+
55
+ ## Preamble
56
+
57
+ > The text above is the COMPLETE spec — the committed WO file's content, not a plan to refine; there is no separate plan file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and the app `MEMORY.md` ONLY for conventions. Stay in scope; do not touch auth/permissions/deps/schema/CI unless the spec says so; do not update `MEMORY.md`. **Do NOT edit `WORK_ORDERS.md` — the register row and the review verdicts are the orchestrator's alone.** **Your tools are for editing source and test files and for running the tests you wrote — nothing else.** Do NOT install dependencies, touch a lockfile, run a package manager, or tidy up stray files; if something in the repo state blocks you, stop and report it as `RESULT: BLOCKED <reason>` instead of fixing it. Do NOT `git add`/`commit`/`push` — leave every change uncommitted in the working tree for the orchestrator's independent review. This order needs no tests; run none. The orchestrator does the independent review and the dispatched run after you finish.
58
+ >
59
+ > Narrate continuously: a `PLAN: <step1> | <step2> | …` line up front, then a single-line `PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `… done` on completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final `RESULT: DONE|BLOCKED <reason>`.
60
+
61
+ # C. Orchestrator only — not addressed to the implementer
62
+
63
+ > **If this WO was dispatched to you as an implementer: STOP here.**
64
+
65
+ Gate #1: the operator's instruction of 2026-10-15 in the UCM-CHAT-1/2 Orchestrator session (quoted in Part A). Review lenses per Tier 3 for a workflow file (envelope, regression, duplication, tests do not apply: no tests; sec_reviewer on the permissions block). Evidence: a dispatched run on `ci-test/UCM-CI-1` after the file is on `main`.
@@ -0,0 +1,63 @@
1
+ # UCM-DEP-1 — All open Renovate updates in one change on main, one CI run
2
+
3
+ Prepared: 2026-10-15. Target repository: `ui-core-micha` (`main`).
4
+
5
+ # A. Envelope — addressed to everyone
6
+
7
+ ## Goal and expected outcome
8
+
9
+ ui-core-micha's eight open Renovate PRs land as one change on `main`, verified by one CI run. A release follows only if a runtime dependency changed; tooling-only updates need none.
10
+
11
+ ## Tier
12
+
13
+ Tier 3: dependency changes, majors included.
14
+
15
+ ## Operator decisions this Envelope records (2026-10-15)
16
+
17
+ 1. The bundle contains these open Renovate PRs' updates, in one change on `main`:
18
+
19
+ | PR | Update |
20
+ |---|---|
21
+ | #17 | npm non-major |
22
+ | #18 | github-actions |
23
+ | #19 | actions/checkout v7 |
24
+ | #20 | actions/setup-node v7 |
25
+ | #21 | jsdom v30 (test) |
26
+ | #22 | pnpm v12 |
27
+ | #23 | typescript v7 |
28
+ | #24 | vitest v5 (test) |
29
+
30
+ 2. A major that needs more than small adaptations (configuration, a renamed import, a test helper) is taken out of the bundle, left as its PR, and reported with the reason. The bundle does not grow into a migration.
31
+ 3. Verification is one CI run of the repository's own CI on the candidate (for an app: a `ci-test/<ID>` ref with the full job set). A red job is fixed within decision 2 and the run repeated; not more than that.
32
+ 4. After the push Renovate closes the PRs whose update landed; a PR it rebases instead is an update that did not land and is reported.
33
+
34
+ ## Scope
35
+
36
+ 1. Dependency manifests and lockfiles, workflow `uses:` pins, image pins the updates touch.
37
+ 2. The small adaptations decision 2 allows, with tests where behaviour is touched.
38
+ 3. Each update's changelog read for breaking changes before it goes in; a breaking change the code meets is adapted (decision 2) or the update is taken out.
39
+ 4. A release per the repository's own publish procedure only when the published package's runtime dependencies changed.
40
+
41
+ ## Non-goals
42
+
43
+ - No new features, no refactoring beyond decision 2.
44
+ - No change to the Renovate configuration.
45
+ - No pin bump in any consuming app.
46
+
47
+ ## Risks
48
+
49
+ - pnpm 12 and TypeScript 7 change the build toolchain; the published bundle must stay byte-compatible in its exports. The CI's build and the kit's own tests are the check.
50
+
51
+ ## Required tests to write
52
+
53
+ None beyond the adaptations of decision 2. The evidence is the CI run of decision 3.
54
+
55
+ # B. Implementation map — addressed to the implementer
56
+
57
+ *To be filled by the Orchestrator.*
58
+
59
+ # C. Orchestrator only — not addressed to the implementer
60
+
61
+ > **If this WO was dispatched to you as an implementer: STOP here.**
62
+
63
+ Gate #1 open until recorded in the register row. Part of the PR close-out round of 2026-10-15; stagger the CI run with the other bundles of that round (one heavy run at a time on the shared runner). On 2026-10-15 the working tree carried another session's uncommitted changes to `package.json` and `pnpm-lock.yaml` (likely the dcm/ucm chat migration): the same files this bundle changes. Sequence with that session before starting; never fold its changes into this commit.