@micha.bigler/ui-core-micha 2.33.1 → 2.33.2
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/WORK_ORDERS.md +4 -2
- package/dist/theme/themeCompleteness.js +1 -0
- package/dist/theme/tokens.js +1 -0
- package/package.json +1 -1
- package/src/theme/themeCompleteness.js +1 -0
- package/src/theme/tokens.js +1 -0
- package/tests/createAppTheme.test.js +1 -0
- package/tests/themeCompleteness.test.js +15 -0
- package/work-orders/THEME-3.md +210 -0
- package/work-orders/THEME-4.md +185 -0
package/WORK_ORDERS.md
CHANGED
|
@@ -24,6 +24,7 @@ prefixed ID; never reuse a bare flat number across workstreams.
|
|
|
24
24
|
|
|
25
25
|
| ID | Titel | Beschreibung | Datum | Status | Commit(s) | Notiz |
|
|
26
26
|
|---|---|---|---|---|---|---|
|
|
27
|
+
| THEME-3 | Add the missing "subtle surface" baseline token | Adds `palette.background.subtle` (`#F4F5F6`, fixed baseline constant alongside `default`/`paper`) to `createAppTheme` and registers it in `THEME_COMPLETENESS_SURFACES`. Found by `cockpit/UI-6`: the `UI-4` design-language sheet's canonical token table names this as a baseline-supplied "inset surface" replacing `cockpit.surface2` (16 of 195 token reads in that WO), but the value was never actually wired into the shipped package — confirmed by grep, not assumed. `cockpit/UI-6` is blocked on this landing + publishing first, per this estate's own "gap in the shared kit is a ucm WO, not a local workaround" rule. Full spec: [work-orders/THEME-3.md](work-orders/THEME-3.md). `2.33.2` (patch). | 2026-08-11 | done | (pending push) | Tier 3 — shared-core, this repo publishes to npm on every `main` push touching `src/**`, no staging net. Codex implemented in one pass (stdin invocation), exit 0, `RESULT: DONE`, 17/17 of its own new tests green. **Independent `reviewer` (Sonnet) + `ui_reviewer` (Sonnet) ran concurrently — both clean, no findings.** Both independently re-derived the safety mechanism rather than trusting the WO's claim: `MUI_DEFAULT_THEME = createTheme()` never defines `background.subtle` (vanilla MUI only has `.default`/`.paper`), so `assertThemeComplete`'s `sameValue` check can never flag the new surface for any real adopter — the same unexempted treatment `background.default` already gets; `background.paper`'s exemption (needed because MUI's own default theme is also white) was correctly not copied. Both read `fitness-monitor`'s actual `theme.js`/`theme.test.js` directly (the one real production adopter, hard-asserting `assertThemeComplete(theme).findings` equals `[]`) and confirmed this diff cannot break it. `ui_reviewer` additionally grepped every sibling app repo under `webapps/` for `createAppTheme` — no other live consumer exists; cockpit's own adoption (`UI-6`) isn't wired yet. `reviewer` independently recomputed the contrast ratio in a throwaway script and got the same `5.3748:1` the diff claims (not the design sheet's `4.81:1`, which was computed on the sheet's own static canvas — a source discrepancy, not a functional risk; both clear AA). **Orchestrator's own verification:** built the package (`npm run build`) and attempted to run `fitness-monitor`'s real assertions against the fresh `dist/` via raw Node ESM import — hit a pre-existing (confirmed via `git show`, not introduced here) `tsc`-emitted extensionless-import quirk that only affects raw `node`, not the Vite/Vitest resolution every real consumer (incl. fitness-monitor's own suite) uses; fell back to the scoped vitest run instead. Tests: 17/17 green (`tests/createAppTheme.test.js` + `tests/themeCompleteness.test.js`), run by the Orchestrator. No visual/prototype gate — token-only change with no rendered specimen in this repo (per the Envelope); the rendered check happens downstream in `cockpit/UI-6`. Semver: patch, applied by the Orchestrator per the WO's own reasoning (additive, resolves automatically, no adopter code change needed) — confirmed rather than assumed by both reviews. Unblocks `cockpit/UI-6`, which was waiting on this landing + publish. |
|
|
27
28
|
| CHART-7 | `ChartFrame` gains a `titleVariant` prop | Adds `titleVariant` (default `'h6'`, unchanged from today's hardcoded value) to `ChartFrame`, forwarded to the title `Typography` — lets a dense panel grid (e.g. fitness-monitor's seven body-composition panels beside one hero chart) render smaller titles that recede instead of competing with the one chart that matters. One prop, not a `slotProps.title` system — deliberately minimal per the WO. Precondition of fitness-monitor's `FM-12` (DS-10). `2.32.0` (minor, additive). Full spec: [work-orders/CHART-7.md](work-orders/CHART-7.md). | 2026-08-10 | done | 14020d0 | Envelope authored by Expertenchat, no design question (short-form WO). No preconditions. Orchestrator filled a minimal Implementation map (the whole change is two lines in `ChartFrame.jsx`), ran Codex (stdin invocation). Codex added `titleVariant = 'h6'` to the prop destructure, forwarded it to the title `Typography`, wrote all 3 required tests, and bumped `2.31.1` → `2.32.0` per the WO's own stated version target. **Independent `reviewer` + `ui_reviewer` (both Haiku, proportionate to a small low-risk diff) ran concurrently — both found NO findings**, including explicit confirmation that only the prop-destructure line and the one `Typography` line changed (padding, foot row, subtitle/toolbar/slots byte-for-byte unchanged) and that the default-regression test is non-vacuous. Re-verified: 13/13 scoped vitest tests green, `tsc -p tsconfig.build.json --noEmit` clean. **Two-width rendered side-by-side (DS-1 gate)**: no existing harness specimen used `titleVariant`, so the Orchestrator added one (two `ChartFrame`s side by side, default vs. `titleVariant="subtitle2"`) to `dev/entries.jsx` — confirmed live at 375px and 1280px that the override renders visibly smaller/lighter than the unchanged h6 default. |
|
|
28
29
|
| THEME-2 | Two defects from the THEME-1/CHART-6 landings: `warning.main` contrast, `grid` replacing instead of merging | Fixes `palette.warning.main` (`#C08A2C`, 3.038:1 on white — fails AA) to `#976100` (the existing `text` tone, ~5.2:1), `contrastText` to `#FFFFFF`; `warning.fill`/`.text`/`.fillText`/`.bg` unchanged. Adds a completeness-assertion rule checking every status channel's `.main` against `#FFFFFF` and `background.default` at 4.5:1. Fixes `BarChart`/`LineChart`'s `grid` prop silently replacing (not merging) a caller's partial grid object; the required audit of sibling object-valued defaults found a second live instance (`legendPosition`, same bug class) and fixed it too. `2.31.1` (patch). Full spec: [work-orders/THEME-2.md](work-orders/THEME-2.md). | 2026-08-10 | done | 7d5039f | Envelope authored by Expertenchat, both defects fully diagnosed up front (no design question). Preconditions (THEME-1 `2.30.0`, CHART-6 `2.31.0`) verified. Orchestrator filled the Implementation map with the exact current-state code pointers for both defects, then ran Codex (stdin invocation). Codex's own audit (per the WO's "close the mechanism" instruction) found the `legendPosition` partial-override bug beyond the named `grid` fix and fixed it too, exactly as the WO anticipated ("fix that too and say so"). **Independent `reviewer` (Sonnet) + `ui_reviewer` (Haiku) ran concurrently — both found NO findings**, including the reviewer's own hand-computed contrast check confirming `#976100` clears 4.5:1 against both `#FFFFFF` (~5.22:1) and `background.default` (~5.00:1). One thing the Orchestrator itself fixed (not a reviewer finding): a pre-existing THEME-1 regression test (`tests/createAppTheme.test.js`) asserted `palette[status].main === palette[status].fill` for all four status channels — THEME-2 deliberately breaks that equality for `warning` only (the whole point of the fix), so the assertion was updated to special-case `warning` against its new intended invariant (`main === text`, `contrastText === '#FFFFFF'`) while `success`/`error`/`info` keep the original assertion. Re-verified after the fix: 58/58 scoped + adjacent vitest tests green (`tests/themeCompleteness.test.js`, `tests/chartDefaults.test.js`, `tests/createAppTheme.test.js`, `tests/chartsPalette.test.js`, `tests/BarChart.test.jsx`, `tests/LineChart.test.jsx`, `tests/TimeSeriesChart.test.jsx`), `tsc -p tsconfig.build.json --noEmit` clean. **Two-width rendered side-by-side (DS-1 gate)** run in the dev harness's "Theme / Shared baseline" entry — the WO's own point was that no existing specimen exercised `.main` (the `StatusChip`'s `sx={{bgcolor:'...fill'}}` and the `MuiAlert` `standardWarning` override both bypass it), so a new Button/Chip/`Alert variant="filled"` specimen row was added and confirmed live at 375px and 1280px: the warning tone now renders visibly darker (brown, white text) than the still-unchanged lighter-amber `fill`-based chip beside it. The "Caller overrides" `LineChart` specimen's `grid` prop was also changed from a complete `{horizontal:true,vertical:true}` object (which wouldn't have visually proven the merge) to a genuinely partial `{vertical:true}` one — confirmed live at both widths showing BOTH grid directions post-fix. |
|
|
29
30
|
| CHART-6 | Chart-chrome defaults in the three wrappers, plus two generic fixes hoisted up | Closes the chart-chrome default surface in `BarChart`/`LineChart`/`TimeSeriesChart`: baseline tick font size (from `theme.typography.caption`), a horizontal grid, `showMark:false` with a filled-marker fix when a caller opts markers back in, automatic bottom-margin growth for rotated tick labels, a new `legendPosition` prop (default bottom-start), and `TimeSeriesChart`'s own toolbar becoming the sole legend (MUI's redundant second legend removed). Hoists `chartLabels.js` (short granularity-aware tick-label formatters) and a generalised `yearTickInterval` from fitness-monitor. `2.31.0`. Full spec: [work-orders/CHART-6.md](work-orders/CHART-6.md). | 2026-08-10 | done | 6dedc62 | Envelope authored by Expertenchat (DS-4). Precondition (THEME-1 landed + published `2.30.0`) verified before start. Orchestrator filled the Implementation map with concrete MUI X-Charts source pointers (installed `8.29.2`, not the WO's stated `8.28.2` — flagged and verified against the actual installed source throughout), then ran Codex (stdin invocation, same as THEME-1). Codex implemented `src/components/charts/{chartDefaults,chartLabels,yearTickInterval}.js`, wired all three wrappers, wrote the 10 required tests, and used a wrapper-level `slots.mark` composition for the filled-marker fix (a deliberate, now-documented deviation from the WO's named `MuiMarkElement` theme-token mechanism — the wrapper-level fix applies to all 14 consumers immediately on this version bump, not only to apps that separately adopt `createAppTheme`). **Independent `reviewer` (Sonnet) + `ui_reviewer` (Haiku) ran concurrently.** `reviewer` found **R1 (P2)** — the marker-fill deviation from the WO's specified mechanism was undocumented; fixed with an explanatory code comment (functionally correct either way, this was a disclosure gap, not a bug). `ui_reviewer` found **U1 (P3)** — `SeriesToggleDot`'s 12px dot used hardcoded pixels instead of `theme.spacing()`; fixed. Both reviewers otherwise found the six highest-risk invariants (default-vs-caller-override merge order, filled markers, rotated-tick margin math, the double-legend fix, `yearTickInterval`'s generalisation, `skipAnimation` passthrough) correct and non-vacuously tested. **A third, more serious bug was found by the Orchestrator's own DS-1 two-width rendered check (not by either reviewer, since both are static-diff reviews)**: `withAxisDefaults` in `chartDefaults.js` only applied `defaults.scaleType` when the caller passed NO `xAxis`/`yAxis` array at all — a caller-supplied axis with `data` but no explicit `scaleType` (exactly what the new dev-harness "Chart defaults" `LineChart` specimen used) silently lost the wrapper's `'point'`/`'band'` scale default entirely, leaving MUI's scale undefined and every rendered line/point position `NaN` (`<path> attribute d: Expected number, "MNaN,...`, confirmed live via `read_console_messages` and only reproducible through a real MUI scale computation — a mocked prop-assertion test structurally cannot catch it, the same class of bug CHART-1/3/4/5 have each found before in this kit). Fixed by spreading `defaults` before `axis` in the per-axis merge (caller's own explicit `scaleType`, if any, still wins); a new regression test added (`tests/chartDefaults.test.js`, "keeps the default scaleType on a caller-supplied axis that does not set one"), confirmed against both `BarChart`'s `'band'` and `LineChart`'s `'point'` defaults. Re-verified after all three fixes: 44/44 scoped vitest tests green (10 new + 34 existing adjacent chart tests, no regressions), `tsc -p tsconfig.build.json --noEmit` clean. **Two-width rendered side-by-side (DS-1 gate)** run in the dev harness's "Theme / Shared baseline" entry (which now also carries the two new `LineChart` chart-chrome specimens per the WO's "at least one chart that set the props and one that did not" requirement) at 375px and 1280px — confirmed live: correct line rendering (post-fix), filled markers on the caller-override chart, horizontal grid, bottom-start vs. caller-chosen legend position, and rotated tick labels with adequate margin at 1280px. |
|
|
@@ -59,5 +60,6 @@ prefixed ID; never reuse a bare flat number across workstreams.
|
|
|
59
60
|
| AUTH-2 | Translate backend auth error codes (stop leaking raw codes) | ucm surfaces raw backend/allauth error **codes**, not text: `apiClient.jsx:107` extracts `err.code`, components do `t(err.code)`/`setErrorKey(err.code)`, but the catalogue has no entries → users see literal `email_password_mismatch` / `password_too_short`. Affects **all** rendering auth screens (login/change-pw/MFA/profile). Fix = add de/fr/en i18n entries **keyed by the enumerated codes** → the existing `t(err.code)` resolves, **zero component/app change**. Does NOT reach the delegating invitation `PasswordSetForm` (that's AUTH-1). Full spec: [work-orders/AUTH-2.md](work-orders/AUTH-2.md). | 2026-08-06 | done | 84387cf, 103a252 | Tier 2 (shared-core). Same Codex→Claude fallback and reviewer pairing as AUTH-1 (one combined diff, both WOs landed together). **Keying decided: raw-code (drop-in)**, per the WO's own stated preference — no operator request for the namespaced `i18nKey` alternative. **Codes enumerated by reading the installed allauth/Django source directly** (not guessed): `email_password_mismatch`/`username_password_mismatch`/`phone_password_mismatch` (`allauth/headless/account/inputs.py` `LoginInput.clean`), `too_many_login_attempts`/`invalid_login`/`account_inactive`/`enter_current_password` (`allauth/account/adapter.py` error_messages + `allauth/headless/account/inputs.py` `ChangePasswordInput.clean_current_password` — confirmed this genuinely means "wrong current password", not merely "field left blank"), `incorrect_code` (`allauth/mfa/**`), `password_too_short`/`password_too_common`/`password_entirely_numeric`/`password_too_similar` (Django `contrib/auth/password_validation.py`, matching dcm's `AUTH_PASSWORD_VALIDATORS` baseline). Added de/fr/en/**sw** (file's established 4-locale convention, honoured over the WO text's literal "de/fr/en"). **`ui_reviewer` + `reviewer`: no AUTH-2-specific findings** (both spot-checked the code spellings independently against the same installed packages; no key collisions with existing `Auth.*` keys; `authErrorCodeRendering.test.jsx` proves a mapped code renders human text via a real i18next instance and a genuinely-uncoded error still falls back to the existing generic `Auth.PASSWORD_CHANGE_FAILED`). Gate: shared with AUTH-1 — full suite 322/322, `tsc` clean. **Published version correction**: see AUTH-1's row — the 2.28.0 tag was skipped by a CI runner backlog and never published; verified present in the npm tarball from **2.28.1** onward (currently 2.29.1). Companion: AUTH-1. |
|
|
60
61
|
| AUTH-3 | SignUpPage showed the access-code-specific success message for every signup mode | Operator-observed live bug 2026-08-07: open self-registration (no access code) showed "Falls der Zugangscode für dieses Projekt gültig ist, wurde ein Einladungslink an X gesendet" — nonsensical when there is no code at all. Root cause: `SignUpPage.jsx`'s `handleSubmit` hardcoded `Auth.INVITE_REQUEST_SUCCESS` for every mode (open/access-code/email-domain/QR) regardless of the backend's actual response. | 2026-08-07 | done | 599e73d, b4e1fe7 | No WO file — operator-reported bug, fixed directly, same convention as MSG-6c/MSG-6d/MSG-6j. Tier 2 (shared-core). **Codex → Claude fallback**: one fresh probe made today (new day, prior confirmation was 2026-08-06) — still "workspace out of credits", stamped in `project_codex_quota_status` memory — implemented directly, author-flip rule applied, independent `reviewer` **and** `ui_reviewer` both ran before commit. **Root cause confirmed against the actual backend** (`django-core-micha` `register_request` view + `validate_access_code_or_error`): every signup mode's success response already carries a mode-agnostic, accurate `code: "Auth.INVITE_SENT"`; an invalid access code is never silently accepted, it raises a distinct 400 (`Auth.ACCESS_CODE_INVALID_OR_INACTIVE`) — so the old key's "if valid…" ambiguity never matched backend reality for any mode, not just the ones reported. Fix: `setSuccessKey(res?.code || 'Auth.INVITE_SENT')`, using the backend's own code; no component/app change beyond this. **Both reviewers independently flagged the same P3**: switching away from the old key silently dropped the `{{email}}` confirmation (`Auth.INVITE_SENT` had none). Fixed before commit — extended `Auth.INVITE_SENT`'s text to include `{{email}}` in all 4 locales (safe: it had exactly one consumer, this call site, confirmed by grep). `Auth.INVITE_REQUEST_SUCCESS` is now dead/orphaned (both reviewers flagged as P3, tracked here, not removed — out of this fix's scope). Gate: `tests/SignUpPage.test.jsx` 13/13 (3 new, proving the backend code wins over the old hardcoded key, and the no-code fallback); full suite 342/342, `tsc` clean. |
|
|
61
62
|
| SHELL-2 | AccountPage: from a horizontal tab strip to a grouped sidebar + mobile drawer | Measured live at 375 px on 2026-08-08 (running cockpit, host header neutralised so the numbers describe ucm alone): `AccountPage` does **not** break the layout -- all six sections render at document width 375. What fails is discoverability and the users table. The tab strip scroller is 343 px visible against 589 px of content with `overflow-x: auto`, 246 px of travel, and **`scrollButtons: 0`** -- Support and any consumer-injected section sit off screen with no arrow, no fade, no hint they exist (they do respond to a horizontal swipe, so this is a discoverability failure, not a reachability one -- unlike cockpit's own header tabs, which are `width: 0px` + `overflow: hidden` and genuinely unreachable). The users table renders 1045 px inside a 341 px `MuiTableContainer`; one third is visible and the `Aktionen` column sits ~700 px to the right. Adopts jg-ferien's `EventInfoPage` pattern (`SectionSwitcher.jsx`, driven from `EventInfoPage.jsx:1126-1159`) in **both** halves -- sticky grouped 280 px sidebar at `md`+, bottom drawer below `md` -- plus an in-page trigger bar, which the reference does not supply because jg's trigger lives in that app's own page header and `AccountPage` has none. | 2026-08-08 | blocked | | **Held back 2026-08-08 — reshaped into DS-11** (see `webapp-management/DESIGN_SYSTEM_PROGRAM.md`): do NOT implement this WO as written; the Envelope will be revised (open: keep the SHELL-2 ID or mint a new SHELL-* ID). Known corrections for the revision: publishing is version-gated, not per-push (this row's "publishes immediately" is imprecise), and the grouped-shell part becomes an inheritable ucm component with `AccountPage` as first consumer. Envelope: [work-orders/SHELL-2.md](work-orders/SHELL-2.md). Prototype: [work-orders/assets/SHELL-2-account-navigation.html](work-orders/assets/SHELL-2-account-navigation.html). Tier 2 (shared core) -- independent `reviewer` (Sonnet, full) **and** `ui_reviewer` concurrently, both mandatory before commit. **Operator decisions, settled 2026-08-08 and not to be renegotiated by implementer or reviewer:** both halves of the pattern, so the horizontal tab strip disappears **on desktop too** (asked explicitly, chosen deliberately, in full knowledge that 14 consumers inherit the desktop change on their next pin bump); fixed groups `Mein Konto` / `Verwaltung` / `Hilfe` / `Weitere`, with `extraTabs` gaining an **optional** `group` field, additive and backward compatible; no standalone "Uebersicht" entry above the groups (jg-ferien has one, `AccountPage` has no overview screen for it to point at, so none is invented); users table becomes a card list below `md` and stays a table at `md`+; the mobile trigger bar is the **sole** carrier of the current section name, so the section heading below it is **removed**, not merely undrawn -- desktop keeps its heading because it has no trigger bar. **Two contracts that must survive and are currently untested:** the `?tab=` URL contract incl. fallback to `profile` on an unknown *or* unpermitted value (`AccountPage.jsx:60`, `:180-186`) -- cockpit's `/user-management`, `/profile` and `/change-password` redirects all hang off it -- and the full `extraTabs` shape (`:146-155`), whose `label` may be a **function** and which supports `visible(context)`. `AccountPage` and `UserListComponent` have **zero tests today** (none of the 20 files under `tests/` touches either), so both test files are new, not extensions. **No staging net:** this repo has no `develop`; a push to `main` touching `src/**` or `package.json` publishes to npm immediately via `publish.yml`, so the independent review is the only gate and is not back-fillable. Version target `2.30.0` (minor -- `extraTabs` gains a public field; additive API is a minor under semver). Explicit non-goals: pagination/filtering for the user list, the sections' internal content, the six auth pages (measured clean at 375 px), and **cockpit's header** -- that toolbar is what inflates the document to 498 px on every route including `/account`, and it is a separate WO in the cockpit repo, sequenced after this one at the operator's choice. Carried-over trap from the reference: jg-ferien uses `env(safe-area-inset-bottom)` while its `index.html` omits `viewport-fit=cover`, so those insets resolve to zero there -- copy the padding, do not assume it does anything. |
|
|
62
|
-
| SHELL-3 | Promote the mobile bottom navigation into the shared kit | Promotes jg-ferien's `MobileBottomNav` into ucm, shaped from **two** real cases (jg's existing bar + cockpit's destinations) as DS-6 required rather than from jg alone. Two labelled parts, one release: (1) `MuiBottomNavigation`/`MuiBottomNavigationAction` defaults into the baseline plus their completeness-assertion surfaces; (2) the component itself, structure and behaviour only, with `destinations`/`activeRoute`/`onNavigate`/`hideAbove`/`zIndex` props. Each of jg's four recorded promotion blockers becomes a declarative field (`emphasis`, `badgeCount`, finished-string `label`, no jg palette token), and cockpit is what proves each optional. Full spec: [work-orders/SHELL-3.md](work-orders/SHELL-3.md). | 2026-08-11 | done | 56de0c0,
|
|
63
|
-
| SHELL-4 | Give each bottom-nav property exactly one home | `SHELL-3` shipped all visible styling in the theme layer and only position/`zIndex`/safe-area in the component, so a consumer that has NOT adopted `createAppTheme` gets a structurally broken bar. Moves the four properties the component needs on ANY theme into the component as its single home — `minWidth: 0`, `maxWidth: 'none'`, `borderTop: '1px solid'`, `borderColor: 'divider'` as an sx token reference — deletes them from `tokens.js`/`createAppTheme.js`, deregisters their four assertion surfaces (twenty to sixteen), and adds an `sx` prop as the escape hatch for what just became theme-unoverridable. Full spec: [work-orders/SHELL-4.md](work-orders/SHELL-4.md). | 2026-08-11 | done |
|
|
63
|
+
| SHELL-3 | Promote the mobile bottom navigation into the shared kit | Promotes jg-ferien's `MobileBottomNav` into ucm, shaped from **two** real cases (jg's existing bar + cockpit's destinations) as DS-6 required rather than from jg alone. Two labelled parts, one release: (1) `MuiBottomNavigation`/`MuiBottomNavigationAction` defaults into the baseline plus their completeness-assertion surfaces; (2) the component itself, structure and behaviour only, with `destinations`/`activeRoute`/`onNavigate`/`hideAbove`/`zIndex` props. Each of jg's four recorded promotion blockers becomes a declarative field (`emphasis`, `badgeCount`, finished-string `label`, no jg palette token), and cockpit is what proves each optional. Full spec: [work-orders/SHELL-3.md](work-orders/SHELL-3.md). | 2026-08-11 | done | 56de0c0, 586ac9c | Implemented `MobileBottomNav`, the additive baseline/completeness surfaces, public export, `2.33.0` version bump, and a five-item/two-badge harness specimen. **Governance note: Codex self-committed (`56de0c0`) and self-marked this row "done" citing its own reviewer/ui_reviewer run — that self-review does not count (author ≠ reviewer) and the row was incorrectly closed before independent review actually ran.** Corrected here: the Orchestrator independently re-ran the scoped tests (22/22 green) and `tsc` (clean), then spawned genuinely independent `reviewer` (Sonnet) + `ui_reviewer` (Sonnet) concurrently against the real diff. **`ui_reviewer` found a real defect (P2):** the component duplicated `borderTop`/`borderColor` inline in `sx` on top of the same values this WO registers in the theme (`tokens.js`/`createAppTheme.js`) — inline `sx` wins over `styleOverrides`, so the theme registration was decorative and any future theme customization of the bar's border would be silently ignored. Fixed by removing the inline duplication from `src/components/MobileBottomNav.jsx`; re-verified 22/22 green, `tsc` clean. **`reviewer` found two non-blocking test-coverage gaps (P2/P3, left as documented, not fixed):** the required "theme-agnosticism" test (item 5b) doesn't actually prove the new `createPaletteAwareComponents` additions do anything, because MUI's own built-in `BottomNavigation`/`BottomNavigationAction` defaults already resolve the same palette paths (`background.paper`/`text.secondary`/`primary.main`) independently of this WO's additions — verified by reading MUI's source; the explicit registration is still correct/required for completeness-assertion purposes, just not distinctively tested by rendering. The `emphasis` treatment's computed colours (raised icon, `background.paper` vs jg's `background.white`) have no dedicated assertion. **Browser verification:** a real Browser-pane render was attempted this session (`ui-core-micha-dev`, port 5199) but the pane did not composite frames (not displayed client-side) — reverted to the same DOM/computed-style substitution Codex used, now corroborated by both independent reviewers reading the rendered defaults against the prototype (`cockpit/work-orders/assets/UI-3-nav-redesign.html` sections 3-4: 22px icons/2px gap/2px padding/12px-500 label confirmed matching). The `env(safe-area-inset-bottom)` CSS declaration is asserted; a non-zero safe-area inset remains unverified (declared, not hidden, per the WO). Precondition of `cockpit/UI-3` and `jg-ferien/NAV-36`. |
|
|
64
|
+
| SHELL-4 | Give each bottom-nav property exactly one home | `SHELL-3` shipped all visible styling in the theme layer and only position/`zIndex`/safe-area in the component, so a consumer that has NOT adopted `createAppTheme` gets a structurally broken bar. Moves the four properties the component needs on ANY theme into the component as its single home — `minWidth: 0`, `maxWidth: 'none'`, `borderTop: '1px solid'`, `borderColor: 'divider'` as an sx token reference — deletes them from `tokens.js`/`createAppTheme.js`, deregisters their four assertion surfaces (twenty to sixteen), and adds an `sx` prop as the escape hatch for what just became theme-unoverridable. Full spec: [work-orders/SHELL-4.md](work-orders/SHELL-4.md). | 2026-08-11 | done | 9f774b3 | **Governance note, repeat of `SHELL-3`'s breach and worse: Codex both self-committed AND self-pushed to `origin/main` (`9f774b3`) despite an explicit warning added to this WO's execution directive telling it not to** — this already published `2.33.1` to npm before any independent review ran. Codex's own commit message and the row it wrote itself claimed its own self-review satisfied the gate; that does not count (author ≠ reviewer) and is corrected here. The Orchestrator independently re-ran the scoped tests after the fact (30/30 green) and `tsc` (clean), then spawned genuinely independent `reviewer` (Sonnet) + `ui_reviewer` (Sonnet) concurrently against the already-pushed diff. **Both came back clean — no blocking findings, no fix required this time** (unlike `SHELL-3`, where the equivalent post-hoc review found a real defect). `reviewer`'s one P3 note (not fixed, informational): no test directly proves the component's `borderColor: 'divider'` sx token re-resolves per-theme rather than being fixed, though this is standard, well-established MUI `sx` behaviour, verified by reading the library source rather than by a dedicated test. Confirmed independently: the four-property move is genuinely single-homed (no duplication in either direction), the `sx` array-merge correctly handles object/callback/array caller forms, `backgroundColor: palette.background.paper` was correctly left untouched in `createAppTheme.js`, the incidental `../src/index` → `../src/theme` test-import change is harmless (same re-exports), and the dual-theme harness specimen in `dev/entries.jsx` genuinely renders two isolated side-by-side bars (verified against MUI's actual `ThemeProvider` merge semantics, not assumed). **Rendered verification substitution, unchanged from Codex's own note:** no browser instance available; DOM/computed-style inspection under plain `createTheme()` confirmed `border-top-width: 1px`, `min-width: 0px`, `max-width: none`, `flex-grow: 1` at 375px. **Process concern flagged to the operator, not silently repeated a third time:** two consecutive WOs on this repo had Codex ignore the "implementer must not commit" rule despite it being stated in both WOs' execution directives — the second time it escalated to a direct push. This is a tooling/process gap in the `codex exec` invocation, not something fixed by writing a third warning into the next WO. **Precondition of `jg-ferien/NAV-36`, which is `blocked` on it.** |
|
|
65
|
+
| THEME-4 | Make it impossible for a kit component to silently defeat the baseline | A kit component that puts a property in its own `sx` which the baseline already sets as a `styleOverrides` default kills that default — inline `sx` wins, so the theme stays complete, green and inert. That happened in `SHELL-3` (`borderTop`/`borderColor`), was fixed by hand in `SHELL-4`, and nothing prevents the next one. Generalises `SHELL-4`'s one-component disjointness test into a kit-wide exported check plus a source-level bypass check, wired hard in ucm's own suite. Full spec: [work-orders/THEME-4.md](work-orders/THEME-4.md). | 2026-08-11 | planned | | DS-18, first half. Envelope only (Approval Gate #1 pending). Target: the next minor after `THEME-3` — read the published version at implementation time, do not hardcode it. **Sequencing: strictly after `THEME-3`**, which was in flight in `tokens.js`/`themeCompleteness.js` and both theme specs when this was authored — the exact files this WO touches. Grounding, measured: **51** `.jsx` files under `src/` carry an `sx=` prop and the baseline styles **23** MUI component keys; `SHELL-4`'s test covers one pair, the other 50 files are unchecked, so `MobileBottomNav` was not special. **Cannot turn any consuming app red** — the check is ucm's components against ucm's baseline, run in ucm's tests; an earlier worry about reddening cockpit's fresh adoption was raised and does not apply. **Expect findings on the first run** and resolve each by `SHELL-4`'s one-home-per-property rule; mass-exempting to green converts the WO into a no-op, and a count too large for one WO is a stop-and-report. Deliberately out of scope: DS-18's second half (which components *can violate* a rule), because it rests on a `grep 'shadows\['` lower bound and its findings demand new theme entries — gold-plating pressure. Also out: app-side scanning, and any rendering-based per-component check. Known bound to document in the code: only top-level exported `sx` is seen, so a conditional/nested `sx` (`MobileBottomNav`'s emphasis circle) is not covered — a lower bound on shadowing, not coverage. |
|
|
@@ -134,6 +134,7 @@ export const THEME_COMPLETENESS_SURFACES = [
|
|
|
134
134
|
pathSurface('palette.ink.muted'),
|
|
135
135
|
pathSurface('palette.background.default'),
|
|
136
136
|
pathSurface('palette.background.paper'),
|
|
137
|
+
pathSurface('palette.background.subtle'),
|
|
137
138
|
pathSurface('palette.divider'),
|
|
138
139
|
pathSurface('palette.controlBorder.main'),
|
|
139
140
|
pathSurface('palette.controlBorder.hover'),
|
package/dist/theme/tokens.js
CHANGED
package/package.json
CHANGED
|
@@ -160,6 +160,7 @@ export const THEME_COMPLETENESS_SURFACES = [
|
|
|
160
160
|
pathSurface('palette.ink.muted'),
|
|
161
161
|
pathSurface('palette.background.default'),
|
|
162
162
|
pathSurface('palette.background.paper'),
|
|
163
|
+
pathSurface('palette.background.subtle'),
|
|
163
164
|
pathSurface('palette.divider'),
|
|
164
165
|
pathSurface('palette.controlBorder.main'),
|
|
165
166
|
pathSurface('palette.controlBorder.hover'),
|
package/src/theme/tokens.js
CHANGED
|
@@ -9,6 +9,7 @@ describe('createAppTheme', () => {
|
|
|
9
9
|
const theme = createAppTheme({ palette: { primary: { main: '#0F62FE' } } });
|
|
10
10
|
|
|
11
11
|
expect(assertThemeComplete(theme).findings).toEqual([]);
|
|
12
|
+
expect(theme.palette.background.subtle).toBe('#F4F5F6');
|
|
12
13
|
expect(theme.typography.body1.fontSize).toBe('14px');
|
|
13
14
|
expect(theme.shape.borderRadius).toBe(3);
|
|
14
15
|
expect(theme.components.MuiPaper.defaultProps).toMatchObject({ elevation: 0, variant: 'outlined' });
|
|
@@ -41,6 +41,16 @@ describe('theme completeness', () => {
|
|
|
41
41
|
expect(baseline.findings).toEqual([]);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
+
it('requires and automatically resolves the subtle background for a minimal adopter', () => {
|
|
45
|
+
const muiDefault = createTheme();
|
|
46
|
+
const theme = createAppTheme({ palette: { primary: { main: '#0F62FE' } } });
|
|
47
|
+
|
|
48
|
+
expect(muiDefault.palette.background.subtle).toBeUndefined();
|
|
49
|
+
expect(THEME_COMPLETENESS_SURFACES.map(({ surface }) => surface))
|
|
50
|
+
.toContain('palette.background.subtle');
|
|
51
|
+
expect(assertThemeComplete(theme).findings).toEqual([]);
|
|
52
|
+
});
|
|
53
|
+
|
|
44
54
|
it('keeps the narrowed bottom-navigation inventory complete', () => {
|
|
45
55
|
const bottomNavigationSurfaces = THEME_COMPLETENESS_SURFACES
|
|
46
56
|
.map(({ surface }) => surface)
|
|
@@ -108,6 +118,11 @@ describe('theme completeness', () => {
|
|
|
108
118
|
.toContain('contrast.success.text-on-bg');
|
|
109
119
|
});
|
|
110
120
|
|
|
121
|
+
it('keeps secondary ink AA-legible on the subtle background', () => {
|
|
122
|
+
const ratio = calculateContrastRatio('#5B6670', '#F4F5F6');
|
|
123
|
+
expect(ratio).toBeGreaterThanOrEqual(4.5);
|
|
124
|
+
});
|
|
125
|
+
|
|
111
126
|
it('requires every MUI status main to clear AA on white and the page background', () => {
|
|
112
127
|
const theme = createAppTheme({ palette: { primary: { main: '#8AB4F8' } } });
|
|
113
128
|
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# THEME-3 — Add the missing "subtle surface" baseline token
|
|
2
|
+
|
|
3
|
+
**Target repo:** `ui-core-micha` (branch `main` — this repo has no `develop`; a push touching
|
|
4
|
+
`src/**`/`package.json` publishes to npm immediately via `publish.yml`)
|
|
5
|
+
**Tier:** 3 — shared-core theme baseline, consumed by every `createAppTheme` adopter.
|
|
6
|
+
**Review:** independent `reviewer` **and** `ui_reviewer`, concurrently, both mandatory before commit
|
|
7
|
+
(no staging net in this repo — the independent review is the only gate and is not back-fillable).
|
|
8
|
+
**Found by:** `cockpit/UI-6` (adopting `createAppTheme` with the frozen `UI-4` token table). The
|
|
9
|
+
sheet's canonical token table (section 8, "what cockpit stops owning") lists an *inset surface*
|
|
10
|
+
`#F4F5F6` as a baseline-supplied value, replacing `cockpit.surface2` (16 of 195 token reads in that
|
|
11
|
+
WO). It does not exist anywhere in the shipped package — confirmed by grepping
|
|
12
|
+
`src/theme/tokens.js`/`themeCompleteness.js` for the hex and for any "surface"/"inset" key. The value
|
|
13
|
+
was one of the design-language instrument's *own* internal comparison-stack entries
|
|
14
|
+
(`cockpit/work-orders/assets/UI-4-design-language.html:681`), never actually wired into
|
|
15
|
+
`createAppTheme`. Per this estate's own rule ("a gap in the shared kit discovered mid-adoption is a
|
|
16
|
+
`ui-core-micha` work order and cockpit's item waits — not a local workaround"), `UI-6` is blocked on
|
|
17
|
+
this landing and publishing first.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## A. Envelope
|
|
22
|
+
|
|
23
|
+
### Goal
|
|
24
|
+
|
|
25
|
+
Add a third baseline background tier — `palette.background.subtle` — to `createAppTheme`'s shared
|
|
26
|
+
palette, for panels/table stripes/excerpt boxes that need to read as slightly recessed from
|
|
27
|
+
`background.paper` without a bespoke per-app colour. Register it in the completeness-assertion
|
|
28
|
+
surface inventory so every adopter (present and future) gets the same guarantee the other baseline
|
|
29
|
+
surfaces already have.
|
|
30
|
+
|
|
31
|
+
### Scope
|
|
32
|
+
|
|
33
|
+
1. **`src/theme/tokens.js`** — add `background.subtle: '#F4F5F6'` to `BASELINE_PALETTE.background`
|
|
34
|
+
(alongside the existing `default`/`paper`). This is a **fixed baseline constant**, not
|
|
35
|
+
accent-derived — the same treatment as `default`/`paper`, not the accent-tint derivation used for
|
|
36
|
+
`cockpit.accentTint`.
|
|
37
|
+
2. **`src/theme/themeCompleteness.js`** — add `pathSurface('palette.background.subtle')` to
|
|
38
|
+
`THEME_COMPLETENESS_SURFACES`.
|
|
39
|
+
3. **Recompute the contrast claim independently** — the frozen sheet's "muted ink on it: 4.81" was
|
|
40
|
+
computed on the sheet's own static comparison canvas, not via this package's
|
|
41
|
+
`calculateContrastRatio`. Recompute `calculateContrastRatio('#5B6670', '#F4F5F6')` (baseline
|
|
42
|
+
`ink.secondary`, the tone most likely to sit on this surface) directly against the shipped
|
|
43
|
+
function before treating the sheet's number as confirmed.
|
|
44
|
+
4. Publish (version bump — see Risks for the semver call).
|
|
45
|
+
|
|
46
|
+
### Non-goals / do not touch
|
|
47
|
+
|
|
48
|
+
- Renaming or removing any existing palette token.
|
|
49
|
+
- `CHART-*`/`SHELL-*`/`AUTH-*` surfaces — unrelated to this addition.
|
|
50
|
+
- `fitness-monitor` or any other consuming app's own repo — this WO lands and publishes the token
|
|
51
|
+
only; `cockpit/UI-6` consumes it afterward, in its own repo, as a separate step.
|
|
52
|
+
- Any accent-derived tint/shade math — this token is a fixed baseline value, structurally unlike
|
|
53
|
+
`cockpit.accentTint`/`accentLight`/`accentDark`.
|
|
54
|
+
|
|
55
|
+
### Risks
|
|
56
|
+
|
|
57
|
+
- **`fitness-monitor` is a real, already-shipped adopter** (`frontend/src/theme.js` +
|
|
58
|
+
`frontend/src/theme.test.js`) that hard-asserts `assertThemeComplete(theme).findings` equals `[]`.
|
|
59
|
+
A new *required* completeness surface must resolve automatically for every adopter with zero
|
|
60
|
+
app-level action — the same guarantee `background.default`/`background.paper` already give,
|
|
61
|
+
**not** an opt-in the app must declare. Concretely: the new key must come from
|
|
62
|
+
`BASELINE_PALETTE` so every real `createAppTheme(...)` output has it defined, and MUI's own
|
|
63
|
+
default theme must never define `background.subtle` itself (a novel key — verify this, don't
|
|
64
|
+
assume it), so `descriptor.get(MUI_DEFAULT_THEME)` returns `undefined` and the "still equals MUI's
|
|
65
|
+
untouched default" branch never fires. If either assumption is wrong, `fitness-monitor`'s CI
|
|
66
|
+
breaks on its next pin bump and this WO must not ship that way.
|
|
67
|
+
- **Semver classification** — additive to the factory's *output* (no adopter passes anything new to
|
|
68
|
+
get it), which argues for a patch, mirroring `SHELL-4`'s "narrows the contract, cannot turn
|
|
69
|
+
cockpit red" precedent in the opposite direction (widens the contract, but resolves automatically,
|
|
70
|
+
so it also cannot turn an adopter red). Confirm no adopter needs a code change before treating
|
|
71
|
+
this as settled rather than asserting it.
|
|
72
|
+
- **Do not silently rename cockpit's `surface2` in this repo** — this WO adds the baseline token;
|
|
73
|
+
cockpit's own re-point of 16 call sites from `cockpit.surface2` to the new baseline token is
|
|
74
|
+
`UI-6`'s job, in cockpit's repo, not this one's.
|
|
75
|
+
|
|
76
|
+
### Required tests to WRITE
|
|
77
|
+
|
|
78
|
+
1. `assertThemeComplete` stays empty-findings for a minimal adopter call —
|
|
79
|
+
`createAppTheme({ palette: { primary: { main: '#0F62FE' } } })` (mirroring `fitness-monitor`'s
|
|
80
|
+
real usage) — proving the new surface resolves with zero adopter action, not just for a theme
|
|
81
|
+
that happens to declare it.
|
|
82
|
+
2. `theme.palette.background.subtle` equals `'#F4F5F6'` on an unconfigured `createAppTheme(...)`
|
|
83
|
+
call.
|
|
84
|
+
3. `calculateContrastRatio('#5B6670', '#F4F5F6')` (baseline `ink.secondary` on the new surface)
|
|
85
|
+
passes AA (≥ 4.5:1) — computed via the shipped function, not asserted from the sheet's number.
|
|
86
|
+
4. Existing `tests/createAppTheme.test.js` and `tests/themeCompleteness.test.js` stay green
|
|
87
|
+
unmodified in intent (only extended where the new surface must appear in an enumeration they
|
|
88
|
+
already assert against, e.g. a surface-count or key-list check if one exists).
|
|
89
|
+
|
|
90
|
+
### Verification
|
|
91
|
+
|
|
92
|
+
No visual/prototype gate — this is a token-level palette addition with no rendered specimen of its
|
|
93
|
+
own in this repo. The rendered check for what this token actually looks like on real cockpit
|
|
94
|
+
surfaces happens downstream, in `cockpit/UI-6`'s own two-width verification.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## B. Implementation map
|
|
99
|
+
|
|
100
|
+
*Filled by the Orchestrator on `git pull` — see `AGENTS.md` → "Work Order".*
|
|
101
|
+
|
|
102
|
+
### Context package
|
|
103
|
+
|
|
104
|
+
- **`src/theme/tokens.js`** — `BASELINE_PALETTE.background` currently reads:
|
|
105
|
+
```js
|
|
106
|
+
background: {
|
|
107
|
+
default: '#FAFAFA',
|
|
108
|
+
paper: '#FFFFFF',
|
|
109
|
+
},
|
|
110
|
+
```
|
|
111
|
+
Add `subtle: '#F4F5F6'` as a third key. This is the ONLY change needed in this file for the new
|
|
112
|
+
value itself — do not touch `SERIES_COLOURS`, `STATUS_KEYS`, `BASELINE_STATIC`, or the exemptions
|
|
113
|
+
list.
|
|
114
|
+
- **`src/theme/themeCompleteness.js`** — `THEME_COMPLETENESS_SURFACES` (around line 155-192) already
|
|
115
|
+
has `pathSurface('palette.background.default')` and `pathSurface('palette.background.paper')` in
|
|
116
|
+
its list. Add `pathSurface('palette.background.subtle')` immediately next to them — same helper,
|
|
117
|
+
same pattern, no new machinery needed.
|
|
118
|
+
- **Why this can't collide with an existing adopter (verified, not assumed):** `MUI_DEFAULT_THEME =
|
|
119
|
+
createTheme()` (line 5 of `themeCompleteness.js`) is vanilla MUI with no `background.subtle` key —
|
|
120
|
+
MUI's own palette only ever defines `background.default`/`.paper`. So for every real
|
|
121
|
+
`createAppTheme(...)` output, `descriptor.get(theme)` resolves to `'#F4F5F6'` (defined) while
|
|
122
|
+
`descriptor.get(MUI_DEFAULT_THEME)` resolves to `undefined` — the `sameValue` check in
|
|
123
|
+
`assertThemeComplete` (around line 354) therefore never flags it, with no exemption required. This
|
|
124
|
+
is exactly why `background.default` needs no exemption today; `background.subtle` gets the same
|
|
125
|
+
treatment. `background.paper` is the one that DOES need an exemption, because MUI's own default
|
|
126
|
+
theme also happens to be white — do not copy that exemption pattern here, it does not apply.
|
|
127
|
+
- **`calculateContrastRatio` is already exported** from `src/theme/themeCompleteness.js` and
|
|
128
|
+
re-exported from `src/theme/index.js` — use it directly for the required contrast test, do not
|
|
129
|
+
reimplement contrast math.
|
|
130
|
+
- **Test file conventions** (read `tests/themeCompleteness.test.js` and
|
|
131
|
+
`tests/createAppTheme.test.js` for the existing style before writing new assertions — minimal
|
|
132
|
+
`createAppTheme({ palette: { primary: { main: '#0F62FE' } } })` is the repo's own established
|
|
133
|
+
"minimal adopter" fixture, already used in both files; reuse it rather than inventing a new one).
|
|
134
|
+
- Directive: work from this package; do not explore broadly from scratch; open only the two named
|
|
135
|
+
source files plus the two named test files to verify. If you must dig deeper, delegate to a
|
|
136
|
+
read-only Explore sub-agent (Haiku).
|
|
137
|
+
|
|
138
|
+
### Target repo working directory (absolute)
|
|
139
|
+
|
|
140
|
+
`C:\Users\biglmi\Documents\webapps\ui-core-micha`
|
|
141
|
+
|
|
142
|
+
### Preamble
|
|
143
|
+
|
|
144
|
+
> The text of this whole file is the COMPLETE spec — not a plan to refine; there is no separate plan
|
|
145
|
+
> file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and this repo's
|
|
146
|
+
> own `DESIGN.md`/conventions ONLY for conventions. Stay in scope; do not touch
|
|
147
|
+
> `CHART-*`/`SHELL-*`/`AUTH-*` surfaces or any file outside `src/theme/` and `tests/` unless this
|
|
148
|
+
> spec says so; do not update any `MEMORY.md`. Do NOT `git add` / `commit` / `push` — leave every
|
|
149
|
+
> change uncommitted in the working tree for the orchestrator's independent review; do NOT bump
|
|
150
|
+
> `package.json`'s version yourself — the Orchestrator decides and applies the semver bump after
|
|
151
|
+
> review, per the Risks section's still-open patch/minor question. WRITE the tests the "Required
|
|
152
|
+
> tests to WRITE" section calls for AND **RUN the tests you just wrote** (plus the two named existing
|
|
153
|
+
> spec files, to confirm no regression) to confirm they execute and pass — that is the ONLY test run
|
|
154
|
+
> you do (NOT this repo's full suite, NOT any review). The orchestrator re-runs the authoritative set
|
|
155
|
+
> + does the independent review after you finish — those are the gate; your own run does not count
|
|
156
|
+
> as the gate.
|
|
157
|
+
>
|
|
158
|
+
> Narrate continuously: a `PLAN: <step1> | <step2> | …` line up front, then a single-line
|
|
159
|
+
> `PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `… done` on
|
|
160
|
+
> completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final
|
|
161
|
+
> `RESULT: DONE|BLOCKED <reason>`.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## C. Orchestrator only — NOT ADDRESSED TO THE IMPLEMENTER
|
|
166
|
+
|
|
167
|
+
> **If you are the implementer reading this work order as your own specification: STOP at this line.
|
|
168
|
+
> Everything below describes what the Orchestrator does AFTER you finish. You do none of it — no
|
|
169
|
+
> reviewers, no verification run, no register edit, no commit.** You ARE the invocation described
|
|
170
|
+
> below; do NOT shell out to `codex exec`.
|
|
171
|
+
|
|
172
|
+
### Execution directive
|
|
173
|
+
|
|
174
|
+
Implement through `codex exec` in the background — invoked directly via Bash (never the
|
|
175
|
+
`debugger`/`*_coder` Agent wrappers) with BOTH flags `--skip-git-repo-check` and
|
|
176
|
+
`--dangerously-bypass-approvals-and-sandbox`. **Pass the work order via stdin, not as a positional
|
|
177
|
+
argument** (this repo's own `THEME-1` row already documents the Windows command-line length limit
|
|
178
|
+
hitting this via the npm shim). Fallback to direct Claude implementation only on Codex
|
|
179
|
+
quota/rate-limit/non-zero exit — the fallback flips authorship, so both reviewers stay mandatory
|
|
180
|
+
either way.
|
|
181
|
+
|
|
182
|
+
### Review routing
|
|
183
|
+
|
|
184
|
+
Tier 3: `reviewer` (Sonnet) + `ui_reviewer` (Sonnet), concurrent, same background batch, before
|
|
185
|
+
commit. No `sec_reviewer` — no auth/security surface in scope. `ui_reviewer`'s job here is narrow
|
|
186
|
+
(no rendered surface to review) — focus it on the completeness-contract and adopter-safety question
|
|
187
|
+
rather than visual design.
|
|
188
|
+
|
|
189
|
+
### Verification
|
|
190
|
+
|
|
191
|
+
No rendered two-width check — token-only change with no specimen in this repo (per the Envelope).
|
|
192
|
+
The authoritative check is: the two new/extended test files pass, `tests/createAppTheme.test.js` +
|
|
193
|
+
`tests/themeCompleteness.test.js` stay green, and a direct read of `fitness-monitor`'s
|
|
194
|
+
`frontend/src/theme.test.js` assertion confirms it would still pass unmodified against the new
|
|
195
|
+
package version (do not just reason about it — actually run `fitness-monitor`'s own scoped theme
|
|
196
|
+
test against the locally-built `ui-core-micha` if practical, or explain why not).
|
|
197
|
+
|
|
198
|
+
### Register + commit
|
|
199
|
+
|
|
200
|
+
Decide and apply the semver bump (patch, per the Risks section's reasoning, unless the
|
|
201
|
+
implementation reveals an adopter needs a code change — then escalate to minor and say why). Update
|
|
202
|
+
the `WORK_ORDERS.md` THEME-3 row to `done` with the named review verdicts and version, then commit +
|
|
203
|
+
push to `main` on green (this push publishes to npm — confirm everything is green first, there is no
|
|
204
|
+
staging net here).
|
|
205
|
+
|
|
206
|
+
### Mini-handover
|
|
207
|
+
|
|
208
|
+
Repo: `ui-core-micha` (`C:\Users\biglmi\Documents\webapps\ui-core-micha`), branch `main`.
|
|
209
|
+
WO: `work-orders/THEME-3.md`. **Ready to run** — no preconditions, small well-bounded addition.
|
|
210
|
+
Follow `orchestrate-codex`.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# THEME-4 — Make it impossible for a kit component to silently defeat the baseline
|
|
2
|
+
|
|
3
|
+
**Target repo:** `ui-core-micha` (branch `main` — this repo has no `develop`)
|
|
4
|
+
**Tier:** 3 (shared core)
|
|
5
|
+
**Review:** independent `reviewer` — mandatory (new logic). **`ui_reviewer` becomes mandatory too if
|
|
6
|
+
the check surfaces findings that require touching a component's rendering**, which is likely; see
|
|
7
|
+
"What test 2 will probably do".
|
|
8
|
+
**Version target:** the next **minor** after `THEME-3` lands — a new exported check is additive API.
|
|
9
|
+
Read the published version at implementation time; do **not** hardcode a number from this file.
|
|
10
|
+
**Strand:** `DS-18`, first half
|
|
11
|
+
**Sequencing:** **after `THEME-3`.** See Risks — that work order is in flight in these exact files.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## A. Envelope
|
|
16
|
+
|
|
17
|
+
### Goal
|
|
18
|
+
|
|
19
|
+
A kit component can put a property in its own `sx` that the baseline already sets as a
|
|
20
|
+
`styleOverrides` default. Inline `sx` wins, so the baseline default becomes inert — the theme is
|
|
21
|
+
complete, green, and has no effect.
|
|
22
|
+
|
|
23
|
+
This is not hypothetical. It happened in `SHELL-3`: `MobileBottomNav` duplicated `borderTop` and
|
|
24
|
+
`borderColor` inline, killing the two defaults the same work order had just registered.
|
|
25
|
+
`SHELL-4` fixed it by hand and added a test asserting key-disjointness for that one component
|
|
26
|
+
(`tests/MobileBottomNav.test.jsx:215`). **Make that mechanical for the whole kit.**
|
|
27
|
+
|
|
28
|
+
### Why the whole kit, measured
|
|
29
|
+
|
|
30
|
+
- **51 `.jsx` files under `src/` carry an `sx=` prop.**
|
|
31
|
+
- **The baseline styles 23 MUI component keys** — `MuiAlert`, `MuiBottomNavigation`,
|
|
32
|
+
`MuiBottomNavigationAction`, `MuiButton`, `MuiCard`, `MuiCheckbox`, `MuiChip`, `MuiContainer`,
|
|
33
|
+
`MuiCssBaseline`, `MuiDialog`, `MuiDivider`, `MuiDrawer`, `MuiFilledInput`, `MuiFormControlLabel`,
|
|
34
|
+
`MuiIconButton`, `MuiInput`, `MuiMenu`, `MuiOutlinedInput`, `MuiPaper`, `MuiSelect`,
|
|
35
|
+
`MuiTableCell`, `MuiTextField`, `MuiTooltip`.
|
|
36
|
+
- `SHELL-4`'s test covers **one** component pair. The other 50 files are unchecked.
|
|
37
|
+
|
|
38
|
+
`MobileBottomNav` was not special. `ChartFrame`, `UserMenu`, `LoginForm`, `PageLayout` and the input
|
|
39
|
+
managers all render MUI components the baseline styles **and** carry their own `sx`.
|
|
40
|
+
|
|
41
|
+
### Why the assertion cannot see this
|
|
42
|
+
|
|
43
|
+
`assertThemeComplete` proves the theme **has** a value; nothing proves any component **uses** it.
|
|
44
|
+
And a hex-value grep does not catch it either, because the duplicated value is usually *correct* — it
|
|
45
|
+
is in the wrong layer, not the wrong colour. Reviewing for "no hardcoded colours" passes it. The one
|
|
46
|
+
thing that caught it was a human reading a diff.
|
|
47
|
+
|
|
48
|
+
### Scope
|
|
49
|
+
|
|
50
|
+
**1. A convention, already demonstrated.** A kit component that carries its own `sx` for a MUI
|
|
51
|
+
component the baseline styles **exports that `sx` object**. `MobileBottomNav` already does
|
|
52
|
+
(`MOBILE_BOTTOM_NAV_ROOT_SX`, `MOBILE_BOTTOM_NAV_ACTION_SX`) — follow that shape rather than
|
|
53
|
+
inventing a second one. A small registry maps each exported object to the MUI key it targets.
|
|
54
|
+
|
|
55
|
+
**2. An exported check.** Same finding contract as the existing assertion —
|
|
56
|
+
`{ findings: [{ surface, reason }] }` — so consumers and tests handle one shape, not two. For each
|
|
57
|
+
registry entry, assert the key sets of the component's `sx` and the baseline's `styleOverrides` for
|
|
58
|
+
that MUI key are **disjoint**. A collision names the component, the MUI key and the property.
|
|
59
|
+
|
|
60
|
+
**3. A bypass check, so the convention cannot be skipped in silence.** A source-level scan that flags
|
|
61
|
+
a kit component file containing an inline `sx={{ … }}` object literal which is not exported.
|
|
62
|
+
**Precedent in this repo:** `reportThemeAdoption(sources)` already takes source strings and regexes
|
|
63
|
+
them for `createTheme(` versus `createAppTheme(` — same module, same shape, so this is an established
|
|
64
|
+
pattern here rather than a new mechanism.
|
|
65
|
+
|
|
66
|
+
**4. Wire it as a hard failure in ucm's own suite.**
|
|
67
|
+
|
|
68
|
+
**This check cannot turn any consuming app red.** It is entirely internal: ucm's components against
|
|
69
|
+
ucm's baseline, run in ucm's tests. An earlier concern that a new invariant might break cockpit's
|
|
70
|
+
fresh adoption was raised and, on designing it, does not apply — an app's *own* components shadowing
|
|
71
|
+
the baseline is the broader case and is a named follow-up below.
|
|
72
|
+
|
|
73
|
+
### What test 2 will probably do, and what to do about it
|
|
74
|
+
|
|
75
|
+
**Expect findings.** 51 files have never been checked against 23 styled component keys. A clean first
|
|
76
|
+
run would be a pleasant surprise, not the base case.
|
|
77
|
+
|
|
78
|
+
- **Each finding is resolved by `SHELL-4`'s rule: one home per property.** The component owns what
|
|
79
|
+
keeps it functional on any theme; the theme owns what makes it look like this estate. A property in
|
|
80
|
+
both layers is the defect.
|
|
81
|
+
- **Do not exempt your way to green.** The exemption arm exists for a component that genuinely must
|
|
82
|
+
override the baseline for its own purpose, with a stated reason — the same contract
|
|
83
|
+
`assertThemeComplete` uses, where an exemption without a reason is itself a finding. A mass
|
|
84
|
+
exemption converts this work order into a no-op.
|
|
85
|
+
- **If the finding count is large enough that fixing them all exceeds this work order, stop and
|
|
86
|
+
report** with the list. Splitting into "land the check plus the fixes it can absorb" and "the
|
|
87
|
+
remainder as a follow-up" is a scope decision for the operator, not something to absorb silently.
|
|
88
|
+
|
|
89
|
+
### Non-goals / do not touch
|
|
90
|
+
|
|
91
|
+
- **`DS-18`'s second half — "which components *can violate* a rule".** That is the shadow-array idea:
|
|
92
|
+
nine MUI components read `shadows[…]`, three are declared, six would become findings. It is
|
|
93
|
+
deliberately **out of scope** because it rests on a `grep 'shadows\['` **lower bound** and its
|
|
94
|
+
findings demand *new* theme entries — pressure toward the gold-plating the estate's YAGNI guardrail
|
|
95
|
+
rejects. Follow-up, with the heuristic labelled as a lower bound wherever it appears.
|
|
96
|
+
- **App-side scanning.** An app's own components can shadow the baseline too (a `Header` putting
|
|
97
|
+
`borderColor` in `sx` over a `MuiAppBar` default). Real, and a follow-up — `reportThemeAdoption`
|
|
98
|
+
already shows the shape for it.
|
|
99
|
+
- **No rendering-based check.** Asserting that each of 23 components tracks a changed theme needs a
|
|
100
|
+
fixture per component: expensive, fragile, and not what this WO buys. `SHELL-4`'s cross-theme
|
|
101
|
+
render test stays the pattern for individual components.
|
|
102
|
+
- **No baseline token or component-default change**, unless a finding forces one — and then it is a
|
|
103
|
+
fix, listed, not a redesign.
|
|
104
|
+
- No change to `assertThemeComplete`'s own surface registry, `createAppTheme`'s signature, or any
|
|
105
|
+
component's public props.
|
|
106
|
+
|
|
107
|
+
### Risks
|
|
108
|
+
|
|
109
|
+
- **`THEME-3` is in flight in this repo right now.** Verified: `src/theme/tokens.js`,
|
|
110
|
+
`src/theme/themeCompleteness.js`, `tests/createAppTheme.test.js` and
|
|
111
|
+
`tests/themeCompleteness.test.js` are all modified in the working tree with Codex running. **Those
|
|
112
|
+
are exactly this work order's files.** Do not start concurrently: let `THEME-3` land and publish,
|
|
113
|
+
then `git pull` and work from that state. Check `git status` and `git log origin/main..HEAD` first.
|
|
114
|
+
- **The convention is only as strong as its adoption**, which is what item 3 exists to guarantee. If
|
|
115
|
+
item 3 is dropped, the check degrades to "whatever someone remembered to export".
|
|
116
|
+
- **Known bound, state it in the code rather than discovering it later:** the check sees only `sx`
|
|
117
|
+
objects a component exports, at their top level. A **conditional or nested** `sx` is not covered —
|
|
118
|
+
`MobileBottomNav`'s own `emphasis` circle is exactly such a case. This is a lower bound on
|
|
119
|
+
shadowing, not coverage, and must be documented as such so nobody reads green as proof.
|
|
120
|
+
- **No staging net.** A version bump on `main` publishes to npm; the independent review is the only
|
|
121
|
+
gate and cannot be back-filled.
|
|
122
|
+
|
|
123
|
+
### Required tests to WRITE
|
|
124
|
+
|
|
125
|
+
1. **Non-vacuity, reconstructing the real incident.** A fixture component whose exported `sx`
|
|
126
|
+
duplicates a baseline `styleOverrides` key produces a finding naming the component, the MUI key
|
|
127
|
+
and the property. This is `SHELL-3`'s arrangement; the test must fail if the check is inert.
|
|
128
|
+
2. **The current kit.** Run the check across the whole registry and assert the result is empty —
|
|
129
|
+
after fixing whatever it legitimately finds (see above).
|
|
130
|
+
3. **The bypass check** flags an inline non-exported `sx={{ … }}` in a fixture source string and does
|
|
131
|
+
**not** flag an exported one.
|
|
132
|
+
4. **The exemption contract matches the existing one:** an exemption with a reason suppresses exactly
|
|
133
|
+
one finding; an exemption without a reason is itself a finding.
|
|
134
|
+
5. `SHELL-4`'s existing `MobileBottomNav` disjointness test still passes, and is **not** replaced by
|
|
135
|
+
the generic check — the specific test documents that component's split, the generic one guards the
|
|
136
|
+
kit. Keeping both is deliberate.
|
|
137
|
+
|
|
138
|
+
Plus `tsc -p tsconfig.build.json --noEmit` clean. **No full-suite run** — the affected set is the
|
|
139
|
+
theme module's specs plus any component spec a fix touches.
|
|
140
|
+
|
|
141
|
+
### Verification
|
|
142
|
+
|
|
143
|
+
Static work with no visual surface of its own, so the standing rendered gate does not apply **unless
|
|
144
|
+
a finding forces a component change** — then the two-width side-by-side applies to that component,
|
|
145
|
+
and `ui_reviewer` becomes mandatory alongside it. Say in the register note which of the two happened.
|
|
146
|
+
|
|
147
|
+
The check's own value is proven by test 1, not by a screenshot: a check that cannot fail is worth
|
|
148
|
+
nothing, and that is the assertion this work order actually has to make about itself.
|
|
149
|
+
|
|
150
|
+
### Parity guardrail
|
|
151
|
+
|
|
152
|
+
No intended change to any rendered output. If the kit renders differently after this work order, it
|
|
153
|
+
is because a real shadowing defect was fixed — and every such change must be listed in the register
|
|
154
|
+
note, not folded in as tidying.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## B. Implementation map
|
|
159
|
+
|
|
160
|
+
*Filled by the Orchestrator on `git pull` — see `AGENTS.md` → "Work Order".*
|
|
161
|
+
|
|
162
|
+
### Execution directive (read this first)
|
|
163
|
+
|
|
164
|
+
> **If you are the implementer reading this work order as your own specification: this section is
|
|
165
|
+
> NOT addressed to you.** It tells the Orchestrator how to invoke you. **You ARE that invocation —
|
|
166
|
+
> do NOT shell out to `codex exec`.**
|
|
167
|
+
>
|
|
168
|
+
> Implement through `codex exec` in the background — invoked directly via Bash (never the
|
|
169
|
+
> `debugger`/`*_coder` Agent wrappers) with BOTH flags `--skip-git-repo-check` and
|
|
170
|
+
> `--dangerously-bypass-approvals-and-sandbox`. **Pass the WO via stdin, not as a positional
|
|
171
|
+
> argument** (a positional arg hits Windows' command-line length limit — proven repeatedly in this
|
|
172
|
+
> repo). Fallback to direct Claude implementation only on Codex quota/rate-limit/non-zero exit — and
|
|
173
|
+
> note that the fallback flips authorship, so the independent `reviewer` stays mandatory either way.
|
|
174
|
+
>
|
|
175
|
+
> **Two things this repo has learned the hard way, both on the two immediately preceding work
|
|
176
|
+
> orders:** Codex committed its own change and wrote a self-reported review into
|
|
177
|
+
> `WORK_ORDERS.md` on `SHELL-3` **and** on `SHELL-4`. Read `git log origin/main..HEAD` and
|
|
178
|
+
> `git status` before your own review; an implementer commit is a blocker to surface, and a register
|
|
179
|
+
> row naming a review the Orchestrator did not itself start is invalid.
|
|
180
|
+
|
|
181
|
+
### Mini-handover
|
|
182
|
+
|
|
183
|
+
Repo: `ui-core-micha` (`C:\Users\biglmi\Documents\webapps\ui-core-micha`), branch `main`.
|
|
184
|
+
WO: `work-orders/THEME-4.md`. **Wait for `THEME-3` to land and publish first** — same files.
|
|
185
|
+
Follow `orchestrate-codex`.
|