# Code Review — Theme | Field | Value | |-------|-------| | Library | `ZB.MOM.WW.Theme/` | | Packages | `ZB.MOM.WW.Theme` (Razor Class Library) | | Component spec | `components/ui-theme/spec/SPEC.md` | | Shared contract | `components/ui-theme/shared-contract/ZB.MOM.WW.Theme.md` | | Status | Reviewed | | Last reviewed | 2026-06-01 | | Reviewer | Claude (automated baseline) | | Commit reviewed | `5f75cd4` | | Open findings | 0 | ## Summary `ZB.MOM.WW.Theme` is a small, clean, well-scoped Blazor Razor Class Library: ten flat-namespace SSR components, two stylesheets (`theme.css` 379 lines, `layout.css` 191 lines), three vendored IBM Plex `.woff2` fonts, and two public enums. The component C# is correct and minimal — stateless render logic, no concurrency surface, no secret handling, sensible `[Parameter]`/`EditorRequired` choices, and `TreatWarningsAsErrors`. The 32 bUnit tests (20 `[Fact]` + 12 `[Theory]` cases) exercise the public render contract of every component plus a static-asset check on the corrected font path. The standout security-sensitive area — `LoginCard` (open-redirect + antiforgery) — is handled correctly by delegating both concerns to the consumer with explicit XML docs and in-markup security notes, matching the spec. No findings are Critical or High. The findings are concentrated in two themes: (1) one functional gap — the mobile hamburger relies on Bootstrap's collapse JS, an undocumented runtime dependency that contradicts the "no JavaScript" framing; and (2) CSS / token hygiene — a token-fidelity drift on `.chip-idle`, hardcoded hex values that violate the spec's "no hardcoded hex" rule, an undefined `.rail-ico` class, orphan/dead nav CSS, and a near-total absence of XML docs on the public parameter surface. ## Checklist coverage | # | Category | Examined | Notes | |---|----------|----------|-------| | 1 | Correctness & logic bugs | ☑ | Component render logic correct; `open="@Expanded"` boolean-attribute binding behaves (tests confirm); chip/variant `switch` mappings complete. No issues found. | | 2 | Public API surface & compatibility | ☑ | Flat `ZB.MOM.WW.Theme` namespace; minimal, intentional; `EditorRequired` applied; nullable annotations correct; no internal types leak. Surface matches contract. No issues found. | | 3 | Concurrency & thread safety | ☑ | Stateless components, no shared mutable state, no `async`/statics/singletons. No issues found (UI kit). | | 4 | Error handling & resilience | ☑ | No throwing paths; required params default to `string.Empty`; null `RenderFragment` slots are guarded (`is not null` / `IsNullOrEmpty`). No issues found. | | 5 | Security & secret handling | ☑ | No secrets/PII. `LoginCard` open-redirect + CSRF correctly delegated to consumer with docs. `Accent` interpolates into a `style` attr but is developer-supplied (not untrusted). No issues found. | | 6 | Performance & resource management | ☑ | No `IDisposable`, no allocations of note, fonts vendored once. No issues found. | | 7 | Spec & shared-contract adherence | ☑ | Component/parameter API matches SPEC §4 and the shared contract. Drifts found: `.chip-idle` foreground (Theme-002) and "no hardcoded hex" rule (Theme-003). | | 8 | Packaging, dependencies & project layout | ☑ | `net10.0` RCL, single package id `ZB.MOM.WW.Theme`, `FrameworkReference` only, version `0.1.0` (inherited from `Directory.Build.props`), static assets under `_content/`. No issues found. | | 9 | Testing coverage | ☑ | 32 tests cover every component's render contract + corrected font path. CSS-class wiring (e.g. `.rail-ico`, orphan nav CSS) is not asserted, which is how Theme-004/005 slipped through. | | 10 | Documentation & XML docs | ☑ | README/contract accurate. XML docs present only on `LoginCard`; absent on the other 9 components, all their parameters, and both enums (Theme-006). | ## Findings ### Theme-001 — Mobile hamburger toggle silently depends on Bootstrap collapse JS | | | |--|--| | Severity | Medium | | Category | Spec & shared-contract adherence | | Status | Resolved | | Location | `ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/ThemeShell.razor:5` | **Description** `ThemeShell` renders the narrow-viewport navigation toggle as a Bootstrap collapse trigger: `