@micha.bigler/ui-core-micha 3.11.2 → 3.12.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 +4 -0
- package/WORK_ORDERS.md +3 -1
- package/dist/theme/createAppTheme.js +18 -3
- package/dist/theme/tokens.js +11 -7
- package/docs/TYPE-SCALE.md +99 -0
- package/package.json +1 -1
- package/src/theme/createAppTheme.js +7 -0
- package/src/theme/tokens.js +12 -7
- package/tests/createAppThemeTypography.test.js +53 -0
- package/tests/fixtures/light-theme-baseline.json +18 -12
- package/work-orders/UCM-THEME-17.md +111 -0
- package/work-orders/UCM-THEME-18.md +184 -0
- package/work-orders/assets/UCM-THEME-17-type-scale.html +391 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# UCM-THEME-18: Ship the frozen baseline type scale
|
|
2
|
+
|
|
3
|
+
# A. Envelope, authored by the Expertenchat
|
|
4
|
+
|
|
5
|
+
## Goal & expected outcome
|
|
6
|
+
|
|
7
|
+
`createAppTheme` produces the type scale frozen in [`docs/TYPE-SCALE.md`](../docs/TYPE-SCALE.md) (`UCM-THEME-17`,
|
|
8
|
+
frozen 2026-10-04), in light and dark. The screen title (h4) steps down one size below the baseline's `sm`
|
|
9
|
+
breakpoint. Released as a **minor** version (`3.12.0`), because every adopted app looks different after the bump.
|
|
10
|
+
|
|
11
|
+
## Decided values (from `docs/TYPE-SCALE.md`, by variant)
|
|
12
|
+
|
|
13
|
+
| Variant | Before | After |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| h1 / h2 / h3 | 32 / 28 / 24 | **36 / 32 / 28** |
|
|
16
|
+
| h4 | 20 | **24**, and **23 below `sm`** |
|
|
17
|
+
| h5 | 18 | **20** |
|
|
18
|
+
| subtitle1 | 15 | **13** |
|
|
19
|
+
|
|
20
|
+
Unchanged: h6, subtitle2, body1, body2, button, caption, overline; every weight (headings 600, subtitle1 600);
|
|
21
|
+
every line height; `letterSpacing`. If this table and `docs/TYPE-SCALE.md` disagree, the sheet wins.
|
|
22
|
+
|
|
23
|
+
## Context the operator established
|
|
24
|
+
|
|
25
|
+
- **Typography lives in one block**: `src/theme/tokens.js:223-241`, built with `typeVariant` (`tokens.js:45`).
|
|
26
|
+
`createAppTheme` (`src/theme/createAppTheme.js:379-387`) spreads it unchanged and takes only `fontFamily`
|
|
27
|
+
from the app, so light and dark get the same scale from the same place.
|
|
28
|
+
- **Breakpoints**: `tokens.js:250-252`, `sm: 600`. The mobile step means "below `sm`", the same line MUI's
|
|
29
|
+
`breakpoints.down('sm')` draws.
|
|
30
|
+
- **`assertThemeComplete`** reads `fontSize`, `fontWeight`, `lineHeight` and `letterSpacing` per variant
|
|
31
|
+
(`src/theme/themeCompleteness.js:38`). A nested media-query key inside h4 is new to it.
|
|
32
|
+
- **The light regression fixture** `tests/fixtures/light-theme-baseline.json`, checked by
|
|
33
|
+
`tests/createAppThemeLightGuard.test.js`, contains the typography and changes with this order.
|
|
34
|
+
- **The kit's own screens use the variants too** (h6 about 24 times, h4 twice, h5 once in `src/`), so kit
|
|
35
|
+
screens such as the account pages change with the scale. That is intended.
|
|
36
|
+
|
|
37
|
+
## Scope + non-goals
|
|
38
|
+
|
|
39
|
+
In scope: the typography values above; the h4 step below `sm`; the fixture's typography entries;
|
|
40
|
+
`CHANGELOG.md` naming the visible change for every adopted app; the minor release.
|
|
41
|
+
|
|
42
|
+
Non-goals:
|
|
43
|
+
- No app repo changes. The per-app follow-up (listed below) is written after the release, one order per app.
|
|
44
|
+
- No font family, weight or line-height change; no new variant; no change to `breakpoints`.
|
|
45
|
+
- No responsive step for any variant other than h4.
|
|
46
|
+
|
|
47
|
+
## Tier · precondition / gate
|
|
48
|
+
|
|
49
|
+
- **Tier 3 · tests: the typography values per variant and the h4 step, in light and dark; the light
|
|
50
|
+
regression fixture updated in its typography entries only; the existing `createAppTheme` and completeness
|
|
51
|
+
tests.** A change inside shared-core (`AGENTS.md` -> Tiering).
|
|
52
|
+
- Precondition: `UCM-THEME-17` `done` (frozen sheet committed).
|
|
53
|
+
- No prototype gate: the instrument is a decision sheet, not a screen to match.
|
|
54
|
+
|
|
55
|
+
## Risks
|
|
56
|
+
|
|
57
|
+
- **Every adopted app moves on its next bump.** Intended; the changelog says so in one line an app session can
|
|
58
|
+
act on.
|
|
59
|
+
- **An app that overrides h4's size keeps the baseline's 23 px below `sm`**, because a theme merge keeps the
|
|
60
|
+
nested media key. survey_app sets h4 to `2.125rem` today; on mobile it would fall to 23. The per-app
|
|
61
|
+
follow-up handles it; the changelog names it.
|
|
62
|
+
- **`assertThemeComplete` may misread the nested key** (as a missing or extra surface). It must neither raise
|
|
63
|
+
a finding for the baseline's own media key nor let an app's h4 override go unnoticed.
|
|
64
|
+
|
|
65
|
+
## Required tests to WRITE (you write them and run YOUR OWN new ones; the Orchestrator's run is the gate)
|
|
66
|
+
|
|
67
|
+
1. For a light and a dark theme from `createAppTheme`: each variant in the table resolves to its decided
|
|
68
|
+
`fontSize`, read from the theme, compared with the value in the table.
|
|
69
|
+
2. h4 carries a media-query entry for "below `sm`" with `fontSize` 23px, and that query is derived from
|
|
70
|
+
`breakpoints.values.sm`, not typed a second time. Show the test fails if `sm` changes and the query does not.
|
|
71
|
+
3. `assertThemeComplete` on the baseline returns no typography finding.
|
|
72
|
+
|
|
73
|
+
Run, do not write: `tests/createAppTheme.test.js`, `tests/createAppThemeLightGuard.test.js` (with the fixture's
|
|
74
|
+
typography entries updated, and only those), the completeness tests.
|
|
75
|
+
|
|
76
|
+
## Parity guardrail
|
|
77
|
+
|
|
78
|
+
No behaviour change; type sizes only. Palette, spacing, components and exports unchanged.
|
|
79
|
+
|
|
80
|
+
## Downstream (not this order; one order per app after the release)
|
|
81
|
+
|
|
82
|
+
Measured 2026-10-04 (see `docs/TYPE-SCALE.md` -> "Known consequences"):
|
|
83
|
+
|
|
84
|
+
| App | What the follow-up does |
|
|
85
|
+
|---|---|
|
|
86
|
+
| hram | screen titles on 5 pages from h5 to h4; drop the per-level weight 500 |
|
|
87
|
+
| jg-ferien | screen titles on 3 pages from h5 to h4 (`DashboardPage.jsx:187`) |
|
|
88
|
+
| kerzenziehen | admin screen title from h5 to h4 |
|
|
89
|
+
| spesix | 1 page title from h5 to h4; drop per-level weight overrides |
|
|
90
|
+
| fitness-monitor | 1 page title from h5 to h4 |
|
|
91
|
+
| survey_app | drop the 800/700 weights and the h4 `2.125rem`/400 override; decide the h3 page titles (24 -> 28); closes the held `SVA-THEME-1` typography revert |
|
|
92
|
+
| all other adopted apps | bump only |
|
|
93
|
+
|
|
94
|
+
webshop-guenter (own handoff scale), Kira, Cinevia and Gustav (no MUI heading variants) are unaffected.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
# B. Implementation map, filled by the Orchestrator and ADDRESSED TO THE IMPLEMENTER
|
|
99
|
+
|
|
100
|
+
Work from this package; open only the named files. A value the sheet lacks is `RESULT: BLOCKED <value>`.
|
|
101
|
+
|
|
102
|
+
## Target working directory (absolute)
|
|
103
|
+
|
|
104
|
+
`C:\Users\biglmi\Documents\webapps\ui-core-micha` (branch `main`). Never the workspace root.
|
|
105
|
+
|
|
106
|
+
## Context package
|
|
107
|
+
|
|
108
|
+
- **`src/theme/tokens.js`**: `BASELINE_STATIC.typography` (l.~222-241) uses `typeVariant(size, weight, lineHeight, extra)`
|
|
109
|
+
(l.45). Change h1/h2/h3/h4/h5/subtitle1 to the table in Part A; nothing else in that block moves.
|
|
110
|
+
h4 gets the mobile step as a nested media-query key inside the variant (`extra`), `fontSize: '23px'`.
|
|
111
|
+
The query must be **derived from the breakpoint value**, not typed a second time: introduce one
|
|
112
|
+
constant for `sm` (600) in `tokens.js`, use it in `breakpoints.values.sm` (l.~251) and build the key
|
|
113
|
+
from it, in the form MUI's `breakpoints.down('sm')` produces (`@media (max-width:599.95px)`, that is
|
|
114
|
+
`sm - 0.05`). Export the constant or the key builder so the test can reference it.
|
|
115
|
+
- **`src/theme/createAppTheme.js`** (l.~379-387) spreads `BASELINE_STATIC.typography` and takes only
|
|
116
|
+
`fontFamily` from the app; no change expected. Verify the nested media key survives `createTheme`
|
|
117
|
+
into `theme.typography.h4` in both light and dark (read the resolved theme, do not assume).
|
|
118
|
+
- **`src/theme/themeCompleteness.js`** (`TYPOGRAPHY_SURFACES`, l.~38) reads fontSize/fontWeight/lineHeight/
|
|
119
|
+
letterSpacing per variant. Verify the baseline h4 with its media key raises no finding; change this file
|
|
120
|
+
only if it does.
|
|
121
|
+
- **Light regression fixture** `tests/fixtures/light-theme-baseline.json` (checked by
|
|
122
|
+
`tests/createAppThemeLightGuard.test.js`): update ONLY the typography entries that this order changes
|
|
123
|
+
(h1-h5 and subtitle1 `fontSize`, and h4's new media key), in both of its snapshots (`baseline`, `override`).
|
|
124
|
+
Regenerate carefully: the diff of the fixture must contain nothing but those typography lines. Do not
|
|
125
|
+
re-capture the whole file blindly; check `git diff` of the fixture afterwards (use `git diff` to read it,
|
|
126
|
+
do not stage).
|
|
127
|
+
- **Docs / release**: `CHANGELOG.md` entry `3.12.0 - UCM-THEME-18` (newest first, same style as the
|
|
128
|
+
existing entries): the new scale in one table-free sentence; the visible change for every adopted app;
|
|
129
|
+
that an app overriding h4's `fontSize` keeps the baseline's 23px below `sm` (survey_app sets h4
|
|
130
|
+
`2.125rem`); that headings are fixed at weight 600 and apps should not override per level.
|
|
131
|
+
`package.json` version `3.11.2` -> `3.12.0` (no lockfile in this repo).
|
|
132
|
+
- Kit components: no edit expected (they use the variants).
|
|
133
|
+
|
|
134
|
+
**Existing tests to follow** (style): `tests/createAppTheme.test.js`, `tests/createAppThemeDark.test.js`.
|
|
135
|
+
New tests go in `tests/createAppThemeTypography.test.js`.
|
|
136
|
+
|
|
137
|
+
**Pitfalls**: weights, line heights, letterSpacing, h6, subtitle2, body1/2, button, caption, overline are
|
|
138
|
+
unchanged and must stay byte-identical. Do not touch `breakpoints` values or add a second source for `sm`.
|
|
139
|
+
|
|
140
|
+
## Required tests, restated
|
|
141
|
+
|
|
142
|
+
The three tests of Part A. Test 2 must show it can fail: derive the expected query from
|
|
143
|
+
`breakpoints.values.sm` of the resolved theme (not a literal), and include an assertion that would break if
|
|
144
|
+
the baseline's key were typed independently of that value (for example by building a theme with a different
|
|
145
|
+
`sm` through the same constant, if the constant is the single source, or by asserting the key string equals
|
|
146
|
+
the builder applied to the theme's own `sm`).
|
|
147
|
+
|
|
148
|
+
## Preamble
|
|
149
|
+
|
|
150
|
+
The text above is the COMPLETE spec: the committed WO file's content, not a plan to refine; there is no
|
|
151
|
+
separate plan file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and the app
|
|
152
|
+
`MEMORY.md` ONLY for conventions. Stay in scope; do not touch auth/permissions/deps/schema/CI unless the
|
|
153
|
+
spec says so; do not update `MEMORY.md`. **Do NOT edit `WORK_ORDERS.md`: the register row and the review
|
|
154
|
+
verdicts are the orchestrator's alone.** **Your tools are for editing source and test files and for running
|
|
155
|
+
the tests you wrote, nothing else.** Do NOT install dependencies, touch a lockfile, run a package manager,
|
|
156
|
+
or tidy up stray files; if something in the repo state blocks you, stop and report it as
|
|
157
|
+
`RESULT: BLOCKED <reason>` instead of fixing it. Do NOT `git add`/`commit`/`push`: leave every change
|
|
158
|
+
uncommitted in the working tree for the orchestrator's independent review. WRITE the tests the
|
|
159
|
+
`Required tests` section calls for AND **RUN the tests you just wrote** to confirm they execute and pass:
|
|
160
|
+
that is the ONLY test run you do (NOT the affected/full suite, NOT any review). Run them with
|
|
161
|
+
`npx vitest run <your test files>`. The orchestrator re-runs the authoritative set and does the independent
|
|
162
|
+
review after you finish; those are the gate.
|
|
163
|
+
|
|
164
|
+
Narrate continuously: a `PLAN: <step1> | <step2> | ...` line up front, then a single-line
|
|
165
|
+
`PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `... done` on
|
|
166
|
+
completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final
|
|
167
|
+
`RESULT: DONE|BLOCKED <reason>`.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
# C. Orchestrator only, NOT ADDRESSED TO THE IMPLEMENTER
|
|
172
|
+
|
|
173
|
+
> **If you are the implementer reading this work order as your own specification: STOP at this line.**
|
|
174
|
+
> Everything below describes what the Orchestrator does AFTER you finish. You do none of it: no
|
|
175
|
+
> reviewers, no verification run, no register edit, no `git add`/`commit`/`push`.
|
|
176
|
+
|
|
177
|
+
- Check `.claude/codex-status.md` first (newest-first). Before `git push`, run `git log origin/main..HEAD` and
|
|
178
|
+
push only if every listed commit is this order's.
|
|
179
|
+
- Review: Tier 3, independent `reviewer` (all configured lenses) and `ui_reviewer`, one batch, before the commit.
|
|
180
|
+
- Release `3.12.0`: verify the publish through the job log (`npm view` lags for provenance publishes). Row ->
|
|
181
|
+
`done` with the review Notiz and the version. Then the Expertenchat writes the per-app orders above.
|
|
182
|
+
|
|
183
|
+
Mini-handover: `Orchestrator: implement work-orders/UCM-THEME-18.md in ui-core-micha (main). git pull first,
|
|
184
|
+
read the WO, then follow orchestrate-codex.`
|