@micha.bigler/ui-core-micha 3.10.0 → 3.11.0
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.
- package/CHANGELOG.md +6 -0
- package/DESIGN.md +11 -0
- package/WORK_ORDERS.md +4 -2
- package/dev/main.jsx +3 -3
- package/dist/theme/createAppTheme.js +123 -20
- package/dist/theme/themeCompleteness.js +13 -7
- package/dist/theme/tokens.js +42 -0
- package/docs/DARK-TOKENS.md +140 -0
- package/package.json +1 -1
- package/src/theme/createAppTheme.js +139 -12
- package/src/theme/themeCompleteness.js +10 -4
- package/src/theme/tokens.js +72 -0
- package/tests/createAppThemeDark.test.js +127 -0
- package/tests/createAppThemeLightGuard.test.js +40 -0
- package/tests/fixtures/light-theme-baseline.json +2228 -0
- package/work-orders/UCM-I18N-5.md +80 -0
- package/work-orders/UCM-THEME-14.md +178 -8
- package/work-orders/assets/UCM-THEME-13-dark-prototype.html +390 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# UCM-I18N-5 — User-list pagination range text is hard-coded English
|
|
2
|
+
|
|
3
|
+
# A. Envelope — authored by the Expertenchat
|
|
4
|
+
|
|
5
|
+
## Goal & expected outcome
|
|
6
|
+
|
|
7
|
+
- Goal: the user list's pagination reads in the user's language.
|
|
8
|
+
- Expected outcome: `UserListComponent`'s `TablePagination` renders its "1–4 of 4" text through a
|
|
9
|
+
translation key (de/en/fr and every locale the bundles carry), the way `labelRowsPerPage`
|
|
10
|
+
already does.
|
|
11
|
+
|
|
12
|
+
## Context — measured 2026-10-01 in jg-ferien's local browser (ucm 3.7.0 installed there)
|
|
13
|
+
|
|
14
|
+
- `/account?tab=users` in German: "Zeilen pro Seite: 25 ▾ · **1–4 of 4**". `UserListComponent.jsx`
|
|
15
|
+
(~l.589-600) sets `labelRowsPerPage={t('UserList.ROWS_PER_PAGE', …)}` but no
|
|
16
|
+
`labelDisplayedRows`, so MUI's English default renders. It is the only `TablePagination` in ucm.
|
|
17
|
+
- Follows `UCM-I18N-4` (hard-coded English in the user list).
|
|
18
|
+
|
|
19
|
+
## Scope + non-goals
|
|
20
|
+
|
|
21
|
+
- In scope: `labelDisplayedRows` via a key with count interpolation; tests; release.
|
|
22
|
+
- Explicit non-goals / do-not-touch: no other change to the user list.
|
|
23
|
+
|
|
24
|
+
## Tier · gates
|
|
25
|
+
|
|
26
|
+
- **Tier 3** — change inside shared-core (small).
|
|
27
|
+
- Done means released AND jg-ferien's pin bumped.
|
|
28
|
+
|
|
29
|
+
## Risks
|
|
30
|
+
|
|
31
|
+
- The "more than" form (`count === -1`) must have a wording too, or it renders "of -1".
|
|
32
|
+
|
|
33
|
+
## Required tests to WRITE (you write them and run YOUR OWN new ones; the orchestrator's run is the gate)
|
|
34
|
+
|
|
35
|
+
1. In `de`, the pagination shows the German range text; in `en` the English one.
|
|
36
|
+
2. Key-parity: every locale bundle has the new key.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
# B. Implementation map — filled by the Orchestrator — ADDRESSED TO THE IMPLEMENTER
|
|
41
|
+
|
|
42
|
+
*(placeholder — no context package yet, no progress contract yet; the Orchestrator fills this
|
|
43
|
+
part on `git pull` and appends the preamble below to the invocation. Do not dispatch on this
|
|
44
|
+
placeholder.)*
|
|
45
|
+
|
|
46
|
+
## Target repo working directory (absolute)
|
|
47
|
+
|
|
48
|
+
`C:\Users\biglmi\Documents\webapps\ui-core-micha` (branch `main`)
|
|
49
|
+
|
|
50
|
+
## Preamble — a REQUIRED block IN this file, not something appended at invocation
|
|
51
|
+
|
|
52
|
+
> The text above is the COMPLETE spec — the committed WO file's content, not a plan to refine; there
|
|
53
|
+
> is no separate plan file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and the
|
|
54
|
+
> app `MEMORY.md` ONLY for conventions. Stay in scope; do not touch auth/permissions/deps/schema/CI
|
|
55
|
+
> unless the spec says so; do not update `MEMORY.md`. **Do NOT edit `WORK_ORDERS.md` — the register
|
|
56
|
+
> row and the review verdicts are the orchestrator's alone.** **Your tools are for editing source
|
|
57
|
+
> and test files and for running the tests you wrote — nothing else.** Do NOT install dependencies,
|
|
58
|
+
> touch a lockfile, run a package manager, or tidy up stray files; if something in the repo state
|
|
59
|
+
> blocks you, stop and report it as `RESULT: BLOCKED <reason>` instead of fixing it. Do NOT
|
|
60
|
+
> `git add`/`commit`/`push` — leave every
|
|
61
|
+
> change uncommitted in the working tree for the orchestrator's independent review. WRITE the tests
|
|
62
|
+
> the `Required tests` section calls for AND **RUN the tests you just wrote** to confirm they execute
|
|
63
|
+
> and pass — that is the ONLY test run you do (NOT the app's affected/full suite, NOT any review).
|
|
64
|
+
> The orchestrator re-runs the authoritative set + does the independent review after you finish —
|
|
65
|
+
> those are the gate; your own run does not count as the gate.
|
|
66
|
+
>
|
|
67
|
+
> Narrate continuously: a `PLAN: <step1> | <step2> | …` line up front, then a single-line
|
|
68
|
+
> `PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `… done` on
|
|
69
|
+
> completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final
|
|
70
|
+
> `RESULT: DONE|BLOCKED <reason>`.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
# C. Orchestrator only — NOT ADDRESSED TO THE IMPLEMENTER
|
|
75
|
+
|
|
76
|
+
> **If you are the implementer reading this work order as your own specification: STOP at this line.
|
|
77
|
+
> Everything below describes what the Orchestrator does AFTER you finish. You do none of it — no
|
|
78
|
+
> reviewers, no verification run, no register edit, no commit.**
|
|
79
|
+
|
|
80
|
+
*(to be filled by the Orchestrator: execution directive; `reviewer` (all lenses) + `ui_reviewer`; release; jg-ferien pin bump; register rows here and in jg.)*
|
|
@@ -14,9 +14,38 @@ both of its themes through the factory.
|
|
|
14
14
|
|
|
15
15
|
## Value source
|
|
16
16
|
|
|
17
|
-
**`docs/DARK-TOKENS.md`, frozen by the operator in `UCM-THEME-13
|
|
18
|
-
from that sheet. A value the implementation needs that the sheet does not carry is a
|
|
19
|
-
Do not improvise it.
|
|
17
|
+
**`docs/DARK-TOKENS.md`, frozen by the operator in `UCM-THEME-13` (2026-10-02, `7330f91`).** Every dark
|
|
18
|
+
value in code comes from that sheet. A value the implementation needs that the sheet does not carry is a
|
|
19
|
+
stop-and-report. Do not improvise it.
|
|
20
|
+
|
|
21
|
+
## Decided rules (operator, 2026-10-01 and 2026-10-02; amended into this order 2026-10-02)
|
|
22
|
+
|
|
23
|
+
1. **Complete baseline.** Every mode-dependent token class has its dark value from the sheet, including
|
|
24
|
+
`ink.*`, `text.*`, `background.default/paper/subtle`, `divider`, `controlBorder.*`, all five status keys
|
|
25
|
+
(`main/light/dark/contrastText` via `withMainShades`, plus `text/fill/fillText/bg`), `dataSeries` and
|
|
26
|
+
`shadow.*`.
|
|
27
|
+
2. **Outlined first, as in light.** Resting surfaces keep `shadow.rest: none`. **Overlays get their own,
|
|
28
|
+
lighter surface in dark**: the sheet's overlay surface (`#232A31`) is the paper of `MuiDialog`,
|
|
29
|
+
`MuiMenu`, `MuiPopover` and `MuiDrawer` in dark, with the sheet's overlay shadow; the modal backdrop
|
|
30
|
+
(`MuiBackdrop`) uses the sheet's scrim. Light has no such surface and does not change.
|
|
31
|
+
3. **Primary in dark: derived only when it fails.** An app always passes `palette.primary` (the factory
|
|
32
|
+
requires it). In dark, that value is kept if it clears 4.5:1 on the dark page, and otherwise lightened in
|
|
33
|
+
0.05 steps until it does. Its `contrastText` is whichever of `#FFFFFF` and the dark page colour
|
|
34
|
+
contrasts more. This is how "derived unless the app sets its own" is expressed in an API where every
|
|
35
|
+
app sets one: an app that wants a particular dark primary passes one that already clears the floor
|
|
36
|
+
(webshop-guenter `#D49040`, 7.35:1, stays). Worked examples are in the sheet.
|
|
37
|
+
4. **Status safety net, the dark counterpart of `UCM-THEME-15`.** On a dark page other than the baseline
|
|
38
|
+
page, a **baseline-supplied** status `main` (and `controlBorder.error`) that would fail against the page or
|
|
39
|
+
its own `bg` is lightened until it passes. App-supplied values are never altered (`UCM-THEME-15` rule 3,
|
|
40
|
+
read per key off `appConfig.palette`). Never throws; capped like the darkening.
|
|
41
|
+
5. **Data series follow a rule, not only a list.** In dark, each light series colour is lightened until it
|
|
42
|
+
clears 3:1 on the theme's own `background.paper`. On the baseline paper that yields exactly the sheet's
|
|
43
|
+
list; on an app's own paper (webshop-guenter `#171209`) it adapts.
|
|
44
|
+
6. **Contrast surfaces are the theme's own.** In dark, every derivation and `contrastFindings` judge against
|
|
45
|
+
the theme's page and paper, never a fixed `#FFFFFF`. Light keeps today's pair.
|
|
46
|
+
7. **Autofill needs no new code path.** The palette-aware block (`src/theme/createAppTheme.js:97-108`)
|
|
47
|
+
already resolves from `background.paper` and `ink.primary` and wins over the static light block in
|
|
48
|
+
`tokens.js`. It is correct in dark once the dark palette is in place; confirm it in a test.
|
|
20
49
|
|
|
21
50
|
## Context the operator established
|
|
22
51
|
|
|
@@ -32,7 +61,10 @@ Do not improvise it.
|
|
|
32
61
|
- `BASELINE_INTENTIONAL_DEFAULT_EXEMPTIONS` includes `palette.background.paper` with the reason "The
|
|
33
62
|
canonical surface is deliberately MUI white". That reason is false for a dark theme.
|
|
34
63
|
- The palette-aware slots use palette values (for example the autofill inset uses `background.paper`),
|
|
35
|
-
so they follow the resolved palette once it is right.
|
|
64
|
+
so they follow the resolved palette once it is right. `tokens.js` also carries a static light `autofill`
|
|
65
|
+
block (`#FFFFFF`, `#212529`); it is shadowed by the palette-aware one (measured 2026-10-02).
|
|
66
|
+
- `UCM-THEME-15` (3.8.0) added `deriveDarkenedPageColour`/`deriveAlphaPageColour` next to
|
|
67
|
+
`deriveFocusColour`; the dark branch extends those, it does not add a parallel set.
|
|
36
68
|
- The kit has components registered against the baseline (`src/theme/kitSxRegistry.js`, `THEME-4`/
|
|
37
69
|
`THEME-5`). A kit component that hard-codes a light value would show that value only in dark mode.
|
|
38
70
|
|
|
@@ -42,7 +74,9 @@ In scope:
|
|
|
42
74
|
1. `tokens.js`: a dark baseline palette with the sheet's values, and whatever exemption entries a
|
|
43
75
|
dark theme needs, each with a true reason.
|
|
44
76
|
2. `createAppTheme`: select the baseline palette by `palette.mode`. Make the focus derivation work in
|
|
45
|
-
both directions against the mode's surfaces.
|
|
77
|
+
both directions against the mode's surfaces. Rules 2 to 6 above: the overlay surface, scrim and overlay
|
|
78
|
+
shadow on the four overlay components in dark; the primary derivation; the status safety net; the
|
|
79
|
+
series rule.
|
|
46
80
|
3. `themeCompleteness.js`: contrast checks against the theme's own surfaces, not a fixed white. Mode-
|
|
47
81
|
specific exemptions.
|
|
48
82
|
4. Kit components that resolve a hard-coded light value instead of a token: **list** every one.
|
|
@@ -76,6 +110,11 @@ Non-goals:
|
|
|
76
110
|
derived by darkening, both fail on dark.
|
|
77
111
|
- **The `background.paper` exemption reason is currently mode-blind.** Leaving it would record a false
|
|
78
112
|
statement as the reason in every dark theme.
|
|
113
|
+
- **Rule 3 cannot keep a dark primary that fails the floor.** An app that deliberately wants one gets it
|
|
114
|
+
lightened. That is intended (an accessibility floor), not a defect.
|
|
115
|
+
- **Two sheet values sit close to their threshold** (`controlBorder.main` 3.14:1 on paper, series slot 1
|
|
116
|
+
3.07:1). Build them from the rules, not as literals, so a later paper change re-derives instead of
|
|
117
|
+
silently failing.
|
|
79
118
|
|
|
80
119
|
## Required tests to WRITE (you write them and run YOUR OWN new ones; the Orchestrator's run is the gate)
|
|
81
120
|
|
|
@@ -91,6 +130,18 @@ Kit test suite, narrow, next to the existing theme tests:
|
|
|
91
130
|
3. **Focus contrast.** `controlBorder.focus` clears 3:1 against both page surfaces in each mode.
|
|
92
131
|
4. **Status family on dark.** Each status key resolves `main/light/dark/contrastText` from the dark
|
|
93
132
|
baseline, not MUI's defaults.
|
|
133
|
+
5. **Primary in dark (rule 3).** On the baseline dark page: `#468AB2` stays, `#2F4F96` resolves to
|
|
134
|
+
`#6D84B6`, `#432CA1` to `#8576C2`, each with `#14181B` as `contrastText`; `#D49040` stays.
|
|
135
|
+
6. **Status net (rule 4).** On webshop-guenter's page `#0E0B08` no baseline status colour moves; on a
|
|
136
|
+
page chosen so that one fails, that one is lightened and passes; an app-supplied status `main` that
|
|
137
|
+
fails stays exactly as supplied.
|
|
138
|
+
7. **Overlay surface (rule 2).** In dark, the paper of `MuiDialog`, `MuiMenu`, `MuiPopover` and `MuiDrawer`
|
|
139
|
+
resolves to the sheet's overlay surface and `MuiBackdrop` to its scrim; the light theme's values for
|
|
140
|
+
the same slots are unchanged (covered by test 1).
|
|
141
|
+
8. **Series rule (rule 5).** On the baseline paper the dark series equal the sheet's list; on
|
|
142
|
+
`#171209` every slot clears 3:1.
|
|
143
|
+
9. **Autofill (rule 7).** In dark, the resolved autofill inset is the dark paper and the text is
|
|
144
|
+
`ink.primary`.
|
|
94
145
|
|
|
95
146
|
Run, do not write: the kit's existing theme and `kitSxRegistry` tests.
|
|
96
147
|
|
|
@@ -103,9 +154,128 @@ branch.
|
|
|
103
154
|
|
|
104
155
|
# B. Implementation map, filled by the Orchestrator and ADDRESSED TO THE IMPLEMENTER
|
|
105
156
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
157
|
+
Work from this package; do not explore broadly from scratch; open only the named files to verify. If
|
|
158
|
+
you must dig deeper, delegate to a read-only Explore sub-agent.
|
|
159
|
+
|
|
160
|
+
## Target working directory (absolute)
|
|
161
|
+
|
|
162
|
+
`C:\Users\biglmi\Documents\webapps\ui-core-micha` (branch `main`). Never the workspace root.
|
|
163
|
+
|
|
164
|
+
## Context package
|
|
165
|
+
|
|
166
|
+
Value source for every dark value: `docs/DARK-TOKENS.md` (read it fully first). Do not invent a value;
|
|
167
|
+
one the sheet lacks is `RESULT: BLOCKED <value>`.
|
|
168
|
+
|
|
169
|
+
**`src/theme/tokens.js`**
|
|
170
|
+
- `BASELINE_PALETTE` (l.~52-123) is the light baseline. Add `BASELINE_PALETTE_DARK` next to it with the
|
|
171
|
+
same shape, every key from the sheet: `ink`, `text`, `background`, `divider`, `controlBorder`
|
|
172
|
+
(`main`/`hover`/`error`), the five status keys (use `withMainShades(main, '#14181B')` for
|
|
173
|
+
success/warning/error/info, plus `text`/`fill`/`fillText`/`bg`; `stale` has no `main`, as in light),
|
|
174
|
+
`dataSeries.categorical`. Do NOT hardcode series slots 1 and 5, `controlBorder.main/hover`, or the
|
|
175
|
+
primary as literals: those are rule-derived (see below); the sheet's numbers are the expected OUTPUT.
|
|
176
|
+
The dark `dataSeries` base is the light `SERIES_COLOURS`, lightened by the factory.
|
|
177
|
+
- Export a dark overlay surface (`#232A31`), a dark overlay shadow (`0 8px 28px rgba(0,0,0,.45)`) and the
|
|
178
|
+
scrim (`rgba(0,0,0,.55)`) as named constants.
|
|
179
|
+
- `BASELINE_STATIC.shadow` (~l.200) carries `rest`/`overlay`; the dark theme needs the dark overlay value
|
|
180
|
+
there. `BASELINE_STATIC.components` has static `MuiDialog.paper`/`MuiDrawer.paper`/`MuiMenu.paper`
|
|
181
|
+
boxShadow `OVERLAY_SHADOW` (~l.340-355): in dark these are overridden, never edited for light.
|
|
182
|
+
- The static light `autofill` block (~l.147) is shadowed by the palette-aware one; leave it, confirm by test.
|
|
183
|
+
- `BASELINE_INTENTIONAL_DEFAULT_EXEMPTIONS` (end of file): the `palette.background.paper` entry says "MUI
|
|
184
|
+
white". Provide the list by mode: in dark, drop that entry (the dark paper differs from MUI's default, so
|
|
185
|
+
no exemption is needed), keep the others. The light list stays byte-identical.
|
|
186
|
+
|
|
187
|
+
**`src/theme/createAppTheme.js`**
|
|
188
|
+
- `createAppTheme` (l.~176): the three-layer `createTheme(app, BASELINE_PALETTE, app)` resolution. Read
|
|
189
|
+
`appConfig.palette.mode`; `'dark'` selects `BASELINE_PALETTE_DARK` and passes `mode: 'dark'` through to the
|
|
190
|
+
theme; anything else is the unchanged light path. Do not read `prefers-color-scheme`.
|
|
191
|
+
- `contrastSurfaces = ['#FFFFFF', background.default]` (l.~186): in dark this must be the theme's own
|
|
192
|
+
`[background.default, background.paper]`; light stays exactly `['#FFFFFF', default]`.
|
|
193
|
+
- `deriveFocusColour`/`clearsContrast` (l.~48-60) only darken and use MUI `getContrastRatio`. In dark add a
|
|
194
|
+
lightening counterpart (lighten in 0.05 steps, same 0.9 cap) alongside, not a rewrite. Same for
|
|
195
|
+
`deriveDarkenedPageColour`: add a lightened sibling next to it. For dark `controlBorder.main/hover`:
|
|
196
|
+
`rgba(230, 235, 239, a)` from `ink.primary`, `a` = the smallest alpha (0.01 steps) that clears 3:1 on
|
|
197
|
+
page and paper, hover = main + 0.15; the sheet's 0.38 / 0.53 are the expected result.
|
|
198
|
+
- Rule 3 (primary), rule 4 (status net: baseline-supplied status `main` and `controlBorder.error`, judged
|
|
199
|
+
against page AND its own `bg`, lightened; per-key check off `appConfig.palette` exactly as the existing
|
|
200
|
+
light loops do), rule 5 (series: each baseline light series colour lightened in 0.05 steps until it clears
|
|
201
|
+
3:1 on the theme's own `background.paper`; app-supplied series untouched, the final merge argument already
|
|
202
|
+
lets them win), rule 6 (own surfaces) are all computed here, dark branch only. Primary `contrastText` =
|
|
203
|
+
whichever of `#FFFFFF` / `background.default` contrasts more. The app may pass `primary` as `{ main }`.
|
|
204
|
+
- `createPaletteAwareComponents(palette)` (l.~84): add dark-only overlay slots: `MuiDialog`, `MuiMenu`,
|
|
205
|
+
`MuiPopover`, `MuiDrawer` `paper` -> background colour = overlay surface `#232A31`, `boxShadow` = dark
|
|
206
|
+
overlay shadow; `MuiBackdrop.root` -> scrim. Keep the overlay surface a local constant unless a palette
|
|
207
|
+
key is clearly cleaner and trips no completeness check. Emitted only when mode is dark, so the light
|
|
208
|
+
component tree is untouched.
|
|
209
|
+
- Preserve the final merge order (BASELINE_STATIC, palette-aware components, `appConfig`, the dataSeries
|
|
210
|
+
re-merge). The dark theme's `shadow.overlay` = the dark value.
|
|
211
|
+
|
|
212
|
+
**`src/theme/themeCompleteness.js`**
|
|
213
|
+
- `contrastFindings` (l.~268-345): `backgrounds = { white: '#FFFFFF', page: default }` (~l.298). In dark use
|
|
214
|
+
the theme's own page and paper instead of a fixed white. Light keeps the exact same keys
|
|
215
|
+
(`...-on-white`, `...-on-page`) and values; existing tests assert those surface names. For dark name them
|
|
216
|
+
`...-on-paper` / `...-on-page`.
|
|
217
|
+
- `assertThemeComplete` (~l.620): `MUI_DEFAULT_THEME` is the light MUI default. Verify a dark theme neither
|
|
218
|
+
produces a false "still MUI default" finding nor a false pass; fix only what is wrong.
|
|
219
|
+
|
|
220
|
+
**Kit components with hard-coded light values:** `src/components/QrSignupManager.jsx` has an inline CSS
|
|
221
|
+
block (l.~225-274: `#f5f7fb`, `#122033`, `#d9e2f2`, `#ffffff`, `#e8f0ff`, `#23408e`, `#f8faff`) and
|
|
222
|
+
`bgcolor: '#ffffff'` at l.361. **The l.361 white is a QR quiet zone and stays.** List every hard-coded
|
|
223
|
+
light colour under `src/` outside `src/theme/` and tests in your final report. Switching one to an existing
|
|
224
|
+
palette token is in scope (check its consumers and `tests/QrSignupManager.registrationContext.test.jsx`
|
|
225
|
+
first); a spot that would need a new token is reported, not built. `src/auth/UserMenu.jsx:44` and
|
|
226
|
+
`src/components/charts/chartLabels.js` only mention colours in comments.
|
|
227
|
+
|
|
228
|
+
**Docs / release:** `DESIGN.md` gets a concise dark-mode section (how to opt in, primary rule, status net,
|
|
229
|
+
overlay surface, series rule, what an app owns in dark). `CHANGELOG.md` entry. `package.json` version
|
|
230
|
+
`3.10.0` -> `3.11.0` (and `package-lock.json` where the version appears for this package).
|
|
231
|
+
|
|
232
|
+
**Existing tests to follow** (style, imports): `tests/createAppTheme.test.js`,
|
|
233
|
+
`tests/createAppThemePageContrast.test.js` (imports `assertThemeComplete`, `createAppTheme` from
|
|
234
|
+
`../src/theme`), `tests/themeCompleteness.test.js`. New dark tests go in `tests/createAppThemeDark.test.js`,
|
|
235
|
+
the light guard in `tests/createAppThemeLightGuard.test.js`.
|
|
236
|
+
|
|
237
|
+
**Light regression guard (required test 1):** BEFORE editing any source, capture the output of
|
|
238
|
+
`createAppTheme({ palette: { primary: { main: '#0F62FE' } } })` and of one overriding app config (fontFamily,
|
|
239
|
+
a custom page background, an app-supplied status main) as a JSON fixture
|
|
240
|
+
(`tests/fixtures/light-theme-baseline.json`, stable serialization, functions as strings), from the
|
|
241
|
+
unmodified code, and assert equality afterwards. Prove it can fail: one test mutates a light value in a
|
|
242
|
+
clone of the snapshot and asserts the comparison reports a difference.
|
|
243
|
+
|
|
244
|
+
**Invariants / pitfalls**
|
|
245
|
+
- Light output byte-identical: no key-order change that alters serialization, no new keys on the light theme.
|
|
246
|
+
- Only the first `createTheme` argument is augmented (comment at the top of `tokens.js`): every status
|
|
247
|
+
entry needs explicit `main/light/dark/contrastText`.
|
|
248
|
+
- MUI `getContrastRatio` vs the kit's alpha-aware `calculateContrastRatio`: use the kit's for anything with
|
|
249
|
+
alpha, as THEME-15 did.
|
|
250
|
+
- Build `controlBorder.main/hover`, the series and the primary from the rules, not literals; the tests
|
|
251
|
+
assert the rules reproduce the sheet's values.
|
|
252
|
+
- Do not touch auth, CI, dependencies, `WORK_ORDERS.md`, or `docs/DARK-TOKENS.md` (read-only here).
|
|
253
|
+
|
|
254
|
+
## Required tests, restated
|
|
255
|
+
|
|
256
|
+
The nine tests of Part A, in the new files named above. Run only the tests you wrote.
|
|
257
|
+
|
|
258
|
+
## Preamble
|
|
259
|
+
|
|
260
|
+
The text above is the COMPLETE spec: the committed WO file's content, not a plan to refine; there is no
|
|
261
|
+
separate plan file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and the app
|
|
262
|
+
`MEMORY.md` ONLY for conventions. Stay in scope; do not touch auth/permissions/deps/schema/CI unless the
|
|
263
|
+
spec says so; do not update `MEMORY.md`. **Do NOT edit `WORK_ORDERS.md`: the register row and the review
|
|
264
|
+
verdicts are the orchestrator's alone.** **Your tools are for editing source and test files and for running
|
|
265
|
+
the tests you wrote, nothing else.** Do NOT install dependencies, touch a lockfile (the version line in
|
|
266
|
+
`package-lock.json` is the one exception, a plain text edit), run a package manager, or tidy up stray
|
|
267
|
+
files; if something in the repo state blocks you, stop and report it as `RESULT: BLOCKED <reason>` instead
|
|
268
|
+
of fixing it. Do NOT `git add`/`commit`/`push`: leave every change uncommitted in the working tree for the
|
|
269
|
+
orchestrator's independent review. WRITE the tests the `Required tests` section calls for AND **RUN the
|
|
270
|
+
tests you just wrote** to confirm they execute and pass: that is the ONLY test run you do (NOT the
|
|
271
|
+
affected/full suite, NOT any review). Run them with `npx vitest run <your test files>`. The orchestrator
|
|
272
|
+
re-runs the authoritative set and does the independent review after you finish; those are the gate.
|
|
273
|
+
|
|
274
|
+
Narrate continuously: a `PLAN: <step1> | <step2> | ...` line up front, then a single-line
|
|
275
|
+
`PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `... done` on
|
|
276
|
+
completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final
|
|
277
|
+
`RESULT: DONE|BLOCKED <reason>`. Your final report must also list every hard-coded light colour found under
|
|
278
|
+
`src/` outside the theme folder.
|
|
109
279
|
|
|
110
280
|
---
|
|
111
281
|
|