From 5a8ca59a625460f62fcfe47c8c643cf86d41dc80 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 19:29:08 +0000 Subject: [PATCH 01/24] Start working record for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 specs/feature-451-flat-refresh-tokens/log.md diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md new file mode 100644 index 00000000..912d8d88 --- /dev/null +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -0,0 +1,8 @@ +# Log: Feature #451 + +One line per pipeline step: date and time of day (UTC), step, member, result. Lead decisions and escalations +are quoted in full. + +| Date | Step | Member | Result | +| ---- | ---- | ------ | ------ | +| 2026-11-28 19:29 | 1 Intake | Orchestrator | Feature #451 (flat refresh 1/9), branch claude/brave-noether-h51k4d off main 3acc54e | From e8d13aca291501c155ecbbc0a24c043c2120d2ef Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 19:33:42 +0000 Subject: [PATCH 02/24] Add spec for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + specs/feature-451-flat-refresh-tokens/spec.md | 144 ++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 specs/feature-451-flat-refresh-tokens/spec.md diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 912d8d88..ade6ed8d 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -6,3 +6,4 @@ are quoted in full. | Date | Step | Member | Result | | ---- | ---- | ------ | ------ | | 2026-11-28 19:29 | 1 Intake | Orchestrator | Feature #451 (flat refresh 1/9), branch claude/brave-noether-h51k4d off main 3acc54e | +| 2026-11-28 19:33 | 2a Spec | Lead | RESULT: DONE, spec.md written (10 criteria, no security area), removed tokens replaced at use sites (opus/medium · 113,351 tokens · 32 tool uses · 266 s · 58 in · 22,751 out · 2,204,570 cache read · 112,061 cache write · 728,236 weighted) | diff --git a/specs/feature-451-flat-refresh-tokens/spec.md b/specs/feature-451-flat-refresh-tokens/spec.md new file mode 100644 index 00000000..3af649b6 --- /dev/null +++ b/specs/feature-451-flat-refresh-tokens/spec.md @@ -0,0 +1,144 @@ +# Spec: Flat refresh 1/9 — design tokens, typography and MudBlazor theme + +Source: Issue #451 (part of #450) +Status: Draft + +## Problem + +The look of the web UI is defined twice: the `--dug-*` custom properties in `src/DockerUpdateGuard/wwwroot/app.css` +and the inline `MudTheme` in `src/DockerUpdateGuard/Components/Layout/MainLayout.razor.cs`. Both describe a glass look +(translucent surfaces, `backdrop-filter: blur`, gradients on the page, the hero panel and the metric cards, 45 px +shadows, 24 px and 16 px radii, a navy gradient drawer, cards that lift on hover). MudBlazor components do not use the +application's font at all: the theme sets no typography, so they fall back to MudBlazor's Roboto stack (checked +against MudBlazor 9.14.0). The flat refresh (#450) needs one flat token set for both themes, a second font for +headlines and figures, and a MudBlazor theme that matches the tokens, so that the later sub-issues can rebuild the +pages on it. After this feature every page keeps its current structure and renders flat. + +The target values are the tables of issue #451 (*Scope*, sections 1–4) and the concept document +`docs/ui-concept/flat-refresh/README.md`; this spec refers to them instead of repeating them. + +## Scenarios + +- S1: Given the light theme, when a user opens any page, then the page ground is the plain page color (no gradient), + every panel (hero panel, metric cards, section panels, empty-state panels, summary cards, top bar) is an opaque + surface with a 1 px hairline border and an 8 px radius, and nothing on the page is blurred, shadowed or drawn with + a gradient. +- S2: Given the dark theme (toggled, stored, or taken from the system preference), when a user opens any page, then + the page looks like S1 in the dark token values; no part of the page keeps a light or translucent surface. +- S3: Given any page, when it renders, then its title (the large heading of the page header, the dashboard's hero + panel and the error and not-found panels), the figures of the metric cards and the product name in the top bar are + in Space Grotesk, and all other text is in Inter, including text inside MudBlazor components (buttons, chips, + inputs, tables, alerts, menus). Page titles are 28 px, semibold, letter spacing −0.02 em; section titles are 15 px + semibold Inter; body text is 14 px with a line height of 1.45. +- S4: Given either theme, when MudBlazor components render (buttons, chips, alerts, inputs, table lines, dividers, + the drawer), then they take the theme colors of issue #451 section 4 and a 6 px default radius. +- S5: Given a clickable metric or summary card, when the user hovers it, then only its border changes to the control + border color — it neither lifts, nor gains a shadow, nor scales when pressed; when it receives keyboard focus it + shows a 2 px outline in the primary color 2 px away from it. +- S6: Given the navigation drawer, when it is shown, then it is a surface-colored panel with a hairline on its right, + its links and product name in the text color, its section label in the muted text color; the active link is + semibold on the subtle surface, and a hovered link gets the subtle surface. +- S7: Given a table with links or the resource sparklines of Runtime Containers, when it renders, then links use the + link color and the CPU, memory, received and sent sparklines use the four chart line colors. +- S8: Given the dashboard's warning and danger metric cards, when they render, then they look like every other metric + card except that their figure is in the attention or the danger color. + +## Errors and edge cases + +- E1: Space Grotesk cannot be loaded or loads slowly: the text first shows in the fallback of the stack (Inter, then + system fonts) and swaps when the font arrives; the page is usable throughout. +- E2: Page titles are MudBlazor headings of the `h3` level today (all 14 of them), and section titles of the `h5` + level; the selectors the issue names (`.page-header h1`, `.section-header h2`) match no element. The required look + of S3 holds for the headings as they are rendered, not for those selectors. +- E3: Filled MudBlazor chips and buttons in a status color (Primary, Info, Success, Warning, Error) — used today for + severities, update states and run states on every page that is not yet rebuilt — draw their label in the + palette's contrast text, which MudBlazor 9.14.0 defaults to white in both palettes. On the light-colored status + colors of the dark theme in issue #451 white reaches only 1.8:1 to 2.4:1; in the dark theme these labels use the page ground color + `#0F1216` instead (issue #451 names it for Primary only), which gives 7.8:1 or more. +- E4: MudBlazor draws its own elevation shadow on surfaces that set no elevation of zero: every table, the dashboard's + hero panel, the drawer and filled buttons. These show no drop shadow either. Menus, popovers, dialogs and snackbars, + which float over the content, stay visibly separated from it (by a border or their shadow). +- E5: Below 960 px table rows keep their card layout; each card is flat (surface, hairline border, control radius, + no shadow), and a row with a severity keeps its 3 px colored rail on the left. +- E6: The drawer is light in the light theme now: none of its texts (product name, section label, links, version + label and value) keeps a near-white color that would vanish on the white surface. +- E7: A user who asks for reduced motion still gets practically no transitions or animations. + +## Non-functional requirements + +- N1: No request leaves the application for a font or a style: `App.razor` and `app.css` contain no `http://` or + `https://` address, today or after the change. +- N2: Space Grotesk is the variable latin subset (weights 300–700, about 22 kB `woff2`) of + `docs/ui-concept/flat-refresh/mockups/fonts/`, shipped with its SIL Open Font License 1.1 text next to it. +- N3: Every text color and every chip of the token tables of issue #451, and every MudBlazor status color with its + contrast text, has a contrast of at least 4.5:1 against its background in both themes. (The Lead computed the + issue's values with the WCAG formula: the lowest are 4.82:1 for the light primary on the page ground and 5.81:1 for + the light Info chip.) +- N4: Compatibility: no route, action, text, computed value, CSS class name, breakpoint, storage key or render mode + changes; the server-rendered first paint stays light. + +## Acceptance criteria + +- AC1: `app.css` contains no `backdrop-filter`, no `linear-gradient`/`radial-gradient`, no `box-shadow` other than an + `inset` line or `none`, none of the removed tokens (`--dug-secondary`, `--dug-primary-strong`, `--dug-warning`, + `--dug-shadow-card`, `--dug-shadow-hover`, `--dug-blur`, `--dug-bg-gradient`), and no `.dug-dark` rule except the + token block; outside the `:root` and `.dug-dark` blocks every color is a token reference (or `inherit`, + `transparent`, `currentColor`, or a `color-mix` of a token) (S1, S2, E6). +- AC2: Every token of the tables of issue #451 section 1 exists in `:root` with its light value and, where the table + gives one, in `.dug-dark` with its dark value; `--dug-transition` stays (S1, S2). +- AC3: Space Grotesk and its license text are in `wwwroot/fonts`, the font is declared with `@font-face` and + `font-display: swap` next to Inter and preloaded in `App.razor` through `@Assets[...]` like `InterVariable.woff2`, + and the preload points at an existing asset (N1, N2, E1). +- AC4: The MudBlazor theme's default font family is the Inter stack and `h1`–`h4` use the Space Grotesk stack; page + titles (the `h3` headings of S3) render at 28 px, semibold, −0.02 em, section titles (the `h5` headings in section + headers) at 15 px semibold in Inter, figures (`.metric-value`) and the product name in Space Grotesk, body text at + 14 px / 1.45 in Inter (S3, E2). +- AC5: The theme the layout hands to MudBlazor carries, in light and in dark mode, the default radius `6px` and the + palette values of issue #451 section 4 (Secondary = the muted text color of each theme), and in dark mode the + contrast text `#0F1216` for Primary, Info, Success, Warning and Error (S4, E3). +- AC6: Each pair named in N3 reaches 4.5:1 in both themes, including the dark values the issue lets the implementer + adjust (N3, E3). +- AC7: Panels, hover, focus, drawer, links, sparklines and the warning and danger cards look as S1, S5, S6, S7 and S8 + say, and below 960 px the row cards as E5 says; reduced motion still switches transitions off (S1, S5–S8, E5, E7). +- AC8: Tables, the hero panel, the drawer and filled buttons show no MudBlazor elevation shadow, while menus, + popovers, dialogs and snackbars stay visibly separated from the content (E4). +- AC9: The dark-mode toggle, its storage key `dug-dark-mode`, the fallback to the system preference, the light first + paint and the class `dug-dark` on the layout behave as before, and the existing tests of the layout pass unchanged + (S2, N4). +- AC10: `docs/ARCHITECTURE.md` section 9 describes the token layer, the two fonts and the theme as built, and the Web + UI area document states the rules of *Area documents* below (N1, N3). + +## Out of scope + +- Markup changes of pages and layout, new components, removal of the hero panel or the metric cards (sub-issues + 2–9), renaming CSS classes. +- The series colors of the three resource charts on the Runtime Container detail page: `app.css` has no rule that + colors them, MudBlazor takes them from the chart's options in the page's markup, so they follow the chart tokens + with the rebuild of that page (#456). +- Column heads in sentence case, chip sizes, the 44 px control height and the content width of the concept document: + they come with the components and pages of the later sub-issues. +- Removal of `--dug-surface-solid` (#459). + +## Open questions + +- Should the removed tokens stay as aliases until 9/9 to keep this diff small, or be replaced at their use sites now? + Answered: replaced now, no aliases. Every use site is in `app.css` itself — no Razor, C# or script file references + a `--dug-*` property — and there are only five rules besides the ones this feature deletes anyway: the received + sparkline (`--dug-secondary` → `--dug-chart-net-rx`), `.table-link` and the hover of the runtime container name + icon (`--dug-primary-strong` → `--dug-link`), the warning metric card icon and `.summary-remediation--warning` + (`--dug-warning` → `--dug-attention`). Aliases would save about five lines, give old names new meanings and leave a + removal to 9/9 that this feature can do at no extra cost; the shadow, blur and gradient tokens leave with the rules + that use them, which the flat look removes in any case. +- Do the page-title and section-title selectors of the issue apply? Answered: no (from the code, see E2); the criteria + name the headings by what renders. +- Which contrast text do the dark status colors get? Answered: the page ground color + `#0F1216`, from the contrast computation (see E3). + +## Area documents + +- `docs/areas/web-ui.md`, *Light and dark mode*: both themes are flat and come from one set of design values with a + light and a dark variant; text and status labels keep at least 4.5:1 against their background in both; the UI's + fonts (Inter for text, Space Grotesk for titles and figures) and styles are served by the application itself, and + the browser loads nothing from another host for them. +- `docs/ARCHITECTURE.md`, section 9 *UI layer*: the token layer in `app.css`, the MudBlazor theme in the layout that + mirrors it, and the two self-hosted fonts. From 8cbd335464541eda3a08548f43b636a70e6c4c2d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 19:37:31 +0000 Subject: [PATCH 03/24] Log spec challenge for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index ade6ed8d..198db07d 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -7,3 +7,4 @@ are quoted in full. | ---- | ---- | ------ | ------ | | 2026-11-28 19:29 | 1 Intake | Orchestrator | Feature #451 (flat refresh 1/9), branch claude/brave-noether-h51k4d off main 3acc54e | | 2026-11-28 19:33 | 2a Spec | Lead | RESULT: DONE, spec.md written (10 criteria, no security area), removed tokens replaced at use sites (opus/medium · 113,351 tokens · 32 tool uses · 266 s · 58 in · 22,751 out · 2,204,570 cache read · 112,061 cache write · 728,236 weighted) | +| 2026-11-28 19:37 | 2a Spec challenge | Devil's Advocate | VERDICT: OBJECTIONS 2 major, 4 minor. Major: (1) dark tokens do not reach menus/popovers/dialogs rendered outside .dug-dark; (2) Typo.h4 entity headings on five pages contradict S3/AC4 and have no size. Minor: (3) body text 14px needs a MudBlazor Default/Body1 typography target; (4) focus outline belongs on .metric-card-link, summary cards are not clickable; (5) buttons and drawer links must not move/scale/shadow either; (6) AC1/2/6/7 need a stated verification (unit test reading app.css, contrast computation). (opus/medium · 77,859 tokens · 23 tool uses · 209 s · 44 in · 18,594 out · 1,161,360 cache read · 74,562 cache write · 488,569 weighted) | From 861731709cb5792799f9e381be6bcdcdd0613215 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 19:38:49 +0000 Subject: [PATCH 04/24] Revise spec for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + specs/feature-451-flat-refresh-tokens/spec.md | 91 ++++++++++++++----- 2 files changed, 68 insertions(+), 24 deletions(-) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 198db07d..39a8ba05 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -8,3 +8,4 @@ are quoted in full. | 2026-11-28 19:29 | 1 Intake | Orchestrator | Feature #451 (flat refresh 1/9), branch claude/brave-noether-h51k4d off main 3acc54e | | 2026-11-28 19:33 | 2a Spec | Lead | RESULT: DONE, spec.md written (10 criteria, no security area), removed tokens replaced at use sites (opus/medium · 113,351 tokens · 32 tool uses · 266 s · 58 in · 22,751 out · 2,204,570 cache read · 112,061 cache write · 728,236 weighted) | | 2026-11-28 19:37 | 2a Spec challenge | Devil's Advocate | VERDICT: OBJECTIONS 2 major, 4 minor. Major: (1) dark tokens do not reach menus/popovers/dialogs rendered outside .dug-dark; (2) Typo.h4 entity headings on five pages contradict S3/AC4 and have no size. Minor: (3) body text 14px needs a MudBlazor Default/Body1 typography target; (4) focus outline belongs on .metric-card-link, summary cards are not clickable; (5) buttons and drawer links must not move/scale/shadow either; (6) AC1/2/6/7 need a stated verification (unit test reading app.css, contrast computation). (opus/medium · 77,859 tokens · 23 tool uses · 209 s · 44 in · 18,594 out · 1,161,360 cache read · 74,562 cache write · 488,569 weighted) | +| 2026-11-28 19:38 | 2a Spec revise (challenge) | Lead | RESULT: DONE, all six objections accepted and answered in the spec's Challenge section; plan-check --spec passes (opus/medium · 15,755 tokens · 12 tool uses · 80 s · 14 in · 8,450 out · 725,840 cache read · 15,871 cache write · 196,790 weighted · continued) | diff --git a/specs/feature-451-flat-refresh-tokens/spec.md b/specs/feature-451-flat-refresh-tokens/spec.md index 3af649b6..85268925 100644 --- a/specs/feature-451-flat-refresh-tokens/spec.md +++ b/specs/feature-451-flat-refresh-tokens/spec.md @@ -26,18 +26,22 @@ The target values are the tables of issue #451 (*Scope*, sections 1–4) and the - S2: Given the dark theme (toggled, stored, or taken from the system preference), when a user opens any page, then the page looks like S1 in the dark token values; no part of the page keeps a light or translucent surface. - S3: Given any page, when it renders, then its title (the large heading of the page header, the dashboard's hero - panel and the error and not-found panels), the figures of the metric cards and the product name in the top bar are - in Space Grotesk, and all other text is in Inter, including text inside MudBlazor components (buttons, chips, - inputs, tables, alerts, menus). Page titles are 28 px, semibold, letter spacing −0.02 em; section titles are 15 px - semibold Inter; body text is 14 px with a line height of 1.45. + panel and the error and not-found panels), the entity name heading of a detail page, the figures of the metric + cards and the product name in the top bar are in Space Grotesk, and all other text is in Inter, including text + inside MudBlazor components (buttons, chips, inputs, tables, alerts, menus). Page titles are 28 px, semibold, + letter spacing −0.02 em; entity name headings are 20 px semibold; section titles are 15 px semibold Inter; body + text is 14 px with a line height of 1.45, in MudBlazor's text components as well as in plain markup. - S4: Given either theme, when MudBlazor components render (buttons, chips, alerts, inputs, table lines, dividers, the drawer), then they take the theme colors of issue #451 section 4 and a 6 px default radius. -- S5: Given a clickable metric or summary card, when the user hovers it, then only its border changes to the control - border color — it neither lifts, nor gains a shadow, nor scales when pressed; when it receives keyboard focus it - shows a 2 px outline in the primary color 2 px away from it. +- S5: Given a dashboard metric card (a card inside the link that leads to its page), when the user hovers it, then + only its border changes to the control border color — it neither lifts, nor gains a shadow, nor scales when + pressed; when its link receives keyboard focus the card shows a 2 px outline in the primary color 2 px away from + it. Summary cards are not clickable and do not change on hover. Buttons neither move, scale nor gain a shadow when + hovered or pressed. - S6: Given the navigation drawer, when it is shown, then it is a surface-colored panel with a hairline on its right, its links and product name in the text color, its section label in the muted text color; the active link is - semibold on the subtle surface, and a hovered link gets the subtle surface. + semibold on the subtle surface, and a hovered link gets the subtle surface without moving, scaling or gaining a + shadow. - S7: Given a table with links or the resource sparklines of Runtime Containers, when it renders, then links use the link color and the CPU, memory, received and sent sparklines use the four chart line colors. - S8: Given the dashboard's warning and danger metric cards, when they render, then they look like every other metric @@ -47,9 +51,16 @@ The target values are the tables of issue #451 (*Scope*, sections 1–4) and the - E1: Space Grotesk cannot be loaded or loads slowly: the text first shows in the fallback of the stack (Inter, then system fonts) and swaps when the font arrives; the page is usable throughout. -- E2: Page titles are MudBlazor headings of the `h3` level today (all 14 of them), and section titles of the `h5` - level; the selectors the issue names (`.page-header h1`, `.section-header h2`) match no element. The required look - of S3 holds for the headings as they are rendered, not for those selectors. +- E2: Page titles are MudBlazor headings of the `h3` level today (all 14 of them), the entity names of the detail + pages and of the single-instance view of Docker Instances headings of the `h4` level inside a section header + (five pages), and section titles of the `h5` level; the selectors the issue names (`.page-header h1`, + `.section-header h2`) match no element, and MudBlazor's default `h4` (34 px) would be larger than the page title. + The required look of S3 holds for the headings as they are rendered, not for those selectors. +- E8: MudBlazor renders menus, popovers, dialogs and snackbars outside the layout element that carries the dark + class (the compact metrics menu of the top bar, the container action confirmation). In the dark theme their + content takes the dark token values too — the muted text of the compact menu, say, is the dark muted grey on the + dark surface, not the light one (2.9:1). The dark values apply to the whole document while the layout is dark; + the class `dug-dark` stays on the layout (AC9). - E3: Filled MudBlazor chips and buttons in a status color (Primary, Info, Success, Warning, Error) — used today for severities, update states and run states on every page that is not yet rebuilt — draw their label in the palette's contrast text, which MudBlazor 9.14.0 defaults to white in both palettes. On the light-colored status @@ -71,9 +82,8 @@ The target values are the tables of issue #451 (*Scope*, sections 1–4) and the - N2: Space Grotesk is the variable latin subset (weights 300–700, about 22 kB `woff2`) of `docs/ui-concept/flat-refresh/mockups/fonts/`, shipped with its SIL Open Font License 1.1 text next to it. - N3: Every text color and every chip of the token tables of issue #451, and every MudBlazor status color with its - contrast text, has a contrast of at least 4.5:1 against its background in both themes. (The Lead computed the - issue's values with the WCAG formula: the lowest are 4.82:1 for the light primary on the page ground and 5.81:1 for - the light Info chip.) + contrast text, has a contrast of at least 4.5:1 against its background in both themes. (The issue's values pass: the + lowest are 4.82:1, light primary on the page ground, and 5.81:1, the light Info chip.) - N4: Compatibility: no route, action, text, computed value, CSS class name, breakpoint, storage key or render mode changes; the server-rendered first paint stays light. @@ -82,17 +92,20 @@ The target values are the tables of issue #451 (*Scope*, sections 1–4) and the - AC1: `app.css` contains no `backdrop-filter`, no `linear-gradient`/`radial-gradient`, no `box-shadow` other than an `inset` line or `none`, none of the removed tokens (`--dug-secondary`, `--dug-primary-strong`, `--dug-warning`, `--dug-shadow-card`, `--dug-shadow-hover`, `--dug-blur`, `--dug-bg-gradient`), and no `.dug-dark` rule except the - token block; outside the `:root` and `.dug-dark` blocks every color is a token reference (or `inherit`, + dark token block; outside the light and the dark token blocks every color is a token reference (or `inherit`, `transparent`, `currentColor`, or a `color-mix` of a token) (S1, S2, E6). - AC2: Every token of the tables of issue #451 section 1 exists in `:root` with its light value and, where the table - gives one, in `.dug-dark` with its dark value; `--dug-transition` stays (S1, S2). + gives one, in the dark token block with its dark value; `--dug-transition` stays. The dark block applies to the + whole document while the layout carries `dug-dark`, so that in dark mode a `--dug-*`-colored text inside the top + bar's compact metrics menu shows its dark value (S1, S2, E8). - AC3: Space Grotesk and its license text are in `wwwroot/fonts`, the font is declared with `@font-face` and `font-display: swap` next to Inter and preloaded in `App.razor` through `@Assets[...]` like `InterVariable.woff2`, and the preload points at an existing asset (N1, N2, E1). -- AC4: The MudBlazor theme's default font family is the Inter stack and `h1`–`h4` use the Space Grotesk stack; page - titles (the `h3` headings of S3) render at 28 px, semibold, −0.02 em, section titles (the `h5` headings in section - headers) at 15 px semibold in Inter, figures (`.metric-value`) and the product name in Space Grotesk, body text at - 14 px / 1.45 in Inter (S3, E2). +- AC4: The MudBlazor theme's default font family is the Inter stack and `h1`–`h4` use the Space Grotesk stack; its + default and `body1` typography are 14 px with a line height of 1.45, its `h3` (page titles) 28 px, semibold, + −0.02 em, its `h4` (entity names) 20 px semibold, and section titles (the `h5` headings in section headers) render + at 15 px semibold in Inter; figures (`.metric-value`) and the product name are in Space Grotesk, and the page body + is 14 px / 1.45 in Inter (S3, E2). - AC5: The theme the layout hands to MudBlazor carries, in light and in dark mode, the default radius `6px` and the palette values of issue #451 section 4 (Secondary = the muted text color of each theme), and in dark mode the contrast text `#0F1216` for Primary, Info, Success, Warning and Error (S4, E3). @@ -108,10 +121,19 @@ The target values are the tables of issue #451 (*Scope*, sections 1–4) and the - AC10: `docs/ARCHITECTURE.md` section 9 describes the token layer, the two fonts and the theme as built, and the Web UI area document states the rules of *Area documents* below (N1, N3). +Verification of these criteria (the plan names the tests): AC1, AC2's token values and dark-block selector, AC6 +and the CSS parts of AC3 and AC4 by a unit test that reads `wwwroot/app.css` (banned constructs, token blocks, +WCAG contrast of each N3 pair computed from the token values and the theme); AC3's preload and asset by a test of +`App.razor` or the static assets; AC4's theme part and AC5 by a render test of the layout in both modes reading the +theme handed to `MudThemeProvider`; AC9 by the existing layout tests. What only a browser shows — AC7, AC8, the +rendered fonts of AC4 and the dark compact menu of AC2 — is reviewed by hand in both themes and below 960 px, with +the before and after screenshots of the pull request, before step 9. + ## Out of scope - Markup changes of pages and layout, new components, removal of the hero panel or the metric cards (sub-issues - 2–9), renaming CSS classes. + 2–9), renaming CSS classes; the one exception is a change of the layout that E8 needs, should the plan carry + the dark class to a higher element. - The series colors of the three resource charts on the Runtime Container detail page: `app.css` has no rule that colors them, MudBlazor takes them from the chart's options in the page's markup, so they follow the chart tokens with the rebuild of that page (#456). @@ -126,9 +148,8 @@ The target values are the tables of issue #451 (*Scope*, sections 1–4) and the a `--dug-*` property — and there are only five rules besides the ones this feature deletes anyway: the received sparkline (`--dug-secondary` → `--dug-chart-net-rx`), `.table-link` and the hover of the runtime container name icon (`--dug-primary-strong` → `--dug-link`), the warning metric card icon and `.summary-remediation--warning` - (`--dug-warning` → `--dug-attention`). Aliases would save about five lines, give old names new meanings and leave a - removal to 9/9 that this feature can do at no extra cost; the shadow, blur and gradient tokens leave with the rules - that use them, which the flat look removes in any case. + (`--dug-warning` → `--dug-attention`). Aliases would save about five lines but give old names new meanings and defer a + free removal to 9/9; the shadow, blur and gradient tokens leave with the rules that use them. - Do the page-title and section-title selectors of the issue apply? Answered: no (from the code, see E2); the criteria name the headings by what renders. - Which contrast text do the dark status colors get? Answered: the page ground color @@ -142,3 +163,25 @@ The target values are the tables of issue #451 (*Scope*, sections 1–4) and the the browser loads nothing from another host for them. - `docs/ARCHITECTURE.md`, section 9 *UI layer*: the token layer in `app.css`, the MudBlazor theme in the layout that mirrors it, and the two self-hosted fonts. + +## Challenge + +- MAJOR 1 (dark tokens do not reach menus, popovers and dialogs): accepted. Checked: `MudPopoverProvider` and + `MudDialogProvider` sit beside `` in `MainLayout.razor`, so content MudBlazor + renders there resolves `--dug-*` against `:root`. Added E8; AC2 now requires the dark block to apply to the whole + document while the layout carries `dug-dark` and checks a `--dug-*`-colored text in the top bar's compact metrics + menu; AC1 speaks of the dark token block instead of a `.dug-dark` selector. How the block reaches the document (a + selector that matches while the layout is dark, or the class on a higher element) is the plan's choice; the class + on the layout stays (AC9). +- MAJOR 2 (`Typo.h4` entity names): accepted. Checked the five call sites. S3 now names the entity name heading as + Space Grotesk, 20 px semibold — below the 28 px page title and above the 15 px section title, in the concept's + range for figures and headlines; AC4 sets the theme's `h4` to it, and E2 lists the `h4` level. +- MINOR 3 (body text target): accepted. AC4 now sets the theme's default and `body1` typography to 14 px / 1.45 besides + the page body. +- MINOR 4 (focus outline of the metric card): accepted. Checked `Dashboard.razor`: the card is a `MudPaper` inside + `MudLink Class="metric-card-link"`. S5 now speaks of the dashboard metric card, outlined while its link has + keyboard focus, and says summary cards are not clickable and do not change on hover. +- MINOR 5 (buttons and drawer links on hover and press): accepted. S5 adds that buttons neither move, scale nor gain a + shadow when hovered or pressed; S6 that a hovered drawer link does not move, scale or gain a shadow. +- MINOR 6 (verification): accepted. A paragraph after the criteria names the kind of check for each criterion and + what stays a review by hand in a browser; the plan names the tests. From dcc6a3e1c0242df467829f856e4b6446ff588d9e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 19:45:05 +0000 Subject: [PATCH 05/24] Add plan and tasks for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- ...whole-document-while-the-layout-is-dark.md | 38 ++++ ...n-shadows-are-switched-off-in-the-theme.md | 36 ++++ docs/decisions/README.md | 2 + specs/feature-451-flat-refresh-tokens/log.md | 1 + specs/feature-451-flat-refresh-tokens/plan.md | 204 ++++++++++++++++++ specs/feature-451-flat-refresh-tokens/spec.md | 5 +- .../feature-451-flat-refresh-tokens/tasks.md | 16 ++ 7 files changed, 300 insertions(+), 2 deletions(-) create mode 100644 docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md create mode 100644 docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md create mode 100644 specs/feature-451-flat-refresh-tokens/plan.md create mode 100644 specs/feature-451-flat-refresh-tokens/tasks.md diff --git a/docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md b/docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md new file mode 100644 index 00000000..6b6eedfb --- /dev/null +++ b/docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md @@ -0,0 +1,38 @@ +# 0077: The dark theme's tokens apply to the whole document while the layout is dark + +- **Status:** Proposed +- **Date:** 2026-11-28 +- **Area:** Web UI +- **Source:** Issue #451 +- **Supersedes:** — + +## Context + +The dark theme sets the class `dug-dark` on the layout element, and `app.css` overrides the `--dug-*` tokens under +that class. MudBlazor renders menus, popovers and dialogs in providers that sit beside the layout, not inside it +(`Components/Layout/MainLayout.razor`), and the page body is outside it too, so their tokens resolve to the light +values while the rest of the page is dark. Once the flat refresh colors these surfaces from the tokens, a muted text in +the top bar's compact menu would read 2.9:1 on the dark surface. The class must stay on the layout: the layout tests +and the toggle rely on it ([Web UI](../areas/web-ui.md#light-and-dark-mode)). + +## Options considered + +1. **The dark token block also matches the document root while it contains the dark layout (chosen)** — one selector + in `app.css`, no markup or script; the body and every provider inherit the dark values. It needs `:has()` + (all current browsers); wrapped in the forgiving `:is()`, an older browser keeps at least the dark layout. +2. **Carry the class to an element that wraps the providers and the layout** — works for the providers, but changes + the layout's markup and where the class sits, and leaves the body light. +3. **Set the class on `` through JavaScript interop** — reaches everything, but adds a script no unit test + covers, a second source of the theme state and a flash before the call runs. + +## Decision + +The dark token block's selector is `:is(.dug-dark, :root:has(.dug-dark))`, so the dark values apply to the whole +document while the layout carries `dug-dark`; the class stays on the layout. Theme switching itself is unchanged +([Web UI](../areas/web-ui.md#light-and-dark-mode)). + +## Consequences + +Later sub-issues of #450 may color any surface, also one MudBlazor renders outside the layout, from the tokens. A +browser without `:has()` shows the dark layout with light menus and dialogs. Moving the theme state off the layout +element would make this selector obsolete. diff --git a/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md b/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md new file mode 100644 index 00000000..5f72555e --- /dev/null +++ b/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md @@ -0,0 +1,36 @@ +# 0078: MudBlazor elevation shadows are switched off in the theme + +- **Status:** Proposed +- **Date:** 2026-11-28 +- **Area:** Web UI +- **Source:** Issue #451 +- **Supersedes:** — + +## Context + +The flat refresh (#450) draws no shadows: panels are separated by hairlines. Besides the shadows of `app.css`, +MudBlazor draws its own: every surface with an elevation above zero (each table, the dashboard's hero panel, the +drawer) takes it from the theme's elevation levels, and filled buttons carry shadows written into MudBlazor's +stylesheet. Menus, popovers and dialogs use the same elevation levels to stand out from the content below. The pages +themselves are rebuilt only in later sub-issues, so this one may not change their markup. + +## Options considered + +1. **Every elevation level of the theme is `none`, filled buttons lose their shadow in `app.css`, and menus, + popovers and dialogs get a hairline border (chosen)** — one place for all present and future surfaces, checkable + in the theme; floating layers are separated the flat way. +2. **Override the shadow of each affected surface in `app.css`** — keeps the shadows of floating layers, but is a list + every new component of the later sub-issues must extend. +3. **Set `Elevation="0"` on each surface in the markup** — about twenty edits in pages this sub-issue must not + change, and filled buttons keep their shadow. + +## Decision + +The MudBlazor theme sets all of its elevation levels to `none`; `app.css` removes the shadow of filled buttons in +every state and borders menus, popovers and dialogs with the border token +([Web UI](../areas/web-ui.md#light-and-dark-mode)). + +## Consequences + +No component can show a shadow through its elevation any more; one that needs to stand out gets a border. A MudBlazor +update that adds literal shadows to another component needs a rule in `app.css`. diff --git a/docs/decisions/README.md b/docs/decisions/README.md index 1563d0d8..bc2b1762 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -137,4 +137,6 @@ once in the [area document](../areas/README.md) of the record's area, and the re | [0074](0074-a-docker-engine-stats-or-image-inspect-answer-that-is-not-a-json-object-is-an-invalid-response.md) | A Docker Engine stats or image inspect answer that is not a JSON object is an invalid response | Accepted | 2026-11-28 | | [0075](0075-a-docker-engine-container-list-or-image-history-that-is-not-a-json-array-is-an-invalid-response.md) | A Docker Engine container list or image history that is not a JSON array is an invalid response | Accepted | 2026-11-28 | | [0076](0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md) | The .NET release index is parsed as a remote JSON object, and an entry that is not one is left out | Accepted | 2026-11-28 | +| [0077](0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md) | The dark theme's tokens apply to the whole document while the layout is dark | Proposed | 2026-11-28 | +| [0078](0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md) | MudBlazor elevation shadows are switched off in the theme | Proposed | 2026-11-28 | \ No newline at end of file diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 39a8ba05..8e5ae227 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -9,3 +9,4 @@ are quoted in full. | 2026-11-28 19:33 | 2a Spec | Lead | RESULT: DONE, spec.md written (10 criteria, no security area), removed tokens replaced at use sites (opus/medium · 113,351 tokens · 32 tool uses · 266 s · 58 in · 22,751 out · 2,204,570 cache read · 112,061 cache write · 728,236 weighted) | | 2026-11-28 19:37 | 2a Spec challenge | Devil's Advocate | VERDICT: OBJECTIONS 2 major, 4 minor. Major: (1) dark tokens do not reach menus/popovers/dialogs rendered outside .dug-dark; (2) Typo.h4 entity headings on five pages contradict S3/AC4 and have no size. Minor: (3) body text 14px needs a MudBlazor Default/Body1 typography target; (4) focus outline belongs on .metric-card-link, summary cards are not clickable; (5) buttons and drawer links must not move/scale/shadow either; (6) AC1/2/6/7 need a stated verification (unit test reading app.css, contrast computation). (opus/medium · 77,859 tokens · 23 tool uses · 209 s · 44 in · 18,594 out · 1,161,360 cache read · 74,562 cache write · 488,569 weighted) | | 2026-11-28 19:38 | 2a Spec revise (challenge) | Lead | RESULT: DONE, all six objections accepted and answered in the spec's Challenge section; plan-check --spec passes (opus/medium · 15,755 tokens · 12 tool uses · 80 s · 14 in · 8,450 out · 725,840 cache read · 15,871 cache write · 196,790 weighted · continued) | +| 2026-11-28 19:45 | 2b Plan | Lead | RESULT: DONE, tier standard, no security area, spec Approved by Lead, plan.md and tasks.md written, decision records 0077 and 0078 proposed (opus/medium · 63,949 tokens · 22 tool uses · 367 s · 40 in · 36,295 out · 3,039,712 cache read · 63,267 cache write · 825,169 weighted · continued) | diff --git a/specs/feature-451-flat-refresh-tokens/plan.md b/specs/feature-451-flat-refresh-tokens/plan.md new file mode 100644 index 00000000..603041df --- /dev/null +++ b/specs/feature-451-flat-refresh-tokens/plan.md @@ -0,0 +1,204 @@ +# Plan: Flat refresh 1/9 — design tokens, typography and MudBlazor theme + +Source: Issue #451 | [spec.md](spec.md) +Tier: standard — a visible behavior change of the UI (stylesheet, theme, a shipped font) that creates, changes or removes no security control +Security areas touched: none + +## Problem / root cause + +See [spec.md](spec.md), *Problem*. + +## Verified facts + +| # | Claim | Evidence | Status | +| - | ----- | -------- | ------ | +| 1 | No file but `app.css` references a `--dug-*` property | `grep -rn "dug-…"` over `*.razor`, `*.cs`, `*.css`, `*.js` of the host: only `app.css` (the `dug-rail-*` hits are class names) | confirmed | +| 2 | Removed tokens are used by five rules besides the ones that go: received sparkline, `.table-link`, name-icon-link hover, warning card icon, `.summary-remediation--warning` | `app.css` lines 426–427, 557, 609, 710, 746 | confirmed | +| 3 | Page titles are `MudText Typo.h3` (14), entity names `Typo.h4` in a section header (5 pages), section titles `Typo.h5`; `.page-header h1` and `.section-header h2` match nothing | grep of `Typo.h[1-6]` under `Components/` | confirmed | +| 4 | MudBlazor 9.14.0 defaults: Roboto stack, every contrast text white in both palettes, `Default` .875rem/1.43, `Body1` 1rem/1.5, `H4` 2.125rem | scratch probe of `new MudTheme()`, `PaletteLight`, `PaletteDark` | confirmed | +| 5 | A typography without a font family takes `Default`'s; families with spaces are quoted; `Shadows.Elevation` (26 entries) feeds `--mud-elevation-N` | scratch probe of `MudThemeProvider.BuildTheme()` | confirmed | +| 6 | Filled buttons' shadows are literals in `MudBlazor.min.css` (`.mud-button-filled`, `:hover`, `:active`), not elevation variables | `MudBlazor.min.css` 9.14.0 | confirmed | +| 7 | The popover, dialog and snackbar providers sit beside `MudLayout` | `MainLayout.razor` lines 3–8 | confirmed | +| 8 | Every token-table text and chip pair of #451 passes 4.5:1; white on the dark Info, Success, Warning, Error, Primary reads 1.8–2.4:1, `#0F1216` 7.9–10.2:1 | WCAG formula over the issue's values (Lead, scratch script) | confirmed | +| 9 | The font and its OFL text are in `docs/ui-concept/flat-refresh/mockups/fonts/` (22,288 bytes) | `ls -la` | confirmed | +| 10 | `.dockerignore` keeps `wwwroot/fonts/*` and a `.txt` | `.dockerignore`: `*.md` at the root, `docs/` | confirmed | +| 11 | `HostProjectDirectory.GetPath()` resolves `src/DockerUpdateGuard` from the test output | `Helper/HostProjectDirectory.cs` | confirmed | +| 12 | No Content-Security-Policy header limits fonts | grep `Content-Security-Policy` in `src` | confirmed | +| 13 | An unsupported `:has()` inside `:is()` drops only that branch | Selectors Level 4, *forgiving selector list* | confirmed | + +## Tests per criterion + +| AC | Test(s) | Test file | +| -- | ------- | --------- | +| AC1 | `AppStylesheetContainsNoBlurGradientOrElevationShadow`, `AppStylesheetContainsNoRemovedToken`, `AppStylesheetHasNoDarkRuleBesideTokenBlock`, `AppStylesheetRulesOutsideTokenBlocksUseOnlyTokenColors` | `AppStylesheetTests.cs` | +| AC2 | `AppStylesheetRootBlockHoldsEveryLightToken`, `AppStylesheetDarkBlockHoldsEveryDarkToken`, `AppStylesheetDarkBlockAppliesToDocumentWhileLayoutIsDark`; manual: compact menu muted text in dark mode (below) | `AppStylesheetTests.cs` | +| AC3 | `AppStylesheetDeclaresSpaceGroteskFontFace`; `AppPreloadsShippedSpaceGroteskFont`, `AppAndStylesheetReferenceNoExternalAddress` | `AppStylesheetTests.cs`; `AppTests.cs` | +| AC4 | `MainLayoutThemeUsesInterAndSpaceGroteskTypography`; `AppStylesheetSetsTextAndDisplayFonts`; manual: rendered fonts | `MainLayoutRenderTests.cs`; `AppStylesheetTests.cs` | +| AC5 | `MainLayoutThemeCarriesLightPaletteAndRadius`, `MainLayoutThemeInDarkModeCarriesDarkPaletteAndContrastTexts` | `MainLayoutRenderTests.cs` | +| AC6 | `AppStylesheetTokenPairsReachMinimumContrast` (one row per pair and theme), `MainLayoutThemeStatusColorsReachMinimumContrast`; `ContrastRatioCalculateBlackOnWhiteReturnsTwentyOne`, `ContrastRatioCalculateSameColorReturnsOne` for the helper | `AppStylesheetTests.cs`, `MainLayoutRenderTests.cs`, `ContrastRatioTests.cs` | +| AC7 | `AppStylesheetInteractionRulesNeitherMoveNorScale`, `AppStylesheetKeepsReducedMotionRule`; manual: screenshots (below) | `AppStylesheetTests.cs` | +| AC8 | `MainLayoutThemeSwitchesOffElevationShadows`; `AppStylesheetFlattensFilledButtonsAndBordersFloatingLayers`; manual: screenshots | `MainLayoutRenderTests.cs`; `AppStylesheetTests.cs` | +| AC9 | the existing `MainLayoutRenderTests` and `MainLayoutTests`, unchanged | — | +| AC10 | check: the Reviewer reads ARCHITECTURE §9 and `web-ui.md` against the code in step 8 | — | + +`StylesheetReaderTests` covers the helper, its line-ending normalizer with CRLF input first (`docs/UNIT_TESTS.md`, +*Tests that read repository documents*): `app.css` and `App.razor` are checked out with CRLF. + +Manual (AC2, AC4, AC7, AC8, AC9): the orchestrator runs the branch head locally (`dotnet run` of the host against a +development database) and takes the pull request's before and after screenshots — Dashboard, Runtime Containers and +a detail page, light and dark, at 1360 px and 400 px wide, plus the top bar's compact menu open in dark mode and a +keyboard-focused metric card — on the stamped head before step 8; the Reviewer checks them against S1–S8, E4, E5, +E8 in round 1. + +## Approach + +Layout: no new output; every value comes from the issue's tables, the spec and this section. + +**Font.** Copy `SpaceGrotesk-Variable-latin.woff2` and `SpaceGrotesk-OFL.txt` from +`docs/ui-concept/flat-refresh/mockups/fonts/` to `src/DockerUpdateGuard/wwwroot/fonts/` unchanged. `@font-face` +`"Space Grotesk"`, `url("fonts/SpaceGrotesk-Variable-latin.woff2") format("woff2")`, weight `300 700`, normal, +`font-display: swap`, after Inter's. `App.razor`: a second preload line after Inter's, same form, +`@Assets["fonts/SpaceGrotesk-Variable-latin.woff2"]`. + +**Tokens.** `:root` holds every light value of #451 section 1 (also radii and font stacks) plus `--dug-transition`; +the dark block, selector `:is(.dug-dark, :root:has(.dug-dark))` (E8, [0077](../../docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md)), +holds the dark values. Hex values in upper case as in the issue (tests compare case-insensitively). The seven +removed tokens and every `.dug-dark …` rule go; replacements of the use sites as the spec's *Open questions* say. + +**Rules** (`app.css`, outside the token blocks only `var(--dug-…)`, `inherit`, `transparent`, `currentColor`, +`color-mix` of a token; `box-shadow` only `inset` or `none`): +- `body`: `--dug-font-text`, `0.875rem`, line height `1.45`. `.app-layout`: `--dug-bg-page`. +- Panels (`.hero-panel`, `.metric-card`, `.section-paper`, `.empty-state-panel`, `.summary-card`, `.mud-paper.app-topbar`): + `--dug-surface`, `1px solid --dug-border`, `--dug-radius-lg`, no shadow, no blur. The `::before` stripes, the + tinted backgrounds of hero, accent, warning and danger cards go; `.metric-card--warning .metric-value` / + `--danger .metric-value` take `--dug-attention` / `--dug-danger`, their icons too. Top-bar meta cards: + `--dug-surface-subtle`. +- Hover/press: `.metric-card-link:hover .metric-card` only `border-color: --dug-border-control`; + `.metric-card-link:focus-visible .metric-card` the 2 px `--dug-primary` outline at 2 px, `.metric-card-link:focus-visible` + no own outline; no `transform` in any hover or `:active` rule (cards, nav links, `.mud-button-root`); transitions + only of `border-color` and `background-color`; `.mud-button-root:focus-visible` keeps its outline. The rule + `.metric-card:focus-visible, .summary-card:focus-visible` drops those two selectors. +- Filled buttons and floating layers ([0078](../../docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md)): + `.mud-button-filled` with `:hover`, `:active`, `:focus-visible` → `box-shadow: none`; `.mud-popover`, `.mud-dialog` + → `border: 1px solid var(--dug-border)`. +- Drawer (`.app-drawer .mud-drawer-content`): `--dug-surface`, `border-right: 1px solid --dug-border`, no shadow; + brand title, nav links, version value in `--dug-text`; `.nav-section-label`, version label `--dug-text-muted`; + `.mud-nav-link.active` weight 600, color `--dug-text`, background `--dug-surface-subtle`, no border or shadow; + hover background `--dug-surface-subtle`. `.app-brand__logo` loses its shadow. +- Typography in CSS: `.metric-value` and `.app-brand__title` `--dug-font-display`, weight 600; the dead rules + `.page-header h1, …` and `.section-header h2` are deleted (the theme sizes the headings). +- Tables: `.section-table .mud-table-container` `--dug-surface`, `--dug-border`; head cells' bottom border + `--dug-border`; `.table-link` and `:hover` `--dug-link` (hover underlined); below 960 px row cards `--dug-surface`, + `--dug-border`, `--dug-radius-md`, rails as `inset` alone. +- Sparklines: `--dug-chart-cpu`, `-memory`, `-net-rx`, `-net-tx`. +- `prefers-reduced-motion` block unchanged. + +**Theme** (`MainLayout.razor.cs`, field `_theme`, still private): +- `LayoutProperties.DefaultBorderRadius = "6px"`; `Shadows = new Shadow { Elevation = 26 × "none" }`. +- `Typography`: Inter stack `["Inter", "Segoe UI", "Arial", "Helvetica", "sans-serif"]`, Space Grotesk stack + `["Space Grotesk", "Inter", "Segoe UI", "Arial", "sans-serif"]`. `Default` and `Body1`: Inter, `.875rem`, `1.45`, + `400`. `H1`, `H2`: Space Grotesk (sizes default). `H3`: Space Grotesk, `1.75rem`, `600`, `-0.02em`, line height + `1.2`. `H4`: Space Grotesk, `1.25rem`, `600`, `0`, `1.3`. `H5`: `.9375rem`, `600`, `0`, `1.4` (Inter by default). +- `PaletteLight`: the #451 values; `Secondary` `#5B6471`; `Divider`, `LinesDefault` `#E3E6EB`; `TableLines` + `#EEF0F3`; `LinesInputs` `#C9CED6`; `TableHover` `#FAFBFC`; contrast texts stay white. +- `PaletteDark`: the #451 values; `Secondary` `#9BA5B3`; `Divider`, `LinesDefault` `#272D36`; `TableLines` + `#20262E`; `LinesInputs` `#3A424E`; `TableHover` `#1B2027`; `PrimaryContrastText`, `SecondaryContrastText`, + `InfoContrastText`, `SuccessContrastText`, `WarningContrastText`, `ErrorContrastText` `#0F1216`. +The two stacks are private constants or static readonly arrays of `MainLayout` (one definition each); the CSS stacks +are the same text. + +**Test helpers** (Tester, `Helper/`): `StylesheetReader` reads a host file through `HostProjectDirectory`, normalizes +`\r\n`, finds a rule by its exact selector text and reads its custom properties; `ContrastRatio` computes the WCAG +ratio of two `#RRGGBB` colors. `AppStylesheetTests` keeps the expected token table of #451 (both themes) as data +rows; the pairs of N3 are: `--dug-text`, `-text-muted`, `-text-faint`, `-icon`, `-primary`, `-link`, `-attention`, +`-danger`, `-success`, `-info` each on `--dug-bg-page`, `-surface`, `-surface-subtle`; `--dug-on-primary` on +`--dug-primary`; each chip `-fg` on its `-bg`. The theme test pairs each status color (Primary, Secondary, Info, +Success, Warning, Error) with its contrast text in both palettes. A dark-mode render uses the existing toggle path of +`MainLayoutRenderTests` (`CreateContext`, the `.app-topbar__theme-toggle` click) and reads `MudThemeProvider`'s +`Theme` and `IsDarkMode`. + +Early draft PR: no + +## Options considered + +- E8: the selector on the document root (chosen), a wrapper element around providers and layout, or the class on + `` by script — see [0077](../../docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md). +- E4: theme-wide `none` elevations (chosen), per-surface CSS overrides, `Elevation="0"` in the markup — see + [0078](../../docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md). +- Removed tokens as aliases until 9/9: lost, see spec *Open questions*. +- Theme in its own type (`ApplicationTheme.Create()`): lost — one consumer, the render test reaches it through + `MudThemeProvider`, and a new type adds API for nothing. +- A test reading `app.css` linked into the test output by the test `.csproj`: lost — `HostProjectDirectory` already + serves the shipped files without a build change. + +## Affected projects and types + +| Project | Type / file | Change | +| ------- | ----------- | ------ | +| DockerUpdateGuard | `wwwroot/app.css` | tokens and rules as *Approach* | +| DockerUpdateGuard | `wwwroot/fonts/SpaceGrotesk-Variable-latin.woff2`, `SpaceGrotesk-OFL.txt` | new, copied | +| DockerUpdateGuard | `Components/App.razor` | preload line | +| DockerUpdateGuard | `Components/Layout/MainLayout.razor.cs` | `_theme` initializer, two font-stack constants | +| DockerUpdateGuard.Tests | `AppStylesheetTests`, `AppTests`, `StylesheetReaderTests`, `ContrastRatioTests`, `Helper/StylesheetReader`, `Helper/ContrastRatio`; `MainLayoutRenderTests` | new; new tests added | + +## Signatures (for the Dev's skeleton) + +None: the production change adds no member another type calls (the theme stays the private field `_theme`). The test +helpers are the Tester's (step 5), internal static classes without nested types: `StylesheetReader.ReadHostFile`, +`NormalizeLineEndings`, `GetRuleBody`, `GetCustomProperties`; `ContrastRatio.Calculate` (two `#RRGGBB` strings, +returns `double`). + +## Test files + +`src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs`, `AppTests.cs`, `StylesheetReaderTests.cs`, +`ContrastRatioTests.cs`, `Helper/StylesheetReader.cs`, `Helper/ContrastRatio.cs` (new); +`MainLayoutRenderTests.cs` (new tests, existing ones unchanged). + +Existing test code that calls a changed signature: none. + +Files of the change no unit test can cover: none in the coverage scope. `app.css` and the font are no coverage +pathspecs; the `App.razor` preload line is one changed `.razor` line no test renders (`App` needs the full host), +which the covered `_theme` lines outweigh in the new-code figure. + +## Areas + +- `docs/areas/web-ui.md` (3638 words, +110 words): *Light and dark mode* gains the rules of the spec's *Area + documents* (flat themes from one set of design values, 4.5:1, self-hosted fonts and styles, dark values on menus + and dialogs too, no shadows, floating layers bordered); *Related decisions* lists 0077 and 0078. + +## Documentation updates + +Written by the Dev once the code is green, against that code: +- `docs/areas/web-ui.md`: as *Areas*. +- `docs/ARCHITECTURE.md`, section 9: the design-system sentence becomes the token layer in `app.css` (light in + `:root`, dark block reaching the whole document, linked to 0077), the MudBlazor theme in `MainLayout` mirroring it + with elevations off (0078), and the two self-hosted fonts (Inter for text, Space Grotesk for titles and figures). +- The sweep found no other enumeration: no `README.md`, `INSTALL.md` or `DOCKER.md` text names fonts, colors or the + theme; `docs/ui-concept/flat-refresh/README.md` stays the concept. No changelog file (release notes come from the + PR label, `enhancement`). No edit of `.squad/project.md` or *Test doubles* (the helpers are no doubles). + +## Architecture check + +No guarantee of `.squad/project.md` is touched: no I/O, data, integration or layering change; wiring stays in the +host. Theme state stays in `MainLayout` (`dug-dark` on the layout, storage key unchanged). ARCHITECTURE §9 is updated +as above. + +## Security considerations + +- [x] No limits: the change parses no input. +- [x] No exception reaches a user-visible message: none. +- The font is a passive static asset under the SIL OFL 1.1, served from the application; no external host, no script, + no package. + +## Decision records + +- `docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md` (Proposed) +- `docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md` (Proposed) + +## Out of scope / follow-ups + +As the spec's *Out of scope*; the detail page's chart series colors go with #456. + +Image build check (Dev, before step 8): the change adds static web assets and edits a `.razor` file, so the Dev runs +the *Image build check* of `.squad/stack.md` and lists `publish/wwwroot/fonts/` with the Space Grotesk file and its +license. diff --git a/specs/feature-451-flat-refresh-tokens/spec.md b/specs/feature-451-flat-refresh-tokens/spec.md index 85268925..8b79af6d 100644 --- a/specs/feature-451-flat-refresh-tokens/spec.md +++ b/specs/feature-451-flat-refresh-tokens/spec.md @@ -1,7 +1,7 @@ # Spec: Flat refresh 1/9 — design tokens, typography and MudBlazor theme Source: Issue #451 (part of #450) -Status: Draft +Status: Approved by Lead ## Problem @@ -107,7 +107,8 @@ The target values are the tables of issue #451 (*Scope*, sections 1–4) and the at 15 px semibold in Inter; figures (`.metric-value`) and the product name are in Space Grotesk, and the page body is 14 px / 1.45 in Inter (S3, E2). - AC5: The theme the layout hands to MudBlazor carries, in light and in dark mode, the default radius `6px` and the - palette values of issue #451 section 4 (Secondary = the muted text color of each theme), and in dark mode the + palette values of issue #451 section 4 (Secondary = the muted text color of each theme; of its "line colors" + the input lines take the control border color, which the concept assigns to inputs, and row hover the subtle surface), and in dark mode the contrast text `#0F1216` for Primary, Info, Success, Warning and Error (S4, E3). - AC6: Each pair named in N3 reaches 4.5:1 in both themes, including the dark values the issue lets the implementer adjust (N3, E3). diff --git a/specs/feature-451-flat-refresh-tokens/tasks.md b/specs/feature-451-flat-refresh-tokens/tasks.md new file mode 100644 index 00000000..8a067956 --- /dev/null +++ b/specs/feature-451-flat-refresh-tokens/tasks.md @@ -0,0 +1,16 @@ +# Tasks: Flat refresh 1/9 — design tokens, typography and MudBlazor theme + +Plan: [plan.md](plan.md) + +| # | Group | Task | Files | Criteria | Depends on | Owner | Done | +| - | ----- | ---- | ----- | -------- | ---------- | ----- | ---- | +| 1 | G1 | Skeleton: no new API (stylesheet, font and preload only) | — | — | — | Dev | [ ] | +| 2 | G1 | Test helpers `StylesheetReader` and `ContrastRatio` with their tests (normalizer with CRLF input first) | `src/Tests/DockerUpdateGuard.Tests/Helper/StylesheetReader.cs`, `src/Tests/DockerUpdateGuard.Tests/Helper/ContrastRatio.cs`, `src/Tests/DockerUpdateGuard.Tests/StylesheetReaderTests.cs`, `src/Tests/DockerUpdateGuard.Tests/ContrastRatioTests.cs` | AC1, AC2, AC6 | 1 | Tester | [ ] | +| 3 | G1 | Failing tests of the stylesheet and the preload | `src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs`, `src/Tests/DockerUpdateGuard.Tests/AppTests.cs` | AC1, AC2, AC3, AC4, AC6, AC7, AC8 | 2 | Tester | [ ] | +| 4 | G1 | Copy the font and its license, add `@font-face` and the preload, rewrite tokens and rules of `app.css` | `src/DockerUpdateGuard/wwwroot/fonts/`, `src/DockerUpdateGuard/wwwroot/app.css`, `src/DockerUpdateGuard/Components/App.razor` | AC1, AC2, AC3, AC4, AC6, AC7, AC8 | 3 | Dev | [ ] | +| 5 | G2 | Skeleton: no new API (the theme stays the private field `_theme`) | — | — | 4 | Dev | [ ] | +| 6 | G2 | Failing theme tests in both modes (typography, palettes, contrast texts, elevations, radius) | `src/Tests/DockerUpdateGuard.Tests/MainLayoutRenderTests.cs` | AC4, AC5, AC6, AC8, AC9 | 5 | Tester | [ ] | +| 7 | G2 | Theme of `MainLayout`: radius, shadows, typography, both palettes | `src/DockerUpdateGuard/Components/Layout/MainLayout.razor.cs` | AC4, AC5, AC6, AC8, AC9 | 6 | Dev | [ ] | +| 8 | G2 | Image build check: the font and its license in `publish/wwwroot/fonts/` | — | AC3 | 7 | Dev | [ ] | +| 9 | G2 | Local run and the screenshots of the plan's manual check | — | AC2, AC4, AC7, AC8, AC9 | 7 | Orchestrator | [ ] | +| 10 | G2 | Documentation: Web UI *Light and dark mode* and *Related decisions*, ARCHITECTURE section 9 | `docs/areas/web-ui.md`, `docs/ARCHITECTURE.md` | AC10 | 7 | Dev | [ ] | From 678c453f5f5a30317da45730ed285a66fca09174 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 19:47:48 +0000 Subject: [PATCH 06/24] Add plan challenge notes for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 2 ++ specs/feature-451-flat-refresh-tokens/plan.md | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 8e5ae227..65b9e75d 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -10,3 +10,5 @@ are quoted in full. | 2026-11-28 19:37 | 2a Spec challenge | Devil's Advocate | VERDICT: OBJECTIONS 2 major, 4 minor. Major: (1) dark tokens do not reach menus/popovers/dialogs rendered outside .dug-dark; (2) Typo.h4 entity headings on five pages contradict S3/AC4 and have no size. Minor: (3) body text 14px needs a MudBlazor Default/Body1 typography target; (4) focus outline belongs on .metric-card-link, summary cards are not clickable; (5) buttons and drawer links must not move/scale/shadow either; (6) AC1/2/6/7 need a stated verification (unit test reading app.css, contrast computation). (opus/medium · 77,859 tokens · 23 tool uses · 209 s · 44 in · 18,594 out · 1,161,360 cache read · 74,562 cache write · 488,569 weighted) | | 2026-11-28 19:38 | 2a Spec revise (challenge) | Lead | RESULT: DONE, all six objections accepted and answered in the spec's Challenge section; plan-check --spec passes (opus/medium · 15,755 tokens · 12 tool uses · 80 s · 14 in · 8,450 out · 725,840 cache read · 15,871 cache write · 196,790 weighted · continued) | | 2026-11-28 19:45 | 2b Plan | Lead | RESULT: DONE, tier standard, no security area, spec Approved by Lead, plan.md and tasks.md written, decision records 0077 and 0078 proposed (opus/medium · 63,949 tokens · 22 tool uses · 367 s · 40 in · 36,295 out · 3,039,712 cache read · 63,267 cache write · 825,169 weighted · continued) | +| 2026-11-28 19:47 | 2b Plan challenge | Devil's Advocate | VERDICT: OBJECTIONS 0 major, 1 minor. Minor: scope the floating-layer border rule to .mud-popover:not(.mud-tooltip), .mud-dialog so tooltips get no hairline; confirm with rendered markup. (opus/medium · 81,022 tokens · 21 tool uses · 151 s · 40 in · 13,421 out · 1,148,041 cache read · 79,501 cache write · 447,847 weighted) | +| 2026-11-28 19:47 | 2b Challenge notes | Orchestrator | minor objections appended verbatim to plan.md | diff --git a/specs/feature-451-flat-refresh-tokens/plan.md b/specs/feature-451-flat-refresh-tokens/plan.md index 603041df..eed0ee19 100644 --- a/specs/feature-451-flat-refresh-tokens/plan.md +++ b/specs/feature-451-flat-refresh-tokens/plan.md @@ -202,3 +202,20 @@ As the spec's *Out of scope*; the detail page's chart series colors go with #456 Image build check (Dev, before step 8): the change adds static web assets and edits a `.razor` file, so the Dev runs the *Image build check* of `.squad/stack.md` and lists `publish/wwwroot/fonts/` with the Space Grotesk file and its license. + +## Challenge notes + +Devil's Advocate, plan mode, specs/feature-451-flat-refresh-tokens/ + +The plan holds up. I checked these claims myself and they are true: +- **Five use sites (fact 2).** The removed tokens are used by exactly five rules outside the ones that get deleted: `/home/user/DockerUpdateGuard/src/DockerUpdateGuard/wwwroot/app.css` lines 426–427, 557, 609, 710 and 746. Line 392 is the accent stripe, which is removed anyway. No `.razor`, `.cs` or `.js` file references a `--dug-*` property. +- **Headings (fact 3).** The code has 14 `Typo.h3` (including Error and NotFound), 5 `Typo.h4` (the entity names), 31 `Typo.h5` and no h1 or h2. Every h5 is a section-header title except the top-bar brand title, and `.app-brand__title` sets its own font-size (app.css line 141), so the theme's new H5 does not resize it. `.page-header h1` (line 346) and `.section-header h2` (line 523) match no element. +- **Button shadows (fact 6).** In `MudBlazor.min.css` 9.14.0 the shadows of `.mud-button-filled` and its `:hover`, `:focus-visible` and `:active` states are literal values. No color variant (`-primary` and so on) sets its own shadow. `app.css` is linked after `MudBlazor.min.css` (`App.razor` lines 9–10), so a `box-shadow: none` with the same specificity wins. +- **Providers (fact 7).** The popover, dialog and snackbar providers sit beside `MudLayout` (`MainLayout.razor` lines 3–8). The drawer is the only `Elevation="1"` in the markup. `ContainerActionConfirmation` is a `MudDialog`, which keeps MudBlazor's literal dialog shadow and gains the border, so E4 holds. +- **Contrast.** I recomputed the theme pairs: white on the light Primary, Secondary, Info, Success, Warning and Error is 5.17 to 6.70:1. `#0F1216` on the dark status colors is 7.87 to 10.19:1. +- **Files (facts 9, 10, 12).** The font file is 22,288 bytes and its license text is next to it. `.dockerignore` excludes only `*.md`, `docs/` and secrets, not `wwwroot/fonts`. No Content-Security-Policy exists in `src`. +- **No-change outcome.** None applies: the feature does not exist yet and no accepted record covers it. + +Objections: + +1. **minor:** Scope the floating-layer border rule to `.mud-popover:not(.mud-tooltip), .mud-dialog`, not bare `.mud-popover`. Why: MudBlazor renders `MudTooltip` as a popover carrying the `mud-tooltip` class, and this app uses tooltips (`RuntimeContainerDetail.razor` lines 44, 390, 442; `ObservedImageDetail.razor` line 197; `MyImageDetail.razor` line 181). They are dark-grey (`.mud-tooltip-default` uses `--mud-palette-gray-darker`), so bare `.mud-popover` would put a hairline around them and their arrow that no criterion asks for. My evidence for the tooltip markup is indirect: the CSS gives `.mud-tooltip` its own z-index, which only makes sense on the popover element, and the class names appear in the 9.14.0 DLL. The Dev should confirm it with the rendered markup while doing the screenshots: hover a digest on the Runtime Container detail page in both themes. From 2c96e4a6dd1216168cf16313bff37ad70a5b093b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 19:48:03 +0000 Subject: [PATCH 07/24] Log skipped skeleton for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 65b9e75d..7dfef581 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -12,3 +12,4 @@ are quoted in full. | 2026-11-28 19:45 | 2b Plan | Lead | RESULT: DONE, tier standard, no security area, spec Approved by Lead, plan.md and tasks.md written, decision records 0077 and 0078 proposed (opus/medium · 63,949 tokens · 22 tool uses · 367 s · 40 in · 36,295 out · 3,039,712 cache read · 63,267 cache write · 825,169 weighted · continued) | | 2026-11-28 19:47 | 2b Plan challenge | Devil's Advocate | VERDICT: OBJECTIONS 0 major, 1 minor. Minor: scope the floating-layer border rule to .mud-popover:not(.mud-tooltip), .mud-dialog so tooltips get no hairline; confirm with rendered markup. (opus/medium · 81,022 tokens · 21 tool uses · 151 s · 40 in · 13,421 out · 1,148,041 cache read · 79,501 cache write · 447,847 weighted) | | 2026-11-28 19:47 | 2b Challenge notes | Orchestrator | minor objections appended verbatim to plan.md | +| 2026-11-28 19:47 | 4 Skeleton skipped (G1) | Orchestrator | skipped — plan Signatures: None, production change adds no member another type calls | From 1fe6726c1338b50534fad57f0978f5f5ab3a1889 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 19:57:14 +0000 Subject: [PATCH 08/24] Add failing tests for stylesheet and font of feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + .../AppStylesheetTests.cs | 816 ++++++++++++++++++ src/Tests/DockerUpdateGuard.Tests/AppTests.cs | 93 ++ .../ContrastRatioTests.cs | 79 ++ .../Helper/ContrastRatio.cs | 81 ++ .../Helper/StylesheetReader.cs | 372 ++++++++ .../StylesheetReaderTests.cs | 160 ++++ 7 files changed, 1602 insertions(+) create mode 100644 src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs create mode 100644 src/Tests/DockerUpdateGuard.Tests/AppTests.cs create mode 100644 src/Tests/DockerUpdateGuard.Tests/ContrastRatioTests.cs create mode 100644 src/Tests/DockerUpdateGuard.Tests/Helper/ContrastRatio.cs create mode 100644 src/Tests/DockerUpdateGuard.Tests/Helper/StylesheetReader.cs create mode 100644 src/Tests/DockerUpdateGuard.Tests/StylesheetReaderTests.cs diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 7dfef581..9194774e 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -13,3 +13,4 @@ are quoted in full. | 2026-11-28 19:47 | 2b Plan challenge | Devil's Advocate | VERDICT: OBJECTIONS 0 major, 1 minor. Minor: scope the floating-layer border rule to .mud-popover:not(.mud-tooltip), .mud-dialog so tooltips get no hairline; confirm with rendered markup. (opus/medium · 81,022 tokens · 21 tool uses · 151 s · 40 in · 13,421 out · 1,148,041 cache read · 79,501 cache write · 447,847 weighted) | | 2026-11-28 19:47 | 2b Challenge notes | Orchestrator | minor objections appended verbatim to plan.md | | 2026-11-28 19:47 | 4 Skeleton skipped (G1) | Orchestrator | skipped — plan Signatures: None, production change adds no member another type calls | +| 2026-11-28 19:57 | 5 Tests first (G1) | Tester | RESULT: DONE, helpers StylesheetReader and ContrastRatio plus AppStylesheetTests and AppTests; confirmed 93 of 117 cases fail on current code, build clean. Deferred: AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress (sonnet/medium · 193,584 tokens · 29 tool uses · 525 s · 54 in · 57,909 out · 3,595,465 cache read · 190,510 cache write · 887,283 weighted) | diff --git a/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs b/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs new file mode 100644 index 00000000..ee7b6ffe --- /dev/null +++ b/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs @@ -0,0 +1,816 @@ +using System.Reflection; +using System.Text.RegularExpressions; + +using DockerUpdateGuard.Tests.Helper; + +namespace DockerUpdateGuard.Tests; + +/// +/// Tests for the shipped stylesheet wwwroot/app.css: tokens, banned constructs, fonts and the rules of the flat refresh +/// +[TestClass] +public class AppStylesheetTests +{ + #region Constants + + /// + /// Selector of the dark token block: it reaches the document root while the layout is dark + /// + private const string DarkBlockSelector = ":is(.dug-dark, :root:has(.dug-dark))"; + + /// + /// Minimum contrast of a text against its background (WCAG AA for normal text) + /// + private const double MinimumContrast = 4.5; + + /// + /// Shipped stylesheet below the host project directory + /// + private const string StylesheetPath = "wwwroot/app.css"; + + /// + /// Value of a panel's hairline border + /// + private const string HairlineBorder = "1px solid var(--dug-border)"; + + /// + /// Media context of the card layout of table rows + /// + private const string RowCardContext = "@media (max-width: 959.98px)"; + + #endregion // Constants + + #region Fields + + /// + /// Tokens of issue #451 section 1: name, light value, dark value (null when the table gives none) + /// + private static readonly (string Name, string Light, string? Dark)[] _tokens = [ + ("--dug-bg-page", "#F6F7F9", "#0F1216"), + ("--dug-surface", "#FFFFFF", "#171B21"), + ("--dug-surface-solid", "#FFFFFF", "#171B21"), + ("--dug-surface-subtle", "#FAFBFC", "#1B2027"), + ("--dug-border", "#E3E6EB", "#272D36"), + ("--dug-border-inner", "#EEF0F3", "#20262E"), + ("--dug-border-control", "#C9CED6", "#3A424E"), + ("--dug-text", "#16191D", "#E7EAEE"), + ("--dug-text-muted", "#5B6471", "#9BA5B3"), + ("--dug-text-faint", "#5B6471", "#9BA5B3"), + ("--dug-icon", "#3D4551", "#C5CCD6"), + ("--dug-primary", "#2563EB", "#7AA7FF"), + ("--dug-on-primary", "#FFFFFF", "#0F1216"), + ("--dug-link", "#1D4ED8", "#7AA7FF"), + ("--dug-attention", "#B54708", "#F2A54A"), + ("--dug-danger", "#B42318", "#FF8A80"), + ("--dug-success", "#067647", "#5FD39A"), + ("--dug-info", "#1D4ED8", "#9CC0FF"), + ("--dug-sev-critical", "#7A1C12", "#FF7B72"), + ("--dug-sev-high", "#D9480F", "#E0762B"), + ("--dug-sev-medium", "#E8A33D", "#A67C1F"), + ("--dug-sev-low", "#C9CED6", "#4A5361"), + ("--dug-scan-succeeded", "#9FB3C8", "#46566B"), + ("--dug-scan-partial", "#E8A33D", "#E0A23D"), + ("--dug-scan-failed", "#7A1C12", "#FF7B72"), + ("--dug-chart-cpu", "#2563EB", "#7AA7FF"), + ("--dug-chart-cpu-fill", "#E8EFFD", "#172A4D"), + ("--dug-chart-memory", "#6D4AC4", "#A98BEB"), + ("--dug-chart-memory-fill", "#EFEAFA", "#2A2145"), + ("--dug-chart-net-rx", "#0F766E", "#4FD1C5"), + ("--dug-chart-net-tx", "#B54708", "#F2A54A"), + ("--dug-radius-lg", "8px", null), + ("--dug-radius-md", "6px", null), + ("--dug-radius-sm", "4px", null), + ("--dug-font-text", "Inter, \"Segoe UI\", Arial, Helvetica, sans-serif", null), + ("--dug-font-display", "\"Space Grotesk\", Inter, \"Segoe UI\", Arial, sans-serif", null), + ("--dug-transition", "0.18s ease", null), + ]; + + /// + /// Chip tokens of issue #451 section 1: chip name, light background, light text, dark background, dark text + /// + private static readonly (string Chip, string LightBackground, string LightText, string DarkBackground, string DarkText)[] _chips = [ + ("critical", "#7A1C12", "#FFFFFF", "#FF7B72", "#1A0B0A"), + ("high", "#FFF1E6", "#9A3D00", "#3A2413", "#FFB877"), + ("medium", "#FDF3D7", "#7A5200", "#3A3013", "#F0CF7A"), + ("low", "#EEF0F3", "#3D4551", "#272D36", "#C5CCD6"), + ("success", "#E6F4EC", "#05603A", "#12301F", "#7BD8A4"), + ("info", "#E8EFFD", "#1D4ED8", "#172A4D", "#9CC0FF"), + ]; + + /// + /// Text tokens whose contrast is checked on each ground + /// + private static readonly string[] _textTokens = [ + "--dug-text", + "--dug-text-muted", + "--dug-text-faint", + "--dug-icon", + "--dug-primary", + "--dug-link", + "--dug-attention", + "--dug-danger", + "--dug-success", + "--dug-info", + ]; + + /// + /// Ground tokens text is drawn on + /// + private static readonly string[] _groundTokens = [ + "--dug-bg-page", + "--dug-surface", + "--dug-surface-subtle", + ]; + + /// + /// Tokens removed by the refresh + /// + private static readonly string[] _removedTokens = [ + "--dug-secondary", + "--dug-primary-strong", + "--dug-warning", + "--dug-shadow-card", + "--dug-shadow-hover", + "--dug-blur", + "--dug-bg-gradient", + ]; + + /// + /// Properties that take a color + /// + private static readonly Regex _colorPropertyPattern = new("^(color|background|background-color|border|border-(top|right|bottom|left)(-color)?|border-color|outline|outline-color|fill|stroke|text-decoration|text-decoration-color|caret-color|accent-color|column-rule)$", + RegexOptions.CultureInvariant, + TimeSpan.FromSeconds(5)); + + /// + /// Color notations and hexadecimal colors a rule outside the token blocks may not carry + /// + private static readonly Regex _colorLiteralPattern = new(@"#[0-9a-fA-F]{3,8}\b|\b(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(", + RegexOptions.CultureInvariant, + TimeSpan.FromSeconds(5)); + + /// + /// Named colors a color property of a rule outside the token blocks may not carry + /// + private static readonly Regex _namedColorPattern = new("(? + /// Box shadow declaration of a stylesheet + /// + private static readonly Regex _boxShadowPattern = new(@"box-shadow\s*:\s*([^;}]+)", + RegexOptions.CultureInvariant, + TimeSpan.FromSeconds(5)); + + #endregion // Fields + + #region Static methods + + /// + /// Contrast pairs of both themes: theme, text token, ground token + /// + /// Rows of theme, text token and ground token + public static IEnumerable GetContrastPairs() + { + foreach (var theme in new[] { "light", "dark" }) + { + foreach (var textToken in _textTokens) + { + foreach (var groundToken in _groundTokens) + { + yield return [theme, textToken, groundToken]; + } + } + + yield return [theme, "--dug-on-primary", "--dug-primary"]; + + foreach (var chip in _chips) + { + yield return [theme, $"--dug-chip-{chip.Chip}-fg", $"--dug-chip-{chip.Chip}-bg"]; + } + } + } + + /// + /// Name a contrast row by its pair + /// + /// Test method + /// Data row + /// Display name + public static string GetPairDisplayName(MethodInfo methodInfo, object?[] data) + { + return $"{methodInfo.Name} ({data[0]}: {data[1]} on {data[2]})"; + } + + #endregion // Static methods + + #region Methods + + /// + /// Verify the stylesheet carries no blur, no gradient and no box shadow that is neither none nor an inset line + /// + [TestMethod] + [TestCategory("AC1")] + public void AppStylesheetContainsNoBlurGradientOrElevationShadow() + { + var css = StylesheetReader.StripComments(ReadStylesheet()); + + Assert.DoesNotContain("backdrop-filter", css, "The stylesheet must not blur what is behind a surface"); + Assert.DoesNotContain("blur(", css, "The stylesheet must not blur anything"); + Assert.DoesNotContain("gradient(", css, "The stylesheet must not draw a gradient"); + AssertNoMismatches(FindElevationShadows(css), "Every box-shadow must be none or an inset line"); + } + + /// + /// Verify none of the removed tokens is declared or used + /// + [TestMethod] + [TestCategory("AC1")] + public void AppStylesheetContainsNoRemovedToken() + { + var css = StylesheetReader.StripComments(ReadStylesheet()); + + var found = _removedTokens.Where(token => Regex.IsMatch(css, Regex.Escape(token) + @"(?![\w-])", RegexOptions.None, TimeSpan.FromSeconds(5))) + .ToList(); + + AssertNoMismatches(found, "No removed token may remain declared or referenced"); + } + + /// + /// Verify the only rule that names the dark class is the dark token block, and it holds nothing but custom properties + /// + [TestMethod] + [TestCategory("AC1")] + [TestCategory("AC2")] + public void AppStylesheetHasNoDarkRuleBesideTokenBlock() + { + var darkRules = StylesheetReader.GetRules(ReadStylesheet()) + .Where(rule => rule.Selector.Contains(".dug-dark", StringComparison.Ordinal)) + .ToList(); + + Assert.HasCount(1, darkRules, "Exactly one rule may name .dug-dark: the dark token block"); + Assert.AreEqual(DarkBlockSelector, darkRules[0].Selector, "The dark token block must use the document-wide selector"); + + var declarations = StylesheetReader.GetDeclarationList(darkRules[0].Body); + var customProperties = StylesheetReader.GetCustomProperties(darkRules[0].Body); + + Assert.HasCount(declarations.Count, customProperties, "The dark token block must hold only custom properties"); + } + + /// + /// Verify rules outside the two token blocks use no color literal, only token references, inherit, transparent, currentColor or a color-mix of tokens + /// + [TestMethod] + [TestCategory("AC1")] + public void AppStylesheetRulesOutsideTokenBlocksUseOnlyTokenColors() + { + var rules = StylesheetReader.GetRules(ReadStylesheet()) + .Where(rule => rule.Selector != ":root" && rule.Selector != DarkBlockSelector && rule.Selector != "@font-face") + .ToList(); + + var offenders = rules.SelectMany(FindColorLiterals).ToList(); + + AssertNoMismatches(offenders, "Outside the token blocks every color must be a token reference"); + } + + /// + /// Verify :root holds every light token of the issue's tables with its light value + /// + [TestMethod] + [TestCategory("AC2")] + public void AppStylesheetRootBlockHoldsEveryLightToken() + { + var properties = GetRootTokens(); + + var expected = _tokens.Select(token => (token.Name, token.Light)) + .Concat(_chips.SelectMany(chip => new[] { ($"--dug-chip-{chip.Chip}-bg", chip.LightBackground), ($"--dug-chip-{chip.Chip}-fg", chip.LightText) })); + + AssertNoMismatches(FindTokenMismatches(properties, expected), "The :root block must hold every light token"); + } + + /// + /// Verify the dark block holds every token of the issue's tables that has a dark value, with that value + /// + [TestMethod] + [TestCategory("AC2")] + public void AppStylesheetDarkBlockHoldsEveryDarkToken() + { + var properties = GetDarkBlockTokens(); + + var expected = _tokens.Where(token => token.Dark is not null) + .Select(token => (token.Name, token.Dark!)) + .Concat(_chips.SelectMany(chip => new[] { ($"--dug-chip-{chip.Chip}-bg", chip.DarkBackground), ($"--dug-chip-{chip.Chip}-fg", chip.DarkText) })); + + AssertNoMismatches(FindTokenMismatches(properties, expected), "The dark block must hold every dark token"); + } + + /// + /// Verify the dark block reaches the whole document while the layout carries the dark class and wins over :root + /// + [TestMethod] + [TestCategory("AC2")] + public void AppStylesheetDarkBlockAppliesToDocumentWhileLayoutIsDark() + { + var rules = StylesheetReader.GetRules(ReadStylesheet()).ToList(); + + var rootIndex = rules.FindIndex(rule => rule.Selector == ":root"); + var darkIndex = rules.FindIndex(rule => rule.Selector == DarkBlockSelector); + + Assert.IsGreaterThanOrEqualTo(0, rootIndex, "The :root block must exist"); + Assert.IsGreaterThan(rootIndex, darkIndex, "The dark block must follow :root so that it wins at equal specificity"); + } + + /// + /// Verify Space Grotesk is declared as a variable latin font face with a swap display, after Inter's + /// + [TestMethod] + [TestCategory("AC3")] + public void AppStylesheetDeclaresSpaceGroteskFontFace() + { + var fontFaces = StylesheetReader.GetRules(ReadStylesheet()) + .Where(rule => rule.Selector == "@font-face") + .Select(rule => StylesheetReader.GetDeclarationList(rule.Body).ToDictionary(declaration => declaration.Name, declaration => declaration.Value)) + .ToList(); + + var interIndex = fontFaces.FindIndex(face => face.GetValueOrDefault("font-family") == "\"Inter\""); + var groteskIndex = fontFaces.FindIndex(face => face.GetValueOrDefault("font-family") == "\"Space Grotesk\""); + + Assert.IsGreaterThanOrEqualTo(0, interIndex, "Inter's font face must stay"); + Assert.IsGreaterThan(interIndex, groteskIndex, "The Space Grotesk font face must be declared after Inter's"); + + var grotesk = fontFaces[groteskIndex]; + var expected = new (string Name, string Value)[] + { + ("src", "url(\"fonts/SpaceGrotesk-Variable-latin.woff2\") format(\"woff2\")"), + ("font-weight", "300 700"), + ("font-style", "normal"), + ("font-display", "swap") + }; + + AssertNoMismatches(FindDeclarationMismatches("@font-face Space Grotesk", grotesk, expected), "The Space Grotesk font face must name the shipped file, its weights and swap"); + } + + /// + /// Verify the body uses the text font at 14 px with a line height of 1.45 and figures and the product name use the display font + /// + [TestMethod] + [TestCategory("AC4")] + public void AppStylesheetSetsTextAndDisplayFonts() + { + var css = ReadStylesheet(); + + var mismatches = FindDeclarationMismatches("body", + StylesheetReader.GetDeclarations(css, "body"), + [("font-family", "var(--dug-font-text)"), ("font-size", "0.875rem"), ("line-height", "1.45")]).Concat(FindDeclarationMismatches(".metric-value", + StylesheetReader.GetDeclarations(css, ".metric-value"), + [("font-family", "var(--dug-font-display)"), ("font-weight", "600")])) + .Concat(FindDeclarationMismatches(".app-brand__title", + StylesheetReader.GetDeclarations(css, ".app-brand__title"), + [("font-family", "var(--dug-font-display)"), ("font-weight", "600")])) + .ToList(); + + AssertNoMismatches(mismatches, "Text, figures and the product name must use the fonts of the refresh"); + } + + /// + /// Verify the dead heading rules that match no element are deleted, because the theme sizes the headings + /// + [TestMethod] + [TestCategory("AC4")] + public void AppStylesheetHasNoRuleForHeadingsThatDoNotExist() + { + var selectors = StylesheetReader.GetRules(ReadStylesheet()) + .Select(rule => rule.Selector) + .Where(selector => selector.Contains(".page-header h1", StringComparison.Ordinal) || selector.Contains(".section-header h2", StringComparison.Ordinal)) + .ToList(); + + AssertNoMismatches(selectors, "No rule may target .page-header h1 or .section-header h2"); + } + + /// + /// Verify each text and chip pair of the token tables reaches the minimum contrast in the theme + /// + /// Theme: light or dark + /// Text token + /// Ground token + [TestMethod] + [TestCategory("AC6")] + [DynamicData(nameof(GetContrastPairs), DynamicDataDisplayName = nameof(GetPairDisplayName))] + public void AppStylesheetTokenPairsReachMinimumContrast(string theme, string textToken, string groundToken) + { + var tokens = theme == "dark" ? GetEffectiveDarkTokens() : GetRootTokens(); + + var ratio = ContrastRatio.Calculate(GetColor(tokens, textToken), GetColor(tokens, groundToken)); + + Assert.IsGreaterThanOrEqualTo(MinimumContrast, ratio, $"{textToken} on {groundToken} in the {theme} theme has a contrast of {ratio:0.00}:1"); + } + + /// + /// Verify no hover or active rule moves, scales or rotates an element + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetInteractionRulesNeitherMoveNorScale() + { + string[] movingProperties = ["transform", "translate", "scale", "rotate"]; + + var offenders = StylesheetReader.GetRules(ReadStylesheet()) + .Where(rule => rule.Selector.Contains(":hover", StringComparison.Ordinal) || rule.Selector.Contains(":active", StringComparison.Ordinal)) + .SelectMany(rule => StylesheetReader.GetDeclarationList(rule.Body) + .Where(declaration => movingProperties.Contains(declaration.Name)) + .Select(declaration => $"{rule.Selector} sets {declaration.Name}")) + .ToList(); + + AssertNoMismatches(offenders, "Hovering or pressing must neither move nor scale anything"); + } + + /// + /// Verify a dashboard metric card changes only its border on hover, shows the 2 px primary outline on keyboard focus of its link, and the link has no own outline + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetMetricCardHoverChangesOnlyBorderAndFocusDrawsPrimaryOutline() + { + var css = ReadStylesheet(); + + var hover = StylesheetReader.GetDeclarations(css, ".metric-card-link:hover .metric-card"); + var focus = StylesheetReader.GetDeclarations(css, ".metric-card-link:focus-visible .metric-card"); + var link = StylesheetReader.GetDeclarations(css, ".metric-card-link:focus-visible"); + + var mismatches = FindDeclarationMismatches(".metric-card-link:hover .metric-card", hover, [("border-color", "var(--dug-border-control)")]).Concat(FindDeclarationMismatches(".metric-card-link:focus-visible .metric-card", focus, [("outline", "2px solid var(--dug-primary)"), ("outline-offset", "2px")])) + .ToList(); + + Assert.HasCount(1, hover, "The hover rule of a metric card may change only its border color"); + Assert.DoesNotContain("outline", link.Keys, "The link itself must not draw an outline, the card does"); + AssertNoMismatches(mismatches, "The metric card must change its border on hover and draw the primary outline on focus"); + } + + /// + /// Verify summary cards, which are not clickable, have no hover rule and no focus rule of their own + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetSummaryAndMetricCardsHaveNoOwnHoverOrFocusRule() + { + var selectors = StylesheetReader.GetRules(ReadStylesheet()) + .SelectMany(rule => StylesheetReader.SplitTopLevel(rule.Selector, ',')) + .Where(selector => selector is ".summary-card:hover" or ".summary-card:active" or ".summary-card:focus-visible" or ".metric-card:hover" or ".metric-card:active" or ".metric-card:focus-visible") + .ToList(); + + AssertNoMismatches(selectors, "Only the link of a metric card reacts to hover and focus"); + } + + /// + /// Verify transitions animate only border and background colors + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetTransitionsAnimateOnlyBorderAndBackgroundColors() + { + string[] allowed = ["border-color", "background-color", "none"]; + + var offenders = StylesheetReader.GetRules(ReadStylesheet()) + .SelectMany(rule => StylesheetReader.GetDeclarationList(rule.Body) + .Where(declaration => declaration.Name is "transition" or "transition-property") + .SelectMany(declaration => StylesheetReader.SplitTopLevel(declaration.Value, ',') + .Select(part => part.Split(' ')[0]) + .Where(property => allowed.Contains(property) == false) + .Select(property => $"{rule.Selector} transitions {property}"))) + .ToList(); + + AssertNoMismatches(offenders, "Only border-color and background-color may transition"); + } + + /// + /// Verify each panel is an opaque surface with a hairline border and the large radius, and the page ground is the plain page color + /// + /// Panel selector + [TestMethod] + [TestCategory("AC7")] + [DataRow(".hero-panel")] + [DataRow(".metric-card")] + [DataRow(".section-paper")] + [DataRow(".empty-state-panel")] + [DataRow(".summary-card")] + [DataRow(".mud-paper.app-topbar")] + public void AppStylesheetPanelsAreOpaqueSurfacesWithHairlineBorder(string selector) + { + var declarations = StylesheetReader.GetDeclarations(ReadStylesheet(), selector); + var mismatches = FindDeclarationMismatches(selector, declarations, [("border", HairlineBorder), ("border-radius", "var(--dug-radius-lg)")]).ToList(); + + mismatches.AddRange(FindDeclarationMismatches(selector, ReadBackground(declarations), [("background", "var(--dug-surface)")])); + + AssertNoMismatches(mismatches, $"{selector} must be a flat surface panel"); + } + + /// + /// Verify the layout ground is the plain page color + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetLayoutGroundIsPlainPageColor() + { + var declarations = StylesheetReader.GetDeclarations(ReadStylesheet(), ".app-layout"); + + var mismatches = FindDeclarationMismatches(".app-layout", ReadBackground(declarations), [("background", "var(--dug-bg-page)")]); + + AssertNoMismatches(mismatches, "The layout must have the plain page ground"); + } + + /// + /// Verify the drawer is a surface-colored panel with a hairline on its right and no shadow, with its texts in the token colors + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetDrawerIsSurfacePanelWithTokenTexts() + { + var css = ReadStylesheet(); + + var drawer = StylesheetReader.GetDeclarations(css, ".app-drawer .mud-drawer-content"); + var activeLink = StylesheetReader.GetDeclarations(css, ".app-nav-menu .mud-nav-link.active"); + var hoverLink = StylesheetReader.GetDeclarations(css, ".app-nav-menu .mud-nav-link:hover"); + + var mismatches = FindDeclarationMismatches("drawer", ReadBackground(drawer), [("background", "var(--dug-surface)")]).Concat(FindDeclarationMismatches("drawer", drawer, [("border-right", HairlineBorder)])) + .Concat(FindDeclarationMismatches("active link", activeLink, [("font-weight", "600"), ("color", "var(--dug-text)")])) + .Concat(FindDeclarationMismatches("active link", ReadBackground(activeLink), [("background", "var(--dug-surface-subtle)")])) + .Concat(FindDeclarationMismatches("hovered link", ReadBackground(hoverLink), [("background", "var(--dug-surface-subtle)")])) + .Concat(FindDeclarationMismatches(".nav-section-label", StylesheetReader.GetDeclarations(css, ".nav-section-label"), [("color", "var(--dug-text-muted)")])) + .Concat(FindDeclarationMismatches(".app-version__label", StylesheetReader.GetDeclarations(css, ".app-version__label"), [("color", "var(--dug-text-muted)")])) + .Concat(FindDeclarationMismatches(".app-version__value", StylesheetReader.GetDeclarations(css, ".app-version__value"), [("color", "var(--dug-text)")])) + .Concat(FindDeclarationMismatches(".app-brand__title", StylesheetReader.GetDeclarations(css, ".app-brand__title"), [("color", "var(--dug-text)")])) + .ToList(); + + Assert.IsFalse(drawer.TryGetValue("box-shadow", out var shadow) && shadow != "none", "The drawer must have no shadow"); + AssertNoMismatches(mismatches, "The drawer must be a flat surface panel with token texts"); + } + + /// + /// Verify links use the link color and the sparklines the four chart line colors + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetLinksAndSparklinesUseTokenColors() + { + var css = ReadStylesheet(); + const string sparkline = ".runtime-containers-table .runtime-containers-table__sparkline-line--"; + + var mismatches = FindDeclarationMismatches(".table-link", StylesheetReader.GetDeclarations(css, ".table-link"), [("color", "var(--dug-link)")]).Concat(FindDeclarationMismatches(".table-link:hover", StylesheetReader.GetDeclarations(css, ".table-link:hover"), [("color", "var(--dug-link)"), ("text-decoration", "underline")])) + .Concat(FindDeclarationMismatches("cpu sparkline", StylesheetReader.GetDeclarations(css, sparkline + "cpu"), [("stroke", "var(--dug-chart-cpu)")])) + .Concat(FindDeclarationMismatches("memory sparkline", StylesheetReader.GetDeclarations(css, sparkline + "memory"), [("stroke", "var(--dug-chart-memory)")])) + .Concat(FindDeclarationMismatches("received sparkline", StylesheetReader.GetDeclarations(css, sparkline + "network-rx"), [("stroke", "var(--dug-chart-net-rx)")])) + .Concat(FindDeclarationMismatches("sent sparkline", StylesheetReader.GetDeclarations(css, sparkline + "network-tx"), [("stroke", "var(--dug-chart-net-tx)")])) + .ToList(); + + AssertNoMismatches(mismatches, "Links and sparklines must use the link and chart tokens"); + } + + /// + /// Verify the warning and danger metric cards differ from other cards only by the color of their figure and icon + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetWarningAndDangerCardsColorOnlyFigureAndIcon() + { + var css = ReadStylesheet(); + + var mismatches = FindDeclarationMismatches(".metric-card--warning .metric-value", StylesheetReader.GetDeclarations(css, ".metric-card--warning .metric-value"), [("color", "var(--dug-attention)")]).Concat(FindDeclarationMismatches(".metric-card--danger .metric-value", StylesheetReader.GetDeclarations(css, ".metric-card--danger .metric-value"), [("color", "var(--dug-danger)")])) + .Concat(FindDeclarationMismatches(".metric-card--warning .metric-card__icon", StylesheetReader.GetDeclarations(css, ".metric-card--warning .metric-card__icon"), [("color", "var(--dug-attention)")])) + .Concat(FindDeclarationMismatches(".metric-card--danger .metric-card__icon", StylesheetReader.GetDeclarations(css, ".metric-card--danger .metric-card__icon"), [("color", "var(--dug-danger)")])) + .Concat(FindTintedBackgrounds(css, ".metric-card--warning")) + .Concat(FindTintedBackgrounds(css, ".metric-card--danger")) + .ToList(); + + AssertNoMismatches(mismatches, "Warning and danger cards must look like other cards except for their figure and icon color"); + } + + /// + /// Verify below 960 px a table row is a flat card: surface, hairline border, control radius + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetRowCardsBelowBreakpointAreFlatSurfaceCards() + { + var body = StylesheetReader.GetRules(ReadStylesheet()) + .Where(rule => rule.Context == RowCardContext && rule.Selector == ".section-table .mud-table-body .mud-table-row") + .Select(rule => rule.Body) + .FirstOrDefault(); + + Assert.IsNotNull(body, "The row card rule must stay below 960 px"); + + var declarations = StylesheetReader.GetDeclarationList(body).ToDictionary(declaration => declaration.Name, declaration => declaration.Value); + + var mismatches = FindDeclarationMismatches("row card", declarations, [("border", HairlineBorder), ("border-radius", "var(--dug-radius-md)")]).Concat(FindDeclarationMismatches("row card", ReadBackground(declarations), [("background", "var(--dug-surface)")])) + .ToList(); + + AssertNoMismatches(mismatches, "A row card must be flat"); + } + + /// + /// Verify filled buttons show no shadow in any state and popovers other than tooltips and dialogs get a hairline border + /// + [TestMethod] + [TestCategory("AC8")] + public void AppStylesheetFlattensFilledButtonsAndBordersFloatingLayers() + { + var css = ReadStylesheet(); + string[] buttonSelectors = [".mud-button-filled", ".mud-button-filled:hover", ".mud-button-filled:active", ".mud-button-filled:focus-visible"]; + + var mismatches = buttonSelectors.SelectMany(selector => FindDeclarationMismatches(selector, StylesheetReader.GetDeclarations(css, selector), [("box-shadow", "none")])) + .Concat(FindDeclarationMismatches(".mud-dialog", StylesheetReader.GetDeclarations(css, ".mud-dialog"), [("border", HairlineBorder)])) + .ToList(); + + var popover = StylesheetReader.GetDeclarations(css, ".mud-popover:not(.mud-tooltip)"); + + if (popover.Count == 0) + { + popover = StylesheetReader.GetDeclarations(css, ".mud-popover"); + } + + mismatches.AddRange(FindDeclarationMismatches(".mud-popover", popover, [("border", HairlineBorder)])); + + AssertNoMismatches(mismatches, "Filled buttons must be flat and floating layers must be bordered"); + } + + #endregion // Methods + + #region Helper methods + + /// + /// Read the shipped stylesheet with normalized line endings + /// + /// Stylesheet text + private static string ReadStylesheet() + { + return StylesheetReader.ReadHostFile(StylesheetPath); + } + + /// + /// Read the custom properties of the :root block + /// + /// Custom property name to value + private static Dictionary GetRootTokens() + { + var body = StylesheetReader.GetRuleBody(ReadStylesheet(), ":root"); + + Assert.IsNotNull(body, "The stylesheet must have a :root block"); + + return StylesheetReader.GetCustomProperties(body); + } + + /// + /// Read the custom properties of the dark token block + /// + /// Custom property name to value + private static Dictionary GetDarkBlockTokens() + { + var body = StylesheetReader.GetRuleBody(ReadStylesheet(), DarkBlockSelector); + + Assert.IsNotNull(body, "The stylesheet must have the dark token block"); + + return StylesheetReader.GetCustomProperties(body); + } + + /// + /// Read the tokens a dark layout resolves: the light tokens overridden by the dark block + /// + /// Custom property name to value + private static Dictionary GetEffectiveDarkTokens() + { + var tokens = GetRootTokens(); + + foreach (var (name, value) in GetDarkBlockTokens()) + { + tokens[name] = value; + } + + return tokens; + } + + /// + /// Read a color token, failing the test when it is missing + /// + /// Resolved tokens + /// Token name + /// Color as #RRGGBB + private static string GetColor(Dictionary tokens, string name) + { + if (tokens.TryGetValue(name, out var value) == false) + { + Assert.Fail($"The token {name} must be declared"); + } + + return value; + } + + /// + /// Pick the background declaration of a rule, as background, whichever of background and background-color it uses + /// + /// Declarations of the rule + /// Map with the background entry, empty when the rule sets none + private static Dictionary ReadBackground(Dictionary declarations) + { + var background = new Dictionary(StringComparer.Ordinal); + + if (declarations.TryGetValue("background-color", out var color)) + { + background["background"] = color; + } + else if (declarations.TryGetValue("background", out var shorthand)) + { + background["background"] = shorthand; + } + + return background; + } + + /// + /// Compare a token map with expected token values, ignoring the letter case of the values + /// + /// Declared tokens + /// Expected name and value pairs + /// One text per missing or different token + private static List FindTokenMismatches(Dictionary actual, IEnumerable<(string Name, string Value)> expected) + { + var mismatches = new List(); + + foreach (var (name, value) in expected) + { + if (actual.TryGetValue(name, out var declared) == false) + { + mismatches.Add($"{name} is missing"); + } + else if (string.Equals(declared, value, StringComparison.OrdinalIgnoreCase) == false) + { + mismatches.Add($"{name} is '{declared}', expected '{value}'"); + } + } + + return mismatches; + } + + /// + /// Compare declarations with expected values + /// + /// Name of what is checked + /// Declared properties + /// Expected property and value pairs + /// One text per missing or different declaration + private static IEnumerable FindDeclarationMismatches(string subject, Dictionary actual, (string Name, string Value)[] expected) + { + return FindTokenMismatches(actual, expected).Select(mismatch => $"{subject}: {mismatch}"); + } + + /// + /// Find the box shadows of a stylesheet that are neither none nor an inset line + /// + /// Stylesheet text + /// One text per offending shadow + private static List FindElevationShadows(string css) + { + return _boxShadowPattern.Matches(css) + .SelectMany(match => StylesheetReader.SplitTopLevel(match.Groups[1].Value, ',')) + .Where(shadow => shadow != "none" && shadow.StartsWith("inset ", StringComparison.Ordinal) == false) + .Select(shadow => $"box-shadow: {shadow}") + .ToList(); + } + + /// + /// Find the color literals and named colors in the declarations of a rule + /// + /// Rule + /// One text per offending declaration + private static IEnumerable FindColorLiterals((string Selector, string Body, string Context) rule) + { + return StylesheetReader.GetDeclarationList(rule.Body) + .Where(declaration => _colorLiteralPattern.IsMatch(declaration.Value) + || (_colorPropertyPattern.IsMatch(declaration.Name) && _namedColorPattern.IsMatch(declaration.Value))) + .Select(declaration => $"{rule.Selector} {{ {declaration.Name}: {declaration.Value} }}"); + } + + /// + /// Find a background of a metric card variant: the card must not be tinted + /// + /// Stylesheet text + /// Card variant selector + /// One text when the variant sets a background + private static IEnumerable FindTintedBackgrounds(string css, string selector) + { + var declarations = StylesheetReader.GetDeclarations(css, selector); + + return declarations.Keys.Where(name => name.StartsWith("background", StringComparison.Ordinal)) + .Select(name => $"{selector} sets {name}"); + } + + /// + /// Assert there is nothing to report + /// + /// Findings + /// What must hold + private static void AssertNoMismatches(IEnumerable mismatches, string message) + { + Assert.AreEqual(string.Empty, string.Join("; ", mismatches), message); + } + + #endregion // Helper methods +} \ No newline at end of file diff --git a/src/Tests/DockerUpdateGuard.Tests/AppTests.cs b/src/Tests/DockerUpdateGuard.Tests/AppTests.cs new file mode 100644 index 00000000..660657d7 --- /dev/null +++ b/src/Tests/DockerUpdateGuard.Tests/AppTests.cs @@ -0,0 +1,93 @@ +using System.Text.RegularExpressions; + +using DockerUpdateGuard.Tests.Helper; + +namespace DockerUpdateGuard.Tests; + +/// +/// Tests for the shipped document Components/App.razor and the static assets it points at +/// +[TestClass] +public class AppTests +{ + #region Constants + + /// + /// Document component below the host project directory + /// + private const string AppPath = "Components/App.razor"; + + /// + /// Preload line of the Inter font + /// + private const string InterPreload = ""; + + /// + /// Preload line of the Space Grotesk font + /// + private const string SpaceGroteskPreload = ""; + + #endregion // Constants + + #region Fields + + /// + /// Asset path of a preload line + /// + private static readonly Regex _preloadPathPattern = new("[^\"]+)\"\\]\"", + RegexOptions.CultureInvariant, + TimeSpan.FromSeconds(5)); + + #endregion // Fields + + #region Methods + + /// + /// Verify the document preloads Space Grotesk after Inter, in the same form, and every preloaded asset exists + /// + [TestMethod] + [TestCategory("AC3")] + public void AppPreloadsShippedSpaceGroteskFont() + { + var lines = StylesheetReader.ReadHostFile(AppPath) + .Split('\n') + .Select(line => line.Trim()) + .ToList(); + + var interIndex = lines.IndexOf(InterPreload); + var groteskIndex = lines.IndexOf(SpaceGroteskPreload); + + Assert.IsGreaterThanOrEqualTo(0, interIndex, "The preload of Inter must stay"); + Assert.IsGreaterThan(interIndex, groteskIndex, "The preload of Space Grotesk must follow Inter's in the same form"); + + var missing = lines.Select(line => _preloadPathPattern.Match(line)) + .Where(match => match.Success) + .Select(match => match.Groups["path"].Value) + .Where(path => File.Exists(Path.Combine(HostProjectDirectory.GetPath(), "wwwroot", path)) == false) + .ToList(); + + Assert.AreEqual(string.Empty, string.Join(", ", missing), "Every preload must point at an existing asset of wwwroot"); + } + + /// + /// Verify the variable latin font and its license text are shipped in wwwroot/fonts + /// + [TestMethod] + [TestCategory("AC3")] + public void AppShipsSpaceGroteskFontWithItsLicense() + { + var fontPath = Path.Combine(HostProjectDirectory.GetPath(), "wwwroot", "fonts", "SpaceGrotesk-Variable-latin.woff2"); + + Assert.IsTrue(File.Exists(fontPath), "The Space Grotesk font file must be in wwwroot/fonts"); + + var header = File.ReadAllBytes(fontPath).Take(4).ToArray(); + + Assert.AreSequenceEqual("wOF2"u8.ToArray(), header, "The font file must be a woff2 file"); + + var license = StylesheetReader.ReadHostFile("wwwroot/fonts/SpaceGrotesk-OFL.txt"); + + Assert.Contains("SIL OPEN FONT LICENSE Version 1.1", license, StringComparison.OrdinalIgnoreCase, "The license text must be the SIL Open Font License 1.1 and sit next to the font"); + } + + #endregion // Methods +} \ No newline at end of file diff --git a/src/Tests/DockerUpdateGuard.Tests/ContrastRatioTests.cs b/src/Tests/DockerUpdateGuard.Tests/ContrastRatioTests.cs new file mode 100644 index 00000000..9e9cfb55 --- /dev/null +++ b/src/Tests/DockerUpdateGuard.Tests/ContrastRatioTests.cs @@ -0,0 +1,79 @@ +using DockerUpdateGuard.Tests.Helper; + +namespace DockerUpdateGuard.Tests; + +/// +/// Tests for +/// +[TestClass] +public class ContrastRatioTests +{ + #region Methods + + /// + /// Verify black on white is the maximum ratio of 21 + /// + [TestMethod] + [TestCategory("AC6")] + public void ContrastRatioCalculateBlackOnWhiteReturnsTwentyOne() + { + var ratio = ContrastRatio.Calculate("#000000", "#FFFFFF"); + + Assert.AreEqual(21d, ratio, 0.001, "Black on white must be the maximum contrast of 21:1"); + } + + /// + /// Verify the same color on itself is the minimum ratio of 1 + /// + [TestMethod] + [TestCategory("AC6")] + public void ContrastRatioCalculateSameColorReturnsOne() + { + var ratio = ContrastRatio.Calculate("#2563EB", "#2563EB"); + + Assert.AreEqual(1d, ratio, 0.001, "A color on itself must have the minimum contrast of 1:1"); + } + + /// + /// Verify the order of the colors and the letter case do not change the ratio + /// + [TestMethod] + [TestCategory("AC6")] + public void ContrastRatioCalculateIgnoresColorOrderAndLetterCase() + { + var whiteOnBlue = ContrastRatio.Calculate("#FFFFFF", "#2563EB"); + var blueOnWhite = ContrastRatio.Calculate("#2563eb", "#ffffff"); + + Assert.AreEqual(whiteOnBlue, blueOnWhite, 0.0001, "The ratio must not depend on the order or the letter case"); + } + + /// + /// Verify a known pair: white on the light primary color is 5.17:1 (hand calculation of the plan) + /// + [TestMethod] + [TestCategory("AC6")] + public void ContrastRatioCalculateWhiteOnLightPrimaryReturnsKnownValue() + { + var ratio = ContrastRatio.Calculate("#FFFFFF", "#2563EB"); + + Assert.AreEqual(5.17d, ratio, 0.01, "White on #2563EB must be 5.17:1"); + } + + /// + /// Verify a color that is not written as #RRGGBB is refused + /// + /// Malformed color + [TestMethod] + [TestCategory("AC6")] + [DataRow("FFFFFF")] + [DataRow("#FFF")] + [DataRow("#GGGGGG")] + [DataRow("")] + public void ContrastRatioCalculateMalformedColorThrowsArgumentException(string color) + { + Assert.Throws(() => ContrastRatio.Calculate(color, "#FFFFFF"), + $"The color '{color}' must be refused"); + } + + #endregion // Methods +} \ No newline at end of file diff --git a/src/Tests/DockerUpdateGuard.Tests/Helper/ContrastRatio.cs b/src/Tests/DockerUpdateGuard.Tests/Helper/ContrastRatio.cs new file mode 100644 index 00000000..f1898371 --- /dev/null +++ b/src/Tests/DockerUpdateGuard.Tests/Helper/ContrastRatio.cs @@ -0,0 +1,81 @@ +using System.Globalization; +using System.Text.RegularExpressions; + +namespace DockerUpdateGuard.Tests.Helper; + +/// +/// Computes the WCAG contrast ratio of two colors +/// +internal static partial class ContrastRatio +{ + #region Constants + + /// + /// Offset the WCAG formula adds to both relative luminances + /// + private const double LuminanceOffset = 0.05; + + #endregion // Constants + + #region Static methods + + /// + /// Match a color written as #RRGGBB + /// + /// Regular expression + [GeneratedRegex("^#[0-9A-Fa-f]{6}$", RegexOptions.None, 5000)] + private static partial Regex CreateColorPattern(); + + #endregion // Static methods + + #region Methods + + /// + /// Calculate the WCAG contrast ratio of two colors, from 1 (same color) to 21 (black on white) + /// + /// First color as #RRGGBB + /// Second color as #RRGGBB + /// Contrast ratio + internal static double Calculate(string first, string second) + { + var firstLuminance = GetRelativeLuminance(first); + var secondLuminance = GetRelativeLuminance(second); + var lighter = Math.Max(firstLuminance, secondLuminance); + var darker = Math.Min(firstLuminance, secondLuminance); + + return (lighter + LuminanceOffset) / (darker + LuminanceOffset); + } + + /// + /// Calculate the WCAG relative luminance of a color + /// + /// Color as #RRGGBB + /// Relative luminance from 0 to 1 + private static double GetRelativeLuminance(string color) + { + if (CreateColorPattern().IsMatch(color) == false) + { + throw new ArgumentException($"The color '{color}' must be written as #RRGGBB", nameof(color)); + } + + var red = GetLinearChannel(color.Substring(1, 2)); + var green = GetLinearChannel(color.Substring(3, 2)); + var blue = GetLinearChannel(color.Substring(5, 2)); + + return (0.2126 * red) + (0.7152 * green) + (0.0722 * blue); + } + + /// + /// Convert one sRGB channel to its linear value + /// + /// Two hexadecimal digits + /// Linear channel value from 0 to 1 + private static double GetLinearChannel(string hexChannel) + { + var channel = int.Parse(hexChannel, NumberStyles.HexNumber, CultureInfo.InvariantCulture) / 255d; + + return channel <= 0.03928 ? channel / 12.92 : Math.Pow((channel + 0.055) / 1.055, 2.4); + } + + #endregion // Methods +} \ No newline at end of file diff --git a/src/Tests/DockerUpdateGuard.Tests/Helper/StylesheetReader.cs b/src/Tests/DockerUpdateGuard.Tests/Helper/StylesheetReader.cs new file mode 100644 index 00000000..d9b888e3 --- /dev/null +++ b/src/Tests/DockerUpdateGuard.Tests/Helper/StylesheetReader.cs @@ -0,0 +1,372 @@ +using System.Text; +using System.Text.RegularExpressions; + +namespace DockerUpdateGuard.Tests.Helper; + +/// +/// Reads a shipped file of the host project and the rules of a stylesheet, for tests of the files themselves +/// +internal static partial class StylesheetReader +{ + #region Constants + + /// + /// Time limit of the stylesheet patterns in milliseconds + /// + private const int RegexTimeoutMilliseconds = 5000; + + #endregion // Constants + + #region Static methods + + /// + /// Match a CSS comment + /// + /// Regular expression + [GeneratedRegex(@"/\*.*?\*/", RegexOptions.Singleline, RegexTimeoutMilliseconds)] + private static partial Regex CreateCommentPattern(); + + /// + /// Match a run of white space + /// + /// Regular expression + [GeneratedRegex(@"\s+", RegexOptions.None, RegexTimeoutMilliseconds)] + private static partial Regex CreateWhitespacePattern(); + + #endregion // Static methods + + #region Methods + + /// + /// Read a file of the host project with line endings normalized to \n + /// + /// Path below the host project directory, with forward slashes + /// File text + internal static string ReadHostFile(string relativePath) + { + var path = Path.Combine(HostProjectDirectory.GetPath(), relativePath); + + Assert.IsTrue(File.Exists(path), $"The host file '{relativePath}' must exist"); + + return NormalizeLineEndings(File.ReadAllText(path, Encoding.UTF8)); + } + + /// + /// Replace \r\n line endings with \n, because a checkout may carry either + /// + /// Text to normalize + /// Text with \n line endings + internal static string NormalizeLineEndings(string text) + { + return text.Replace("\r\n", "\n", StringComparison.Ordinal); + } + + /// + /// Replace every run of white space with one space and trim the text + /// + /// Text to collapse + /// Collapsed text + internal static string CollapseWhitespace(string text) + { + return CreateWhitespacePattern().Replace(text, " ").Trim(); + } + + /// + /// Remove the comments of a stylesheet + /// + /// Stylesheet text + /// Stylesheet text without comments + internal static string StripComments(string css) + { + return CreateCommentPattern().Replace(css, string.Empty); + } + + /// + /// Split a text at a separator that is outside parentheses and quotes, trimming and dropping empty parts + /// + /// Text to split + /// Separator character + /// Collapsed parts + internal static List SplitTopLevel(string text, char separator) + { + var parts = new List(); + var current = new StringBuilder(); + var depth = 0; + var quote = '\0'; + + foreach (var character in text) + { + quote = GetQuoteAfter(quote, character); + depth += GetDepthChange(quote, character); + + if (character == separator && depth == 0 && quote == '\0') + { + AddPart(parts, current); + + continue; + } + + current.Append(character); + } + + AddPart(parts, current); + + return parts; + } + + /// + /// Get all rules of a stylesheet, those inside @media, @supports and @layer blocks included + /// + /// Stylesheet text + /// Rules in file order: collapsed selector (or @font-face), body, and the collapsed prelude of the enclosing at-rule (empty at the top level) + internal static IReadOnlyList<(string Selector, string Body, string Context)> GetRules(string css) + { + var rules = new List<(string Selector, string Body, string Context)>(); + + CollectRules(StripComments(NormalizeLineEndings(css)), string.Empty, rules); + + return rules; + } + + /// + /// Get the body of the first top-level rule whose whole selector text equals the given one (white space collapsed) + /// + /// Stylesheet text + /// Exact selector text + /// Rule body, or null when no top-level rule has that selector + internal static string? GetRuleBody(string css, string selector) + { + var wanted = CollapseWhitespace(selector); + + foreach (var rule in GetRules(css)) + { + if (rule.Context.Length == 0 && rule.Selector == wanted) + { + return rule.Body; + } + } + + return null; + } + + /// + /// Get the declarations of every top-level rule whose selector list contains the given selector, a later rule overriding an earlier one + /// + /// Stylesheet text + /// One selector of a rule's selector list + /// Property name to collapsed value, empty when no rule names the selector + internal static Dictionary GetDeclarations(string css, string selector) + { + var wanted = CollapseWhitespace(selector); + var declarations = new Dictionary(StringComparer.Ordinal); + + foreach (var rule in GetRules(css)) + { + if (rule.Context.Length == 0 && SplitTopLevel(rule.Selector, ',').Contains(wanted)) + { + MergeDeclarations(declarations, rule.Body); + } + } + + return declarations; + } + + /// + /// Get the declarations of a rule body as name and collapsed value, in file order + /// + /// Rule body + /// Declarations + internal static IReadOnlyList<(string Name, string Value)> GetDeclarationList(string body) + { + var declarations = new List<(string Name, string Value)>(); + + foreach (var part in SplitTopLevel(body, ';')) + { + var colon = part.IndexOf(':', StringComparison.Ordinal); + + if (colon > 0) + { + declarations.Add((part[..colon].Trim(), CollapseWhitespace(part[(colon + 1)..]))); + } + } + + return declarations; + } + + /// + /// Get the custom properties (--name) of a rule body + /// + /// Rule body + /// Custom property name to collapsed value + internal static Dictionary GetCustomProperties(string body) + { + var properties = new Dictionary(StringComparer.Ordinal); + + foreach (var (name, value) in GetDeclarationList(body)) + { + if (name.StartsWith("--", StringComparison.Ordinal)) + { + properties[name] = value; + } + } + + return properties; + } + + /// + /// Collect the rules of a stylesheet text, descending into grouping at-rules + /// + /// Stylesheet text without comments + /// Prelude of the enclosing at-rule, empty at the top level + /// Collected rules + private static void CollectRules(string css, string context, List<(string Selector, string Body, string Context)> rules) + { + var position = 0; + + while (position < css.Length) + { + var open = css.IndexOf('{', position); + + if (open < 0) + { + return; + } + + var close = FindClosingBrace(css, open); + var prelude = GetPrelude(css[position..open]); + var body = css[(open + 1)..close]; + + position = close + 1; + + if (IsGroupingAtRule(prelude)) + { + CollectRules(body, prelude, rules); + } + else + { + rules.Add((prelude, body, context)); + } + } + } + + /// + /// Get the prelude of a block: the text after the last statement that ended with a semicolon, collapsed + /// + /// Text between the previous block and the opening brace + /// Collapsed prelude + private static string GetPrelude(string segment) + { + var semicolon = segment.LastIndexOf(';'); + + return CollapseWhitespace(semicolon >= 0 ? segment[(semicolon + 1)..] : segment); + } + + /// + /// Tell whether a prelude opens a block that holds rules + /// + /// Collapsed prelude + /// true for @media, @supports and @layer + private static bool IsGroupingAtRule(string prelude) + { + return prelude.StartsWith("@media", StringComparison.Ordinal) + || prelude.StartsWith("@supports", StringComparison.Ordinal) + || prelude.StartsWith("@layer", StringComparison.Ordinal); + } + + /// + /// Find the brace that closes the block opened at a position + /// + /// Stylesheet text + /// Index of the opening brace + /// Index of the closing brace, or the end of the text for an unclosed block + private static int FindClosingBrace(string css, int open) + { + var depth = 0; + + for (var index = open; index < css.Length; index++) + { + depth += css[index] switch + { + '{' => 1, + '}' => -1, + _ => 0, + }; + + if (depth == 0) + { + return index; + } + } + + return css.Length; + } + + /// + /// Merge the declarations of a rule body into a declaration map + /// + /// Map to extend + /// Rule body + private static void MergeDeclarations(Dictionary declarations, string body) + { + foreach (var (name, value) in GetDeclarationList(body)) + { + declarations[name] = value; + } + } + + /// + /// Get the quote state after a character + /// + /// Open quote character, or \0 outside a string + /// Next character + /// New quote state + private static char GetQuoteAfter(char quote, char character) + { + if (quote == '\0') + { + return character is '"' or '\'' ? character : '\0'; + } + + return character == quote ? '\0' : quote; + } + + /// + /// Get the change of the parenthesis depth a character causes outside a string + /// + /// Open quote character, or \0 outside a string + /// Character + /// Change of the depth + private static int GetDepthChange(char quote, char character) + { + if (quote != '\0') + { + return 0; + } + + return character switch + { + '(' => 1, + ')' => -1, + _ => 0, + }; + } + + /// + /// Add the collected characters as a part when they are not blank, and clear the collector + /// + /// Parts + /// Collected characters + private static void AddPart(List parts, StringBuilder current) + { + var part = CollapseWhitespace(current.ToString()); + + current.Clear(); + + if (part.Length > 0) + { + parts.Add(part); + } + } + + #endregion // Methods +} \ No newline at end of file diff --git a/src/Tests/DockerUpdateGuard.Tests/StylesheetReaderTests.cs b/src/Tests/DockerUpdateGuard.Tests/StylesheetReaderTests.cs new file mode 100644 index 00000000..cdf741e7 --- /dev/null +++ b/src/Tests/DockerUpdateGuard.Tests/StylesheetReaderTests.cs @@ -0,0 +1,160 @@ +using DockerUpdateGuard.Tests.Helper; + +namespace DockerUpdateGuard.Tests; + +/// +/// Tests for +/// +[TestClass] +public class StylesheetReaderTests +{ + #region Constants + + /// + /// Stylesheet with a comment, a grouped selector over two lines, a media block and a font face + /// + private const string SampleCss = """ + /* header { color: red; } */ + @font-face { + font-family: "Demo"; + src: url("fonts/a;b.woff2") format("woff2"); + } + + :root { + --dug-a: #AABBCC; + --dug-b: Inter, "Segoe UI", sans-serif; + color: var(--dug-a); + } + + .one, + .two:is(.x, .y) { + margin: 0; + } + + .one { + margin: 4px; + padding: 1px + } + + @media (max-width: 960px) { + .one { + margin: 9px; + } + } + """; + + #endregion // Constants + + #region Fields + + /// + /// Parts expected from splitting the sample list + /// + private static readonly string[] _expectedSplitParts = ["a:is(b, c)", "\"d,e\"", "f"]; + + #endregion // Fields + + #region Methods + + /// + /// Verify CRLF and LF text both come out with LF only + /// + [TestMethod] + public void StylesheetReaderNormalizeLineEndingsWithCrlfInputReturnsLfOnly() + { + var normalized = StylesheetReader.NormalizeLineEndings("a {\r\n b: c;\r\n}\r\n"); + + Assert.AreEqual("a {\n b: c;\n}\n", normalized, "Every CRLF must become LF"); + Assert.AreEqual("a\nb", StylesheetReader.NormalizeLineEndings("a\nb"), "LF text must stay unchanged"); + } + + /// + /// Verify the app stylesheet is read without carriage returns even when it is checked out with CRLF + /// + [TestMethod] + public void StylesheetReaderReadHostFileReturnsTextWithoutCarriageReturns() + { + var css = StylesheetReader.ReadHostFile("wwwroot/app.css"); + + Assert.DoesNotContain("\r", css, "The stylesheet text must carry no carriage return"); + Assert.Contains(":root", css, "The stylesheet text must be the content of app.css"); + } + + /// + /// Verify a rule is found by its exact selector text whatever the line breaks between its selectors, and a comment is ignored + /// + [TestMethod] + public void StylesheetReaderGetRuleBodyFindsRuleByExactSelectorText() + { + var crlfCss = StylesheetReader.NormalizeLineEndings(SampleCss).Replace("\n", "\r\n", StringComparison.Ordinal); + + var body = StylesheetReader.GetRuleBody(crlfCss, ".one, .two:is(.x, .y)"); + + Assert.IsNotNull(body, "A grouped selector list must be found by its collapsed text"); + Assert.AreEqual("margin: 0;", StylesheetReader.CollapseWhitespace(body), "The body of the first matching rule must be returned"); + Assert.IsNull(StylesheetReader.GetRuleBody(crlfCss, "header"), "A rule inside a comment must not be found"); + Assert.IsNull(StylesheetReader.GetRuleBody(crlfCss, ".two"), "A part of a selector list is not the exact selector text"); + } + + /// + /// Verify rules inside a media block carry its prelude as context and are not top-level rules + /// + [TestMethod] + public void StylesheetReaderGetRulesReportsMediaContext() + { + var rules = StylesheetReader.GetRules(SampleCss); + + var mediaRules = rules.Where(rule => rule.Context == "@media (max-width: 960px)").ToList(); + + Assert.HasCount(1, mediaRules, "The media block must hold one rule"); + Assert.AreEqual(".one", mediaRules[0].Selector, "The rule of the media block must keep its selector"); + Assert.HasCount(5, rules, "The font face, :root, the grouped rule, .one and the media rule must be found"); + Assert.AreEqual("@font-face", rules[0].Selector, "The font face must be reported with its at-rule name"); + } + + /// + /// Verify the declarations of every top-level rule that names the selector are merged, a later one overriding an earlier one + /// + [TestMethod] + public void StylesheetReaderGetDeclarationsMergesTopLevelRulesNamingTheSelector() + { + var declarations = StylesheetReader.GetDeclarations(SampleCss, ".one"); + + Assert.AreEqual("4px", declarations["margin"], "The later top-level rule must override the earlier one and the media rule must not count"); + Assert.AreEqual("1px", declarations["padding"], "A last declaration without a semicolon must be read"); + Assert.HasCount(2, declarations, "Only margin and padding must be declared"); + } + + /// + /// Verify custom properties are read with collapsed values and semicolons inside strings or parentheses do not split a declaration + /// + [TestMethod] + public void StylesheetReaderGetCustomPropertiesReturnsOnlyCustomProperties() + { + var body = StylesheetReader.GetRuleBody(SampleCss, ":root"); + + var properties = StylesheetReader.GetCustomProperties(body!); + + Assert.HasCount(2, properties, "The plain color declaration must not be a custom property"); + Assert.AreEqual("#AABBCC", properties["--dug-a"], "A value must be read as written"); + Assert.AreEqual("Inter, \"Segoe UI\", sans-serif", properties["--dug-b"], "White space inside a value must collapse"); + + var fontFace = StylesheetReader.GetRules(SampleCss)[0]; + var declarations = StylesheetReader.GetDeclarationList(fontFace.Body); + + Assert.AreEqual("url(\"fonts/a;b.woff2\") format(\"woff2\")", declarations[1].Value, "A semicolon inside parentheses must not split the declaration"); + } + + /// + /// Verify splitting honors parentheses and quotes + /// + [TestMethod] + public void StylesheetReaderSplitTopLevelKeepsNestedAndQuotedSeparators() + { + var parts = StylesheetReader.SplitTopLevel("a:is(b, c), \"d,e\" ,, f", ','); + + Assert.AreSequenceEqual(_expectedSplitParts, parts, "Only separators outside parentheses and quotes may split"); + } + + #endregion // Methods +} \ No newline at end of file From 29b3c5ec98768de62f15b086d43bb23d817a3e0c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:00:13 +0000 Subject: [PATCH 09/24] Flatten app.css tokens and add Space Grotesk Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + src/DockerUpdateGuard/Components/App.razor | 1 + src/DockerUpdateGuard/wwwroot/app.css | 379 ++++++++---------- .../wwwroot/fonts/SpaceGrotesk-OFL.txt | 93 +++++ .../fonts/SpaceGrotesk-Variable-latin.woff2 | Bin 0 -> 22288 bytes 5 files changed, 264 insertions(+), 210 deletions(-) create mode 100644 src/DockerUpdateGuard/wwwroot/fonts/SpaceGrotesk-OFL.txt create mode 100644 src/DockerUpdateGuard/wwwroot/fonts/SpaceGrotesk-Variable-latin.woff2 diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 9194774e..9ca9f75f 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -14,3 +14,4 @@ are quoted in full. | 2026-11-28 19:47 | 2b Challenge notes | Orchestrator | minor objections appended verbatim to plan.md | | 2026-11-28 19:47 | 4 Skeleton skipped (G1) | Orchestrator | skipped — plan Signatures: None, production change adds no member another type calls | | 2026-11-28 19:57 | 5 Tests first (G1) | Tester | RESULT: DONE, helpers StylesheetReader and ContrastRatio plus AppStylesheetTests and AppTests; confirmed 93 of 117 cases fail on current code, build clean. Deferred: AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress (sonnet/medium · 193,584 tokens · 29 tool uses · 525 s · 54 in · 57,909 out · 3,595,465 cache read · 190,510 cache write · 887,283 weighted) | +| 2026-11-28 20:00 | 6 Implement (G1) | Dev | RESULT: DONE, app.css tokens/rules, Space Grotesk font + OFL, preload; build clean, 2496+39 tests pass, 117 target cases green (sonnet/medium · 151,001 tokens · 16 tool uses · 169 s · 22 in · 17,312 out · 1,331,225 cache read · 97,385 cache write · 341,436 weighted) | diff --git a/src/DockerUpdateGuard/Components/App.razor b/src/DockerUpdateGuard/Components/App.razor index 8513ee7d..5f0c8d13 100644 --- a/src/DockerUpdateGuard/Components/App.razor +++ b/src/DockerUpdateGuard/Components/App.razor @@ -6,6 +6,7 @@ + diff --git a/src/DockerUpdateGuard/wwwroot/app.css b/src/DockerUpdateGuard/wwwroot/app.css index 930aaacd..29e67781 100644 --- a/src/DockerUpdateGuard/wwwroot/app.css +++ b/src/DockerUpdateGuard/wwwroot/app.css @@ -6,88 +6,110 @@ font-display: swap; } -:root { - --dug-primary: #2563eb; - --dug-primary-strong: #1d4ed8; - --dug-secondary: #0891b2; - --dug-bg-page: #f3f6fb; - --dug-surface: rgba(255, 255, 255, 0.82); - --dug-surface-solid: #ffffff; - --dug-border: rgba(148, 163, 184, 0.2); - --dug-text: #0f172a; - --dug-text-muted: #475569; - --dug-text-faint: #64748b; - --dug-success: #15803d; - --dug-warning: #b45309; - --dug-danger: #b91c1c; - --dug-info: #0284c7; - --dug-sev-critical: #dc2626; - --dug-sev-high: #ea580c; - --dug-sev-medium: #0284c7; - --dug-sev-low: #15803d; - --dug-radius-lg: 1.5rem; - --dug-radius-md: 1rem; - --dug-shadow-card: 0 20px 45px rgba(15, 23, 42, 0.08); - --dug-shadow-hover: 0 24px 48px rgba(15, 23, 42, 0.14); - --dug-blur: blur(12px); - --dug-transition: 0.18s ease; - --dug-bg-gradient: - radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 24rem), - radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 22rem), - linear-gradient(180deg, #eef4ff 0%, #f8fafc 35%, #f3f6fb 100%); -} - -.dug-dark { - --dug-bg-page: #0b1220; - --dug-surface: rgba(17, 26, 46, 0.82); - --dug-surface-solid: #111a2e; - --dug-border: rgba(148, 163, 184, 0.16); - --dug-text: #e2e8f0; - --dug-text-muted: #94a3b8; - --dug-text-faint: #64748b; - --dug-shadow-card: 0 20px 45px rgba(0, 0, 0, 0.35); - --dug-shadow-hover: 0 24px 48px rgba(0, 0, 0, 0.45); - --dug-bg-gradient: - radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 24rem), - radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 22rem), - linear-gradient(180deg, #0b1220 0%, #0d1526 35%, #0b1220 100%); -} - -.dug-dark .mud-paper.app-topbar { - background: rgba(17, 26, 46, 0.72); -} - -.dug-dark .app-topbar__meta-card { - background: rgba(17, 26, 46, 0.78); -} - -.dug-dark .hero-panel { - background: - linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(14, 165, 233, 0.16)), - rgba(17, 26, 46, 0.92); -} - -.dug-dark .section-paper--accent { - background: - linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.1)), - rgba(17, 26, 46, 0.92); -} - -.dug-dark .metric-card--warning { - background: - linear-gradient(135deg, rgba(180, 83, 9, 0.22), rgba(17, 26, 46, 0.9)), - rgba(17, 26, 46, 0.92); +@font-face { + font-family: "Space Grotesk"; + src: url("fonts/SpaceGrotesk-Variable-latin.woff2") format("woff2"); + font-weight: 300 700; + font-style: normal; + font-display: swap; } -.dug-dark .metric-card--danger { - background: - linear-gradient(135deg, rgba(185, 28, 28, 0.2), rgba(17, 26, 46, 0.9)), - rgba(17, 26, 46, 0.92); +:root { + --dug-bg-page: #F6F7F9; + --dug-surface: #FFFFFF; + --dug-surface-solid: #FFFFFF; + --dug-surface-subtle: #FAFBFC; + --dug-border: #E3E6EB; + --dug-border-inner: #EEF0F3; + --dug-border-control: #C9CED6; + --dug-text: #16191D; + --dug-text-muted: #5B6471; + --dug-text-faint: #5B6471; + --dug-icon: #3D4551; + --dug-primary: #2563EB; + --dug-on-primary: #FFFFFF; + --dug-link: #1D4ED8; + --dug-attention: #B54708; + --dug-danger: #B42318; + --dug-success: #067647; + --dug-info: #1D4ED8; + --dug-sev-critical: #7A1C12; + --dug-sev-high: #D9480F; + --dug-sev-medium: #E8A33D; + --dug-sev-low: #C9CED6; + --dug-scan-succeeded: #9FB3C8; + --dug-scan-partial: #E8A33D; + --dug-scan-failed: #7A1C12; + --dug-chip-critical-bg: #7A1C12; + --dug-chip-critical-fg: #FFFFFF; + --dug-chip-high-bg: #FFF1E6; + --dug-chip-high-fg: #9A3D00; + --dug-chip-medium-bg: #FDF3D7; + --dug-chip-medium-fg: #7A5200; + --dug-chip-low-bg: #EEF0F3; + --dug-chip-low-fg: #3D4551; + --dug-chip-success-bg: #E6F4EC; + --dug-chip-success-fg: #05603A; + --dug-chip-info-bg: #E8EFFD; + --dug-chip-info-fg: #1D4ED8; + --dug-chart-cpu: #2563EB; + --dug-chart-cpu-fill: #E8EFFD; + --dug-chart-memory: #6D4AC4; + --dug-chart-memory-fill: #EFEAFA; + --dug-chart-net-rx: #0F766E; + --dug-chart-net-tx: #B54708; + --dug-radius-lg: 8px; + --dug-radius-md: 6px; + --dug-radius-sm: 4px; + --dug-font-text: Inter, "Segoe UI", Arial, Helvetica, sans-serif; + --dug-font-display: "Space Grotesk", Inter, "Segoe UI", Arial, sans-serif; + --dug-transition: 0.18s ease; } -.dug-dark .section-table .mud-table-container { - background: rgba(17, 26, 46, 0.88); - border-color: rgba(148, 163, 184, 0.18); +:is(.dug-dark, :root:has(.dug-dark)) { + --dug-bg-page: #0F1216; + --dug-surface: #171B21; + --dug-surface-solid: #171B21; + --dug-surface-subtle: #1B2027; + --dug-border: #272D36; + --dug-border-inner: #20262E; + --dug-border-control: #3A424E; + --dug-text: #E7EAEE; + --dug-text-muted: #9BA5B3; + --dug-text-faint: #9BA5B3; + --dug-icon: #C5CCD6; + --dug-primary: #7AA7FF; + --dug-on-primary: #0F1216; + --dug-link: #7AA7FF; + --dug-attention: #F2A54A; + --dug-danger: #FF8A80; + --dug-success: #5FD39A; + --dug-info: #9CC0FF; + --dug-sev-critical: #FF7B72; + --dug-sev-high: #E0762B; + --dug-sev-medium: #A67C1F; + --dug-sev-low: #4A5361; + --dug-scan-succeeded: #46566B; + --dug-scan-partial: #E0A23D; + --dug-scan-failed: #FF7B72; + --dug-chip-critical-bg: #FF7B72; + --dug-chip-critical-fg: #1A0B0A; + --dug-chip-high-bg: #3A2413; + --dug-chip-high-fg: #FFB877; + --dug-chip-medium-bg: #3A3013; + --dug-chip-medium-fg: #F0CF7A; + --dug-chip-low-bg: #272D36; + --dug-chip-low-fg: #C5CCD6; + --dug-chip-success-bg: #12301F; + --dug-chip-success-fg: #7BD8A4; + --dug-chip-info-bg: #172A4D; + --dug-chip-info-fg: #9CC0FF; + --dug-chart-cpu: #7AA7FF; + --dug-chart-cpu-fill: #172A4D; + --dug-chart-memory: #A98BEB; + --dug-chart-memory-fill: #2A2145; + --dug-chart-net-rx: #4FD1C5; + --dug-chart-net-tx: #F2A54A; } html, @@ -99,7 +121,9 @@ body { margin: 0; background: var(--dug-bg-page); color: var(--dug-text); - font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif; + font-family: var(--dug-font-text); + font-size: 0.875rem; + line-height: 1.45; } a { @@ -108,7 +132,7 @@ a { .app-layout { min-height: 100vh; - background: var(--dug-bg-gradient); + background: var(--dug-bg-page); } .app-drawer { @@ -117,10 +141,10 @@ a { .app-drawer .mud-drawer-content { padding: 1.75rem 1.25rem 1.5rem; - color: #e2e8f0; - background: linear-gradient(180deg, #0f172a 0%, #172554 100%); + color: var(--dug-text); + background: var(--dug-surface); border-right: 1px solid var(--dug-border); - box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22); + box-shadow: none; } .app-drawer-content { @@ -132,21 +156,21 @@ a { height: 3rem; flex: 0 0 auto; border-radius: 0.9rem; - box-shadow: 0 10px 25px rgba(14, 165, 233, 0.25); } .app-brand__title { min-width: fit-content; - color: #f8fafc; + color: var(--dug-text); + font-family: var(--dug-font-display); font-size: clamp(1.15rem, 1.2rem + 0.3vw, 1.35rem); - font-weight: 800; + font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow-wrap: normal; } .app-nav-shell { - color: #e2e8f0; + color: var(--dug-text); display: flex; flex: 1 1 auto; flex-direction: column; @@ -164,7 +188,7 @@ a { } .nav-section-label { - color: rgba(191, 219, 254, 0.72); + color: var(--dug-text-muted); padding-inline: 0.75rem; } @@ -175,23 +199,22 @@ a { .app-nav-menu .mud-nav-link { margin-bottom: 0.35rem; padding: 1rem 1.05rem; - color: #e2e8f0; + color: var(--dug-text); border: 1px solid transparent; border-radius: var(--dug-radius-md); - transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease; } .app-nav-menu .mud-nav-link:hover { - color: #ffffff; - background: linear-gradient(rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.12)), #0f172a; - border-color: rgba(191, 219, 254, 0.12); - transform: translateX(2px); + color: var(--dug-text); + background: var(--dug-surface-subtle); } .app-nav-menu .mud-nav-link.active { - background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(6, 182, 212, 0.18)); - border-color: rgba(125, 211, 252, 0.22); - box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.08); + color: var(--dug-text); + font-weight: 600; + background: var(--dug-surface-subtle); + border-color: transparent; + box-shadow: none; } .app-nav-menu .mud-nav-link-icon { @@ -209,7 +232,7 @@ a { } .app-version__label { - color: #bfdbfe; + color: var(--dug-text-muted); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; @@ -217,7 +240,7 @@ a { .app-version__value { margin-top: 0.2rem; - color: rgba(226, 232, 240, 0.88); + color: var(--dug-text); font-size: 0.78rem; } @@ -226,7 +249,10 @@ a { } .mud-paper.app-topbar { - background: rgba(255, 255, 255, 0.72); + background: var(--dug-surface); + border: 1px solid var(--dug-border); + border-radius: var(--dug-radius-lg); + box-shadow: none; } .app-topbar { @@ -235,10 +261,6 @@ a { z-index: 1100; margin: 1.5rem 1.5rem 0.75rem; padding: 0.9rem 1.35rem; - backdrop-filter: blur(12px); - border: 1px solid var(--dug-border); - border-radius: var(--dug-radius-lg); - box-shadow: var(--dug-shadow-card); } .app-topbar__content { @@ -262,6 +284,7 @@ a { .app-topbar__title { color: var(--dug-text); + font-family: var(--dug-font-display); } .app-topbar__menu-button { @@ -286,7 +309,7 @@ a { .app-topbar__meta-card { min-width: 9rem; flex: 0 1 auto; - background: rgba(255, 255, 255, 0.78); + background: var(--dug-surface-subtle); } .app-topbar__status { @@ -343,15 +366,6 @@ a { gap: 1.25rem; } -.page-header h1, -.hero-panel h1, -.empty-state-panel h1 { - margin: 0; - font-size: clamp(1.8rem, 2.4vw, 2.6rem); - font-weight: 750; - letter-spacing: -0.03em; -} - .page-description, .hero-description, .section-description, @@ -371,32 +385,13 @@ a { .empty-state-panel, .summary-card { background: var(--dug-surface); - backdrop-filter: blur(10px); border: 1px solid var(--dug-border); border-radius: var(--dug-radius-lg); - box-shadow: var(--dug-shadow-card); -} - -.hero-panel, -.section-paper--accent { - position: relative; - overflow: hidden; -} - -.hero-panel::before, -.section-paper--accent::before { - content: ""; - position: absolute; - inset: 0 0 auto 0; - height: 3px; - background: linear-gradient(90deg, var(--dug-primary), var(--dug-secondary)); + box-shadow: none; } .hero-panel { padding: 2rem; - background: - linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(14, 165, 233, 0.08)), - rgba(255, 255, 255, 0.9); } .hero-meta-card, @@ -423,8 +418,8 @@ a { } .metric-card--warning .metric-card__icon { - background: color-mix(in srgb, var(--dug-warning) 14%, transparent); - color: var(--dug-warning); + background: color-mix(in srgb, var(--dug-attention) 14%, transparent); + color: var(--dug-attention); } .metric-card--danger .metric-card__icon { @@ -432,6 +427,14 @@ a { color: var(--dug-danger); } +.metric-card--warning .metric-value { + color: var(--dug-attention); +} + +.metric-card--danger .metric-value { + color: var(--dug-danger); +} + .metric-card-link { display: block; height: 100%; @@ -447,48 +450,34 @@ a { .summary-card, .app-nav-menu .mud-nav-link, .mud-button-root { - transition: transform var(--dug-transition), box-shadow var(--dug-transition), border-color var(--dug-transition), background-color var(--dug-transition); -} - -.metric-card-link:hover .metric-card, -.metric-card-link:focus-visible .metric-card { - transform: translateY(-2px); - border-color: rgba(37, 99, 235, 0.35); - box-shadow: var(--dug-shadow-hover); + transition: border-color var(--dug-transition), background-color var(--dug-transition); } -.metric-card:hover, -.summary-card:hover, -.app-nav-menu .mud-nav-link:hover, -.mud-button-root:hover { - box-shadow: var(--dug-shadow-hover); +.metric-card-link:hover .metric-card { + border-color: var(--dug-border-control); } -.metric-card:active, -.summary-card:active, -.app-nav-menu .mud-nav-link:active, -.mud-button-root:active { - transform: scale(0.99); +.metric-card-link:focus-visible .metric-card { + outline: 2px solid var(--dug-primary); + outline-offset: 2px; } -.metric-card:focus-visible, -.summary-card:focus-visible, .app-nav-menu .mud-nav-link:focus-visible, .mud-button-root:focus-visible { outline: 2px solid var(--dug-primary); outline-offset: 2px; } -.metric-card--warning { - background: - linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.88)), - rgba(255, 255, 255, 0.92); +.mud-button-filled, +.mud-button-filled:hover, +.mud-button-filled:active, +.mud-button-filled:focus-visible { + box-shadow: none; } -.metric-card--danger { - background: - linear-gradient(135deg, rgba(239, 68, 68, 0.10), rgba(255, 255, 255, 0.88)), - rgba(255, 255, 255, 0.92); +.mud-popover:not(.mud-tooltip), +.mud-dialog { + border: 1px solid var(--dug-border); } .metric-label { @@ -500,9 +489,10 @@ a { .metric-value { display: block; margin-top: 0.5rem; + font-family: var(--dug-font-display); font-size: clamp(1.5rem, 5vw, 1.95rem); font-variant-numeric: tabular-nums; - font-weight: 750; + font-weight: 600; letter-spacing: -0.03em; } @@ -510,22 +500,10 @@ a { padding: 1.5rem 1.6rem; } -.section-paper--accent { - background: - linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.05)), - rgba(255, 255, 255, 0.92); -} - .section-header { margin-bottom: 1.25rem; } -.section-header h2 { - margin: 0; - font-size: 1.2rem; - font-weight: 700; -} - .summary-grid { gap: 1rem; } @@ -554,11 +532,7 @@ a { } .summary-remediation--warning { - color: var(--dug-warning); -} - -.dug-dark .summary-remediation--warning { - color: #f59e0b; + color: var(--dug-attention); } .summary-card__detail-toggle.mud-button-root { @@ -606,12 +580,13 @@ a { } .table-link { - color: var(--dug-primary-strong); + color: var(--dug-link); font-weight: 600; } .table-link:hover { - color: #1e40af; + color: var(--dug-link); + text-decoration: underline; } .table-secondary { @@ -635,12 +610,13 @@ a { .section-table .mud-table-container { border-radius: var(--dug-radius-md); - border: 1px solid rgba(226, 232, 240, 0.92); - background: rgba(255, 255, 255, 0.88); + border: 1px solid var(--dug-border); + background: var(--dug-surface); } .section-table .mud-table-head .mud-table-cell { color: var(--dug-text-muted); + border-bottom: 1px solid var(--dug-border); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; @@ -707,7 +683,7 @@ a { } .runtime-containers-table .runtime-containers-table__name-icon-link:hover { - color: var(--dug-primary-strong); + color: var(--dug-link); } .runtime-containers-table .runtime-containers-table__name-icon { @@ -735,19 +711,19 @@ a { } .runtime-containers-table .runtime-containers-table__sparkline-line--cpu { - stroke: var(--dug-primary); + stroke: var(--dug-chart-cpu); } .runtime-containers-table .runtime-containers-table__sparkline-line--memory { - stroke: #7c3aed; + stroke: var(--dug-chart-memory); } .runtime-containers-table .runtime-containers-table__sparkline-line--network-rx { - stroke: var(--dug-secondary); + stroke: var(--dug-chart-net-rx); } .runtime-containers-table .runtime-containers-table__sparkline-line--network-tx { - stroke: #ea580c; + stroke: var(--dug-chart-net-tx); } .details-grid { @@ -797,10 +773,9 @@ a { display: block; margin-bottom: 0.75rem; padding: 0.9rem 1rem; - background: var(--dug-surface-solid); + background: var(--dug-surface); border: 1px solid var(--dug-border); border-radius: var(--dug-radius-md); - box-shadow: var(--dug-shadow-card); } .section-table .mud-table-body .mud-table-cell { @@ -842,22 +817,6 @@ a { .dug-chart { height: 240px; } - - .section-table .mud-table-body .mud-table-row.dug-rail-critical { - box-shadow: var(--dug-shadow-card), inset 3px 0 0 var(--dug-sev-critical); - } - - .section-table .mud-table-body .mud-table-row.dug-rail-high { - box-shadow: var(--dug-shadow-card), inset 3px 0 0 var(--dug-sev-high); - } - - .section-table .mud-table-body .mud-table-row.dug-rail-medium { - box-shadow: var(--dug-shadow-card), inset 3px 0 0 var(--dug-sev-medium); - } - - .section-table .mud-table-body .mud-table-row.dug-rail-low { - box-shadow: var(--dug-shadow-card), inset 3px 0 0 var(--dug-sev-low); - } } @media (max-width: 599.98px) { @@ -924,4 +883,4 @@ a { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } -} +} \ No newline at end of file diff --git a/src/DockerUpdateGuard/wwwroot/fonts/SpaceGrotesk-OFL.txt b/src/DockerUpdateGuard/wwwroot/fonts/SpaceGrotesk-OFL.txt new file mode 100644 index 00000000..d5666d70 --- /dev/null +++ b/src/DockerUpdateGuard/wwwroot/fonts/SpaceGrotesk-OFL.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Space Grotesk Project Authors (https://github.com/floriankarsten/space-grotesk) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/src/DockerUpdateGuard/wwwroot/fonts/SpaceGrotesk-Variable-latin.woff2 b/src/DockerUpdateGuard/wwwroot/fonts/SpaceGrotesk-Variable-latin.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..0f3474ee8af2f8253225f3b41bf79be986a1ae13 GIT binary patch literal 22288 zcmV)GK)%0sPew8T0RR9109OzI6aWAK0M5Js09K#?0RR9100000000000000000000 z0000QgCraJbR3CJKS)+VQiCZ5U_Vn-K~z{L9sq<|FGLXt3W0$z=64H(NB}VCSOGQy zBm;>I1Rw>3ZU>7B3D{ z{r~@GB*-Bn3HnE{ZS~!@APT9V5<7^B_Js`F5KNEO5xxvDEJe0@sBuD71qjHTQJWF7 z(lMhDs)UR{M{&~N@Z^*VS5!Xl6m8{zPv6RNJkc57kyX42LV}PWo#3o%&!1=O`wrRi z{k6E`ueYvPb_yx;@D(IGh?V@`PtxW9miG*&e+Qhx$IWOS<;ay01c;R>rFHU!EZv{$ z)t%T5-_o5z3g?aVb}Y0G-#O>40%MoQh^Sa6+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R9prMZ$!hhg1Z40upp?FMtUwqHxFq%xeFoe1IzhJ@ zTi3Xq`n4kk4?;aV;hyh&|Eos>#>GeP|NeKrbYsLJToUm*lPDYPudC^f%hR9chnWl+ znL_Gr5*bEDT%-ciB6^yL7W*& z(o&6F+uRxmSuGYJPA0@jE9Z5&)6T6OZJc3DfV?7H+qBh`X~HXj14q#aTvNNpqd@`n z1y$+pYbj;zYhzi-?Xv`WK$Td}>k=-Lsl9f~PtV5n<$g>aG>aCXcx-KaR zKwilXxsS{I6O!ww+-7D!1+O#^%~{RdWZB5f1`&`!7%QCPPcyF8nhvAm&r|=S6t`Ak;l~U#2X}hDDV28qhW`ybc`;H*E}6w$SU*m1zq*b}BajpV3phRF@cv z7!jh*^_S5Um6^*HYk>>P!u=u|^@v+hZcj82imuND%{L=lWqoh)~WS%!r#2bIZp|;2Q-hhEh1CzUW#ydIm-&W)@a9b`DOy zAP7mrP(YRHUDvAPJL12cI(lg`)C(d~@Yc#V(g{QkI%K~C&bz>i2Lq#RczWSkxyt3b8}fDZmI62J(#a;f6>}@n+4tV*Dy&mf zM9cxbe5a3YJ$m))GhmKE^UO8hLJJ(U#}uP1GGvUmj(Tr}l_r{OnyID}J3(TCg~mHh z>YJ~=Q~BVd!^})9=E>A(#5md3yW_5z?s@2u)6RSkpwkSk3u%w8PX6LC+LszKnUg8ui+K37$7Nnab^7vp)a=jl0EgnD4+}{4?m5{0 z-kEP4;)Eu)a@sa(NvQnqtQ%ewTU6MffuSc`i!E literal 0 HcmV?d00001 From 8a895fe79d5e326121c7372ea74d61c948aa8d27 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:02:03 +0000 Subject: [PATCH 10/24] Add deferred stylesheet tests for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + .../AppStylesheetTests.cs | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 9ca9f75f..94d01c34 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -15,3 +15,4 @@ are quoted in full. | 2026-11-28 19:47 | 4 Skeleton skipped (G1) | Orchestrator | skipped — plan Signatures: None, production change adds no member another type calls | | 2026-11-28 19:57 | 5 Tests first (G1) | Tester | RESULT: DONE, helpers StylesheetReader and ContrastRatio plus AppStylesheetTests and AppTests; confirmed 93 of 117 cases fail on current code, build clean. Deferred: AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress (sonnet/medium · 193,584 tokens · 29 tool uses · 525 s · 54 in · 57,909 out · 3,595,465 cache read · 190,510 cache write · 887,283 weighted) | | 2026-11-28 20:00 | 6 Implement (G1) | Dev | RESULT: DONE, app.css tokens/rules, Space Grotesk font + OFL, preload; build clean, 2496+39 tests pass, 117 target cases green (sonnet/medium · 151,001 tokens · 16 tool uses · 169 s · 22 in · 17,312 out · 1,331,225 cache read · 97,385 cache write · 341,436 weighted) | +| 2026-11-28 20:02 | 6 Coverage (G1) | Tester | RESULT: DONE, both deferred tests written and passing (AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress) (sonnet/medium · 97,667 tokens · 10 tool uses · 101 s · 20 in · 4,239 out · 869,846 cache read · 41,901 cache write · 160,576 weighted) | diff --git a/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs b/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs index ee7b6ffe..eacb51e0 100644 --- a/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs +++ b/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs @@ -163,6 +163,13 @@ private static readonly (string Chip, string LightBackground, string LightText, RegexOptions.CultureInvariant, TimeSpan.FromSeconds(5)); + /// + /// An http(s) address or a protocol-relative url() target + /// + private static readonly Regex _externalAddressPattern = new(@"https?://|url\(\s*[""']?//", + RegexOptions.CultureInvariant | RegexOptions.IgnoreCase, + TimeSpan.FromSeconds(5)); + #endregion // Fields #region Static methods @@ -632,6 +639,38 @@ public void AppStylesheetFlattensFilledButtonsAndBordersFloatingLayers() AssertNoMismatches(mismatches, "Filled buttons must be flat and floating layers must be bordered"); } + /// + /// Verify the reduced-motion media rule stays and zeroes the transition and animation durations of every element + /// + [TestMethod] + [TestCategory("AC7")] + public void AppStylesheetKeepsReducedMotionRule() + { + const string context = "@media (prefers-reduced-motion: reduce)"; + + var declarations = StylesheetReader.GetRules(ReadStylesheet()) + .Where(rule => rule.Context == context && rule.Selector == "*, *::before, *::after") + .SelectMany(rule => StylesheetReader.GetDeclarationList(rule.Body)) + .ToList(); + + Assert.AreSequenceEqual(new[] { ("transition-duration", "0.01ms !important"), ("animation-duration", "0.01ms !important") }, + declarations, + "The reduced-motion rule must set both durations to 0.01ms !important for every element and pseudo-element"); + } + + /// + /// Verify neither the document nor the stylesheet names an external address: no http(s) address and no protocol-relative url + /// + [TestMethod] + [TestCategory("AC3")] + public void AppAndStylesheetReferenceNoExternalAddress() + { + var offenders = new[] { "Components/App.razor", StylesheetPath }.SelectMany(path => FindExternalAddresses(path)) + .ToList(); + + AssertNoMismatches(offenders, "App.razor and app.css must not reference an external address"); + } + #endregion // Methods #region Helper methods @@ -802,6 +841,17 @@ private static IEnumerable FindTintedBackgrounds(string css, string sele .Select(name => $"{selector} sets {name}"); } + /// + /// Find the external addresses of a host file + /// + /// Path below the host project directory + /// Findings naming the file and the address + private static IEnumerable FindExternalAddresses(string relativePath) + { + return _externalAddressPattern.Matches(StylesheetReader.ReadHostFile(relativePath)) + .Select(match => $"{relativePath} contains {match.Value}"); + } + /// /// Assert there is nothing to report /// From 62596cc7bf77559b5f885d219b51f1fc0b9108d8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:02:32 +0000 Subject: [PATCH 11/24] Log G2 skeleton skip for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 94d01c34..f9cfd4a1 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -16,3 +16,4 @@ are quoted in full. | 2026-11-28 19:57 | 5 Tests first (G1) | Tester | RESULT: DONE, helpers StylesheetReader and ContrastRatio plus AppStylesheetTests and AppTests; confirmed 93 of 117 cases fail on current code, build clean. Deferred: AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress (sonnet/medium · 193,584 tokens · 29 tool uses · 525 s · 54 in · 57,909 out · 3,595,465 cache read · 190,510 cache write · 887,283 weighted) | | 2026-11-28 20:00 | 6 Implement (G1) | Dev | RESULT: DONE, app.css tokens/rules, Space Grotesk font + OFL, preload; build clean, 2496+39 tests pass, 117 target cases green (sonnet/medium · 151,001 tokens · 16 tool uses · 169 s · 22 in · 17,312 out · 1,331,225 cache read · 97,385 cache write · 341,436 weighted) | | 2026-11-28 20:02 | 6 Coverage (G1) | Tester | RESULT: DONE, both deferred tests written and passing (AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress) (sonnet/medium · 97,667 tokens · 10 tool uses · 101 s · 20 in · 4,239 out · 869,846 cache read · 41,901 cache write · 160,576 weighted) | +| 2026-11-28 20:02 | 4 Skeleton skipped (G2) | Orchestrator | skipped — plan Signatures: None, the theme stays the private field _theme | From 5ea50ce3c69cc0d4e3113ff549e23e5d1b982a4c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:05:02 +0000 Subject: [PATCH 12/24] Add failing theme tests for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + .../MainLayoutRenderTests.cs | 264 ++++++++++++++++++ 2 files changed, 265 insertions(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index f9cfd4a1..d196eb99 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -17,3 +17,4 @@ are quoted in full. | 2026-11-28 20:00 | 6 Implement (G1) | Dev | RESULT: DONE, app.css tokens/rules, Space Grotesk font + OFL, preload; build clean, 2496+39 tests pass, 117 target cases green (sonnet/medium · 151,001 tokens · 16 tool uses · 169 s · 22 in · 17,312 out · 1,331,225 cache read · 97,385 cache write · 341,436 weighted) | | 2026-11-28 20:02 | 6 Coverage (G1) | Tester | RESULT: DONE, both deferred tests written and passing (AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress) (sonnet/medium · 97,667 tokens · 10 tool uses · 101 s · 20 in · 4,239 out · 869,846 cache read · 41,901 cache write · 160,576 weighted) | | 2026-11-28 20:02 | 4 Skeleton skipped (G2) | Orchestrator | skipped — plan Signatures: None, the theme stays the private field _theme | +| 2026-11-28 20:05 | 5 Tests first (G2) | Tester | RESULT: DONE, 6 failing theme test cases in MainLayoutRenderTests (typography, light/dark palette, contrast, elevations); existing layout tests green. Deferred: none (sonnet/medium · 16,419 tokens · 6 tool uses · 145 s · 14 in · 10,025 out · 1,064,744 cache read · 153,723 cache write · 348,767 weighted · continued from 5 Tests first (G1)) | diff --git a/src/Tests/DockerUpdateGuard.Tests/MainLayoutRenderTests.cs b/src/Tests/DockerUpdateGuard.Tests/MainLayoutRenderTests.cs index af1938d4..1ec2e37c 100644 --- a/src/Tests/DockerUpdateGuard.Tests/MainLayoutRenderTests.cs +++ b/src/Tests/DockerUpdateGuard.Tests/MainLayoutRenderTests.cs @@ -14,6 +14,7 @@ using Microsoft.Extensions.Options; using MudBlazor; +using MudBlazor.Utilities; using NSubstitute; @@ -25,6 +26,20 @@ namespace DockerUpdateGuard.Tests; [TestClass] public class MainLayoutRenderTests { + #region Fields + + /// + /// Inter stack of the theme + /// + private static readonly string[] _interStack = ["Inter", "Segoe UI", "Arial", "Helvetica", "sans-serif"]; + + /// + /// Space Grotesk stack of the theme + /// + private static readonly string[] _spaceGroteskStack = ["Space Grotesk", "Inter", "Segoe UI", "Arial", "sans-serif"]; + + #endregion // Fields + #region Methods /// @@ -199,6 +214,255 @@ public async Task MainLayoutFailedReloadOnNavigationKeepsSummaryAndLogs() } } + /// + /// Verify the theme sets Inter for text and Space Grotesk for headlines, with the sizes of the refresh + /// + /// Task + [TestMethod] + [TestCategory("AC4")] + public async Task MainLayoutThemeUsesInterAndSpaceGroteskTypography() + { + var typography = (await RenderThemeAsync(false).ConfigureAwait(false)).Typography; + + var mismatches = FindTypographyMismatches("Default", typography.Default, _interStack, ".875rem", "1.45", "400").Concat(FindTypographyMismatches("Body1", typography.Body1, _interStack, ".875rem", "1.45", "400")) + .Concat(FindTypographyMismatches("H1", typography.H1, _spaceGroteskStack, null, null, null)) + .Concat(FindTypographyMismatches("H2", typography.H2, _spaceGroteskStack, null, null, null)) + .Concat(FindTypographyMismatches("H3", typography.H3, _spaceGroteskStack, "1.75rem", "1.2", "600")) + .Concat(FindTypographyMismatches("H4", typography.H4, _spaceGroteskStack, "1.25rem", "1.3", "600")) + .Concat(FindTypographyMismatches("H5", typography.H5, null, ".9375rem", "1.4", "600")) + .ToList(); + + if (typography.H3.LetterSpacing != "-0.02em") + { + mismatches.Add($"H3 letter spacing is '{typography.H3.LetterSpacing}'"); + } + + if (typography.H5.FontFamily is { } h5Family && h5Family.SequenceEqual(_interStack) == false) + { + mismatches.Add($"H5 family is '{string.Join(",", h5Family)}' instead of Inter"); + } + + Assert.AreEqual(string.Empty, string.Join("; ", mismatches), "The typography must follow the flat refresh"); + } + + /// + /// Verify the light theme carries the radius and the palette values of the refresh + /// + /// Task + [TestMethod] + [TestCategory("AC5")] + public async Task MainLayoutThemeCarriesLightPaletteAndRadius() + { + var theme = await RenderThemeAsync(false).ConfigureAwait(false); + var palette = theme.PaletteLight; + + var mismatches = FindPaletteMismatches([ + ("Primary", palette.Primary, "#2563EB"), + ("Secondary", palette.Secondary, "#5B6471"), + ("Info", palette.Info, "#1D4ED8"), + ("Success", palette.Success, "#067647"), + ("Warning", palette.Warning, "#B54708"), + ("Error", palette.Error, "#B42318"), + ("Background", palette.Background, "#F6F7F9"), + ("Surface", palette.Surface, "#FFFFFF"), + ("AppbarBackground", palette.AppbarBackground, "#FFFFFF"), + ("DrawerBackground", palette.DrawerBackground, "#FFFFFF"), + ("DrawerText", palette.DrawerText, "#16191D"), + ("TextPrimary", palette.TextPrimary, "#16191D"), + ("TextSecondary", palette.TextSecondary, "#5B6471"), + ("Divider", palette.Divider, "#E3E6EB"), + ("LinesDefault", palette.LinesDefault, "#E3E6EB"), + ("TableLines", palette.TableLines, "#EEF0F3"), + ("LinesInputs", palette.LinesInputs, "#C9CED6"), + ("TableHover", palette.TableHover, "#FAFBFC"), + ("PrimaryContrastText", palette.PrimaryContrastText, "#FFFFFF"), + ("InfoContrastText", palette.InfoContrastText, "#FFFFFF"), + ("ErrorContrastText", palette.ErrorContrastText, "#FFFFFF"), + ]); + + Assert.AreEqual("6px", theme.LayoutProperties.DefaultBorderRadius, "The default radius must be the control radius"); + Assert.AreEqual(string.Empty, string.Join("; ", mismatches), "The light palette must carry the refresh values"); + } + + /// + /// Verify in dark mode the theme carries the dark palette, the radius and the dark contrast texts of the status colors + /// + /// Task + [TestMethod] + [TestCategory("AC5")] + public async Task MainLayoutThemeInDarkModeCarriesDarkPaletteAndContrastTexts() + { + var theme = await RenderThemeAsync(true).ConfigureAwait(false); + var palette = theme.PaletteDark; + + var mismatches = FindPaletteMismatches([ + ("Primary", palette.Primary, "#7AA7FF"), + ("Secondary", palette.Secondary, "#9BA5B3"), + ("Info", palette.Info, "#9CC0FF"), + ("Success", palette.Success, "#5FD39A"), + ("Warning", palette.Warning, "#F2A54A"), + ("Error", palette.Error, "#FF8A80"), + ("Background", palette.Background, "#0F1216"), + ("Surface", palette.Surface, "#171B21"), + ("AppbarBackground", palette.AppbarBackground, "#171B21"), + ("DrawerBackground", palette.DrawerBackground, "#171B21"), + ("DrawerText", palette.DrawerText, "#E7EAEE"), + ("TextPrimary", palette.TextPrimary, "#E7EAEE"), + ("TextSecondary", palette.TextSecondary, "#9BA5B3"), + ("Divider", palette.Divider, "#272D36"), + ("LinesDefault", palette.LinesDefault, "#272D36"), + ("TableLines", palette.TableLines, "#20262E"), + ("LinesInputs", palette.LinesInputs, "#3A424E"), + ("TableHover", palette.TableHover, "#1B2027"), + ("PrimaryContrastText", palette.PrimaryContrastText, "#0F1216"), + ("SecondaryContrastText", palette.SecondaryContrastText, "#0F1216"), + ("InfoContrastText", palette.InfoContrastText, "#0F1216"), + ("SuccessContrastText", palette.SuccessContrastText, "#0F1216"), + ("WarningContrastText", palette.WarningContrastText, "#0F1216"), + ("ErrorContrastText", palette.ErrorContrastText, "#0F1216"), + ]); + + Assert.AreEqual("6px", theme.LayoutProperties.DefaultBorderRadius, "The default radius must be the control radius in dark mode"); + Assert.AreEqual(string.Empty, string.Join("; ", mismatches), "The dark palette must carry the refresh values and contrast texts"); + } + + /// + /// Verify each status color reaches 4.5:1 with its contrast text in both palettes + /// + /// Whether the dark palette is checked + /// Task + [TestMethod] + [TestCategory("AC6")] + [DataRow(false)] + [DataRow(true)] + public async Task MainLayoutThemeStatusColorsReachMinimumContrast(bool isDarkMode) + { + var theme = await RenderThemeAsync(isDarkMode).ConfigureAwait(false); + var pairs = isDarkMode ? GetStatusPairs(theme.PaletteDark) : GetStatusPairs(theme.PaletteLight); + + var low = pairs.Select(pair => (pair.Name, Ratio: ContrastRatio.Calculate(ToHex(pair.Text), ToHex(pair.Background)))) + .Where(pair => pair.Ratio < 4.5) + .Select(pair => $"{pair.Name} {pair.Ratio:0.00}:1") + .ToList(); + + Assert.HasCount(6, pairs, "Primary, Secondary, Info, Success, Warning and Error must be checked"); + Assert.AreEqual(string.Empty, string.Join("; ", low), "Every status color must reach 4.5:1 with its contrast text"); + } + + /// + /// Verify the theme switches off all 26 elevation shadows + /// + /// Task + [TestMethod] + [TestCategory("AC8")] + public async Task MainLayoutThemeSwitchesOffElevationShadows() + { + var elevations = (await RenderThemeAsync(false).ConfigureAwait(false)).Shadows.Elevation; + + Assert.HasCount(26, elevations, "The theme must define all 26 elevations"); + Assert.AreEqual(string.Empty, string.Join(", ", elevations.Where(elevation => elevation != "none")), "Every elevation must be none"); + } + + /// + /// Render the layout, optionally toggle dark mode, and read the theme handed to the theme provider + /// + /// Whether to click the dark-mode toggle first + /// Theme of the provider + private static async Task RenderThemeAsync(bool toggleDarkMode) + { + var testContext = CreateContext(dashboardSummary: null); + + await using (testContext) + { + var component = testContext.Render(parameters => parameters.Add(layout => layout.Body, string.Empty)); + + if (toggleDarkMode) + { + await component.Find(".app-topbar__theme-toggle").ClickAsync().ConfigureAwait(false); + } + + var provider = component.FindComponent().Instance; + + Assert.AreEqual(toggleDarkMode, component.Markup.Contains("dug-dark", StringComparison.Ordinal), "The layout must be in the requested mode"); + Assert.IsNotNull(provider.Theme, "The theme provider must receive a theme"); + + return provider.Theme; + } + } + + /// + /// Compare a typography with the expected family, size, line height and weight; null expectations are not checked + /// + /// Typography name + /// Typography + /// Expected family + /// Expected size + /// Expected line height + /// Expected weight + /// One text per difference + private static IEnumerable FindTypographyMismatches(string name, BaseTypography typography, string[]? family, string? size, string? lineHeight, string? weight) + { + if (family is not null && (typography.FontFamily?.SequenceEqual(family) ?? false) == false) + { + yield return $"{name} family is '{string.Join(",", typography.FontFamily ?? [])}'"; + } + + if (size is not null && typography.FontSize != size) + { + yield return $"{name} size is '{typography.FontSize}'"; + } + + if (lineHeight is not null && typography.LineHeight != lineHeight) + { + yield return $"{name} line height is '{typography.LineHeight}'"; + } + + if (weight is not null && typography.FontWeight != weight) + { + yield return $"{name} weight is '{typography.FontWeight}'"; + } + } + + /// + /// Compare palette colors with expected hexadecimal values + /// + /// Name, actual color and expected #RRGGBB + /// One text per difference + private static List FindPaletteMismatches((string Name, MudColor Actual, string Expected)[] colors) + { + return colors.Where(color => string.Equals(ToHex(color.Actual), color.Expected, StringComparison.OrdinalIgnoreCase) == false) + .Select(color => $"{color.Name} is {ToHex(color.Actual)}, expected {color.Expected}") + .ToList(); + } + + /// + /// Pair each status color with its contrast text + /// + /// Palette + /// Name, text and background + private static (string Name, MudColor Text, MudColor Background)[] GetStatusPairs(Palette palette) + { + return + [ + ("Primary", palette.PrimaryContrastText, palette.Primary), + ("Secondary", palette.SecondaryContrastText, palette.Secondary), + ("Info", palette.InfoContrastText, palette.Info), + ("Success", palette.SuccessContrastText, palette.Success), + ("Warning", palette.WarningContrastText, palette.Warning), + ("Error", palette.ErrorContrastText, palette.Error), + ]; + } + + /// + /// Write a color as #RRGGBB + /// + /// Color + /// Hexadecimal text + private static string ToHex(MudColor color) + { + return $"#{color.R:X2}{color.G:X2}{color.B:X2}"; + } + /// /// Create a bUnit test context wired up with the services required to render the layout /// From 87dbd01f010b020ed99fdca99008f576b400e44a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:07:38 +0000 Subject: [PATCH 13/24] Set flat MudBlazor theme for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + .../Components/Layout/MainLayout.razor.cs | 135 ++++++++++++++---- 2 files changed, 111 insertions(+), 25 deletions(-) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index d196eb99..642fcaf3 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -18,3 +18,4 @@ are quoted in full. | 2026-11-28 20:02 | 6 Coverage (G1) | Tester | RESULT: DONE, both deferred tests written and passing (AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress) (sonnet/medium · 97,667 tokens · 10 tool uses · 101 s · 20 in · 4,239 out · 869,846 cache read · 41,901 cache write · 160,576 weighted) | | 2026-11-28 20:02 | 4 Skeleton skipped (G2) | Orchestrator | skipped — plan Signatures: None, the theme stays the private field _theme | | 2026-11-28 20:05 | 5 Tests first (G2) | Tester | RESULT: DONE, 6 failing theme test cases in MainLayoutRenderTests (typography, light/dark palette, contrast, elevations); existing layout tests green. Deferred: none (sonnet/medium · 16,419 tokens · 6 tool uses · 145 s · 14 in · 10,025 out · 1,064,744 cache read · 153,723 cache write · 348,767 weighted · continued from 5 Tests first (G1)) | +| 2026-11-28 20:07 | 6 Implement (G2) | Dev | RESULT: DONE, theme in MainLayout.razor.cs, image build check passes; 2504+39 tests green (sonnet/medium · 19,811 tokens · 10 tool uses · 145 s · 18 in · 6,122 out · 1,188,628 cache read · 117,818 cache write · 296,763 weighted · continued) | diff --git a/src/DockerUpdateGuard/Components/Layout/MainLayout.razor.cs b/src/DockerUpdateGuard/Components/Layout/MainLayout.razor.cs index 49c9c65e..07c3da7d 100644 --- a/src/DockerUpdateGuard/Components/Layout/MainLayout.razor.cs +++ b/src/DockerUpdateGuard/Components/Layout/MainLayout.razor.cs @@ -27,10 +27,25 @@ public sealed partial class MainLayout : LayoutComponentBase, IDisposable /// private const string DarkModeStorageKey = "dug-dark-mode"; + /// + /// Contrast text of the dark status colors, the page ground color of the dark theme + /// + private const string DarkContrastText = "#0F1216"; + #endregion // Constants #region Fields + /// + /// Font stack of text, the same as --dug-font-text in app.css + /// + private static readonly string[] _textFonts = ["Inter", "Segoe UI", "Arial", "Helvetica", "sans-serif"]; + + /// + /// Font stack of titles and figures, the same as --dug-font-display in app.css + /// + private static readonly string[] _displayFonts = ["Space Grotesk", "Inter", "Segoe UI", "Arial", "sans-serif"]; + /// /// Application theme /// @@ -38,37 +53,107 @@ public sealed partial class MainLayout : LayoutComponentBase, IDisposable { LayoutProperties = new LayoutProperties { - DefaultBorderRadius = "18px", + DefaultBorderRadius = "6px", }, + Shadows = new Shadow + { + Elevation = [.. Enumerable.Repeat("none", 26)], + }, + Typography = new Typography + { + Default = new DefaultTypography + { + FontFamily = _textFonts, + FontSize = ".875rem", + LineHeight = "1.45", + FontWeight = "400", + }, + Body1 = new Body1Typography + { + FontFamily = _textFonts, + FontSize = ".875rem", + LineHeight = "1.45", + FontWeight = "400", + }, + H1 = new H1Typography + { + FontFamily = _displayFonts, + }, + H2 = new H2Typography + { + FontFamily = _displayFonts, + }, + H3 = new H3Typography + { + FontFamily = _displayFonts, + FontSize = "1.75rem", + FontWeight = "600", + LetterSpacing = "-0.02em", + LineHeight = "1.2", + }, + H4 = new H4Typography + { + FontFamily = _displayFonts, + FontSize = "1.25rem", + FontWeight = "600", + LetterSpacing = "0", + LineHeight = "1.3", + }, + H5 = new H5Typography + { + FontSize = ".9375rem", + FontWeight = "600", + LetterSpacing = "0", + LineHeight = "1.4", + }, + }, PaletteLight = new PaletteLight { - Primary = "#2563eb", - Secondary = "#0891b2", - Info = "#0284c7", - Success = "#15803d", - Warning = "#b45309", - Error = "#b91c1c", - Background = "#f3f6fb", - Surface = "#ffffff", - AppbarBackground = "rgba(255,255,255,0.82)", - DrawerBackground = "#0f172a", - DrawerText = "#e2e8f0", + Primary = "#2563EB", + Secondary = "#5B6471", + Info = "#1D4ED8", + Success = "#067647", + Warning = "#B54708", + Error = "#B42318", + Background = "#F6F7F9", + Surface = "#FFFFFF", + AppbarBackground = "#FFFFFF", + DrawerBackground = "#FFFFFF", + DrawerText = "#16191D", + TextPrimary = "#16191D", + TextSecondary = "#5B6471", + Divider = "#E3E6EB", + LinesDefault = "#E3E6EB", + TableLines = "#EEF0F3", + LinesInputs = "#C9CED6", + TableHover = "#FAFBFC", }, PaletteDark = new PaletteDark { - Primary = "#3b82f6", - Secondary = "#22d3ee", - Info = "#38bdf8", - Success = "#4ade80", - Warning = "#fbbf24", - Error = "#f87171", - Background = "#0b1220", - Surface = "#111a2e", - AppbarBackground = "rgba(15, 23, 42, 0.82)", - DrawerBackground = "#0b1220", - DrawerText = "#e2e8f0", - TextPrimary = "#e2e8f0", - TextSecondary = "#94a3b8", + Primary = "#7AA7FF", + Secondary = "#9BA5B3", + Info = "#9CC0FF", + Success = "#5FD39A", + Warning = "#F2A54A", + Error = "#FF8A80", + PrimaryContrastText = DarkContrastText, + SecondaryContrastText = DarkContrastText, + InfoContrastText = DarkContrastText, + SuccessContrastText = DarkContrastText, + WarningContrastText = DarkContrastText, + ErrorContrastText = DarkContrastText, + Background = "#0F1216", + Surface = "#171B21", + AppbarBackground = "#171B21", + DrawerBackground = "#171B21", + DrawerText = "#E7EAEE", + TextPrimary = "#E7EAEE", + TextSecondary = "#9BA5B3", + Divider = "#272D36", + LinesDefault = "#272D36", + TableLines = "#20262E", + LinesInputs = "#3A424E", + TableHover = "#1B2027", }, }; From e395e7db175dc2ca978b8cd34d4d81772d19829e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:08:52 +0000 Subject: [PATCH 14/24] Log coverage gate for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 642fcaf3..42ce6c56 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -19,3 +19,4 @@ are quoted in full. | 2026-11-28 20:02 | 4 Skeleton skipped (G2) | Orchestrator | skipped — plan Signatures: None, the theme stays the private field _theme | | 2026-11-28 20:05 | 5 Tests first (G2) | Tester | RESULT: DONE, 6 failing theme test cases in MainLayoutRenderTests (typography, light/dark palette, contrast, elevations); existing layout tests green. Deferred: none (sonnet/medium · 16,419 tokens · 6 tool uses · 145 s · 14 in · 10,025 out · 1,064,744 cache read · 153,723 cache write · 348,767 weighted · continued from 5 Tests first (G1)) | | 2026-11-28 20:07 | 6 Implement (G2) | Dev | RESULT: DONE, theme in MainLayout.razor.cs, image build check passes; 2504+39 tests green (sonnet/medium · 19,811 tokens · 10 tool uses · 145 s · 18 in · 6,122 out · 1,188,628 cache read · 117,818 cache write · 296,763 weighted · continued) | +| 2026-11-28 20:08 | 6 Coverage skipped (G2) | Orchestrator | Coverage gate passes: new/changed code 100.0% (97/97), overall 94.9%; no uncovered lines, no deferred tests open | From 3e435ea70abbdf590b1f62e8fd67f4e76cee673b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:09:50 +0000 Subject: [PATCH 15/24] Document flat token layer and fonts for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- docs/ARCHITECTURE.md | 25 ++++++++++++++++++-- docs/areas/web-ui.md | 14 +++++++++++ specs/feature-451-flat-refresh-tokens/log.md | 1 + 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 60917c36..6d1b2b2c 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -391,11 +391,32 @@ behavior is in [Registries](areas/registries.md). Blazor Server (**Interactive Server** render mode, applied at the `App` root — no WebAssembly, no Auto mode) with **MudBlazor** as the component -library, plus a hand-rolled CSS design-system layer -(`wwwroot\app.css`, light/dark via a `.dug-dark` class) on top of it. +library, plus a hand-rolled CSS token layer (`wwwroot\app.css`) on top of it. Pages, routes and what each page shows or triggers are specified in [Web UI](areas/web-ui.md). +- **Design tokens** (`wwwroot\app.css`) are the `--dug-*` custom properties + for colors, radii, fonts and the transition. The light values sit in + `:root`; the dark values sit in one block with the selector + `:is(.dug-dark, :root:has(.dug-dark))`, which applies while the layout + carries `dug-dark` and reaches the whole document, so menus, popovers and + dialogs that MudBlazor renders beside the layout take the dark values too + ([decision 0077](decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md)). + Every rule outside the two token blocks uses tokens only, with no blur, + gradient or drop shadow. +- **Fonts** are self-hosted from `wwwroot\fonts` and declared with + `@font-face` and `font-display: swap`: Inter for text and Space Grotesk + (variable latin subset, with its SIL Open Font License text) for page + titles, entity names and figures. `App.razor` preloads both files; the + page loads no font or style from another host. +- **MudBlazor theme** is the private `_theme` of `MainLayout`; it mirrors + the tokens: a 6 px default radius, the Inter stack as default font with + Space Grotesk for headings `h1`–`h4`, 14 px text with a line height of + 1.45, both palettes with the token colors, the page ground color as + contrast text of the dark status colors, and all 26 elevation shadows set + to `none` + ([decision 0078](decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md)). + - **Pages** (`Components\Pages`) have one `@page` route each. - **`IApplicationViewService` (`UI\ApplicationViewService`)** is the single facade every page depends on. It maps `DockerUpdateGuard.Data` entities diff --git a/docs/areas/web-ui.md b/docs/areas/web-ui.md index 53bc3375..0fd0d932 100644 --- a/docs/areas/web-ui.md +++ b/docs/areas/web-ui.md @@ -173,6 +173,16 @@ never their values. - If the browser storage cannot be read or written, the toggle still works for the session and the choice is not remembered. - Users who ask their system for reduced motion get (practically) no transitions or animations. +- Both themes are flat and come from one set of design values with a light and a dark variant: opaque surfaces + with a 1 px hairline border, no blur, gradient or drop shadow (including the shadows MudBlazor draws under tables, + the drawer and filled buttons), and no lift, scaling or shadow when a card, link or button is hovered or pressed. + Menus, popovers (tooltips excepted) and dialogs are separated from the content by a hairline border. +- In the dark theme the dark values apply to the whole document, so menus, popovers and dialogs are dark too. +- Text and status labels keep a contrast of at least 4.5:1 against their background in both themes; filled status + chips and buttons of the dark theme draw their label in the dark page color. +- Text is set in Inter; page titles, entity names, the figures of the dashboard's metric cards and the product name + are set in Space Grotesk. Both fonts and the styles are served by the application itself; the browser loads + nothing from another host for them, and until a font has loaded the text shows in a fallback font. ### Secrets @@ -258,6 +268,10 @@ never their values. missing record or a failed load inline. - [0060](../decisions/0060-a-detail-page-acts-only-on-the-state-of-its-current-route.md) — A detail page acts only on the state of its current route. +- [0077](../decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md) — The dark + theme's tokens apply to the whole document while the layout is dark. +- [0078](../decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md) — MudBlazor elevation + shadows are switched off in the theme. ## Not here diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 42ce6c56..2300b76c 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -20,3 +20,4 @@ are quoted in full. | 2026-11-28 20:05 | 5 Tests first (G2) | Tester | RESULT: DONE, 6 failing theme test cases in MainLayoutRenderTests (typography, light/dark palette, contrast, elevations); existing layout tests green. Deferred: none (sonnet/medium · 16,419 tokens · 6 tool uses · 145 s · 14 in · 10,025 out · 1,064,744 cache read · 153,723 cache write · 348,767 weighted · continued from 5 Tests first (G1)) | | 2026-11-28 20:07 | 6 Implement (G2) | Dev | RESULT: DONE, theme in MainLayout.razor.cs, image build check passes; 2504+39 tests green (sonnet/medium · 19,811 tokens · 10 tool uses · 145 s · 18 in · 6,122 out · 1,188,628 cache read · 117,818 cache write · 296,763 weighted · continued) | | 2026-11-28 20:08 | 6 Coverage skipped (G2) | Orchestrator | Coverage gate passes: new/changed code 100.0% (97/97), overall 94.9%; no uncovered lines, no deferred tests open | +| 2026-11-28 20:09 | 6 Documentation | Dev | RESULT: DONE, ARCHITECTURE section 9 and web-ui.md updated; decision-check passes, tests green (sonnet/medium · 8,182 tokens · 5 tool uses · 61 s · 12 in · 3,548 out · 865,378 cache read · 8,120 cache write · 114,440 weighted · continued) | From 588dc6a858ab0eab123d40012493acc241d86e30 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:11:10 +0000 Subject: [PATCH 16/24] Record gate stamp for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 2300b76c..bee58e1d 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -21,3 +21,4 @@ are quoted in full. | 2026-11-28 20:07 | 6 Implement (G2) | Dev | RESULT: DONE, theme in MainLayout.razor.cs, image build check passes; 2504+39 tests green (sonnet/medium · 19,811 tokens · 10 tool uses · 145 s · 18 in · 6,122 out · 1,188,628 cache read · 117,818 cache write · 296,763 weighted · continued) | | 2026-11-28 20:08 | 6 Coverage skipped (G2) | Orchestrator | Coverage gate passes: new/changed code 100.0% (97/97), overall 94.9%; no uncovered lines, no deferred tests open | | 2026-11-28 20:09 | 6 Documentation | Dev | RESULT: DONE, ARCHITECTURE section 9 and web-ui.md updated; decision-check passes, tests green (sonnet/medium · 8,182 tokens · 5 tool uses · 61 s · 12 in · 3,548 out · 865,378 cache read · 8,120 cache write · 114,440 weighted · continued) | +| 2026-11-28 20:11 | 7 Gate stamp | Orchestrator | PASS on 3e435ea70abbdf590b1f62e8fd67f4e76cee673b (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 87 hit(s) | From 65c4cd2435a3edee5b9458446cbf8b55e436f94c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:12:48 +0000 Subject: [PATCH 17/24] Log manual check for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index bee58e1d..f71e88d7 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -22,3 +22,4 @@ are quoted in full. | 2026-11-28 20:08 | 6 Coverage skipped (G2) | Orchestrator | Coverage gate passes: new/changed code 100.0% (97/97), overall 94.9%; no uncovered lines, no deferred tests open | | 2026-11-28 20:09 | 6 Documentation | Dev | RESULT: DONE, ARCHITECTURE section 9 and web-ui.md updated; decision-check passes, tests green (sonnet/medium · 8,182 tokens · 5 tool uses · 61 s · 12 in · 3,548 out · 865,378 cache read · 8,120 cache write · 114,440 weighted · continued) | | 2026-11-28 20:11 | 7 Gate stamp | Orchestrator | PASS on 3e435ea70abbdf590b1f62e8fd67f4e76cee673b (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 87 hit(s) | +| 2026-11-28 20:12 | 9 Manual check | Orchestrator | Ran the stamped head locally (dotnet run, local PostgreSQL) and screenshotted Dashboard and Runtime Containers, light and dark, 1360 and 400 px: both themes flat, dark ground rgb(15,18,22), Space Grotesk h3 28px and Inter 14px body, both fonts loaded, dug-dark on the layout. Not checked in the browser: compact top-bar menu in dark mode, tooltip border, focused metric card (no container data, no hover/keyboard run). Observation: at 400 px the brand title and theme toggle sit close/overlap, nowrap rule unchanged from main. | From 706cd3e0c37f5dbfd978de44f998a3a5f161ee9b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:16:45 +0000 Subject: [PATCH 18/24] Apply verbatim review doc fixes for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- docs/areas/web-ui.md | 2 +- ...mudblazor-elevation-shadows-are-switched-off-in-the-theme.md | 2 +- specs/feature-451-flat-refresh-tokens/log.md | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/areas/web-ui.md b/docs/areas/web-ui.md index 0fd0d932..6605f700 100644 --- a/docs/areas/web-ui.md +++ b/docs/areas/web-ui.md @@ -176,7 +176,7 @@ never their values. - Both themes are flat and come from one set of design values with a light and a dark variant: opaque surfaces with a 1 px hairline border, no blur, gradient or drop shadow (including the shadows MudBlazor draws under tables, the drawer and filled buttons), and no lift, scaling or shadow when a card, link or button is hovered or pressed. - Menus, popovers (tooltips excepted) and dialogs are separated from the content by a hairline border. + Menus, popovers (tooltips excepted) and dialogs are separated from the content by a hairline border; dialogs and snackbars also keep the drop shadow MudBlazor's own stylesheet gives them. - In the dark theme the dark values apply to the whole document, so menus, popovers and dialogs are dark too. - Text and status labels keep a contrast of at least 4.5:1 against their background in both themes; filled status chips and buttons of the dark theme draw their label in the dark page color. diff --git a/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md b/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md index 5f72555e..c5c3b0db 100644 --- a/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md +++ b/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md @@ -11,7 +11,7 @@ The flat refresh (#450) draws no shadows: panels are separated by hairlines. Besides the shadows of `app.css`, MudBlazor draws its own: every surface with an elevation above zero (each table, the dashboard's hero panel, the drawer) takes it from the theme's elevation levels, and filled buttons carry shadows written into MudBlazor's -stylesheet. Menus, popovers and dialogs use the same elevation levels to stand out from the content below. The pages +stylesheet. Menus and popovers use the same elevation levels to stand out from the content below; dialogs and snackbars carry shadows written into MudBlazor's stylesheet. The pages themselves are rebuilt only in later sub-issues, so this one may not change their markup. ## Options considered diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index f71e88d7..e00bd662 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -23,3 +23,5 @@ are quoted in full. | 2026-11-28 20:09 | 6 Documentation | Dev | RESULT: DONE, ARCHITECTURE section 9 and web-ui.md updated; decision-check passes, tests green (sonnet/medium · 8,182 tokens · 5 tool uses · 61 s · 12 in · 3,548 out · 865,378 cache read · 8,120 cache write · 114,440 weighted · continued) | | 2026-11-28 20:11 | 7 Gate stamp | Orchestrator | PASS on 3e435ea70abbdf590b1f62e8fd67f4e76cee673b (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 87 hit(s) | | 2026-11-28 20:12 | 9 Manual check | Orchestrator | Ran the stamped head locally (dotnet run, local PostgreSQL) and screenshotted Dashboard and Runtime Containers, light and dark, 1360 and 400 px: both themes flat, dark ground rgb(15,18,22), Space Grotesk h3 28px and Inter 14px body, both fonts loaded, dug-dark on the layout. Not checked in the browser: compact top-bar menu in dark mode, tooltip border, focused metric card (no container data, no hover/keyboard run). Observation: at 400 px the brand title and theme toggle sit close/overlap, nowrap rule unchanged from main. | +| 2026-11-28 20:16 | 8 Review | Reviewer | VERDICT: BLOCKING 2 \| NON-BLOCKING 1 on 3e435ea70abbdf590b1f62e8fd67f4e76cee673b. (1) app.css active drawer link loses to MudBlazor cascade (primary colour, weight 500): selector needs .mud-navmenu.app-nav-menu .mud-nav-link.active:not(.mud-nav-link-disabled) and font-weight 600 !important, test lookup to follow. (2) verbatim: web-ui.md:179 dialogs and snackbars keep MudBlazor shadows. Non-blocking verbatim: decision 0078 context line on dialogs. (opus/medium · 96,716 tokens · 24 tool uses · 207 s · 44 in · 20,165 out · 1,532,578 cache read · 94,261 cache write · 590,648 weighted) | +| 2026-11-28 20:16 | 8 Verbatim fix | Orchestrator | verbatim: [BLOCKING, verbatim] docs/areas/web-ui.md:179; [NON-BLOCKING, verbatim] docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md:14 | From eb80e29809ee53d82192a8799f9223041926d710 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:18:12 +0000 Subject: [PATCH 19/24] Raise active drawer link specificity over MudBlazor Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + src/DockerUpdateGuard/wwwroot/app.css | 7 +++++-- src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index e00bd662..c35bb1aa 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -25,3 +25,4 @@ are quoted in full. | 2026-11-28 20:12 | 9 Manual check | Orchestrator | Ran the stamped head locally (dotnet run, local PostgreSQL) and screenshotted Dashboard and Runtime Containers, light and dark, 1360 and 400 px: both themes flat, dark ground rgb(15,18,22), Space Grotesk h3 28px and Inter 14px body, both fonts loaded, dug-dark on the layout. Not checked in the browser: compact top-bar menu in dark mode, tooltip border, focused metric card (no container data, no hover/keyboard run). Observation: at 400 px the brand title and theme toggle sit close/overlap, nowrap rule unchanged from main. | | 2026-11-28 20:16 | 8 Review | Reviewer | VERDICT: BLOCKING 2 \| NON-BLOCKING 1 on 3e435ea70abbdf590b1f62e8fd67f4e76cee673b. (1) app.css active drawer link loses to MudBlazor cascade (primary colour, weight 500): selector needs .mud-navmenu.app-nav-menu .mud-nav-link.active:not(.mud-nav-link-disabled) and font-weight 600 !important, test lookup to follow. (2) verbatim: web-ui.md:179 dialogs and snackbars keep MudBlazor shadows. Non-blocking verbatim: decision 0078 context line on dialogs. (opus/medium · 96,716 tokens · 24 tool uses · 207 s · 44 in · 20,165 out · 1,532,578 cache read · 94,261 cache write · 590,648 weighted) | | 2026-11-28 20:16 | 8 Verbatim fix | Orchestrator | verbatim: [BLOCKING, verbatim] docs/areas/web-ui.md:179; [NON-BLOCKING, verbatim] docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md:14 | +| 2026-11-28 20:18 | 8 Fix | Dev | RESULT: DONE, active drawer link selector raised above MudBlazor cascade, font-weight 600 !important, hover/focus/active states grouped; browser-checked; test lookup and weight value adapted (the reviewer's fix prescribes !important); tests 2504+39 green (sonnet/medium · 7,934 tokens · 5 tool uses · 88 s · 12 in · 3,785 out · 730,583 cache read · 186,207 cache write · 324,754 weighted · continued) | diff --git a/src/DockerUpdateGuard/wwwroot/app.css b/src/DockerUpdateGuard/wwwroot/app.css index 29e67781..712169ae 100644 --- a/src/DockerUpdateGuard/wwwroot/app.css +++ b/src/DockerUpdateGuard/wwwroot/app.css @@ -209,9 +209,12 @@ a { background: var(--dug-surface-subtle); } -.app-nav-menu .mud-nav-link.active { +.mud-navmenu.app-nav-menu .mud-nav-link.active:not(.mud-nav-link-disabled), +.mud-navmenu.app-nav-menu .mud-nav-link.active:not(.mud-nav-link-disabled):hover:not(.mud-nav-link-disabled), +.mud-navmenu.app-nav-menu .mud-nav-link.active:not(.mud-nav-link-disabled):focus-visible:not(.mud-nav-link-disabled), +.mud-navmenu.app-nav-menu .mud-nav-link.active:not(.mud-nav-link-disabled):active:not(.mud-nav-link-disabled) { color: var(--dug-text); - font-weight: 600; + font-weight: 600 !important; background: var(--dug-surface-subtle); border-color: transparent; box-shadow: none; diff --git a/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs b/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs index eacb51e0..ef5909ca 100644 --- a/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs +++ b/src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs @@ -535,11 +535,11 @@ public void AppStylesheetDrawerIsSurfacePanelWithTokenTexts() var css = ReadStylesheet(); var drawer = StylesheetReader.GetDeclarations(css, ".app-drawer .mud-drawer-content"); - var activeLink = StylesheetReader.GetDeclarations(css, ".app-nav-menu .mud-nav-link.active"); + var activeLink = StylesheetReader.GetDeclarations(css, ".mud-navmenu.app-nav-menu .mud-nav-link.active:not(.mud-nav-link-disabled)"); var hoverLink = StylesheetReader.GetDeclarations(css, ".app-nav-menu .mud-nav-link:hover"); var mismatches = FindDeclarationMismatches("drawer", ReadBackground(drawer), [("background", "var(--dug-surface)")]).Concat(FindDeclarationMismatches("drawer", drawer, [("border-right", HairlineBorder)])) - .Concat(FindDeclarationMismatches("active link", activeLink, [("font-weight", "600"), ("color", "var(--dug-text)")])) + .Concat(FindDeclarationMismatches("active link", activeLink, [("font-weight", "600 !important"), ("color", "var(--dug-text)")])) .Concat(FindDeclarationMismatches("active link", ReadBackground(activeLink), [("background", "var(--dug-surface-subtle)")])) .Concat(FindDeclarationMismatches("hovered link", ReadBackground(hoverLink), [("background", "var(--dug-surface-subtle)")])) .Concat(FindDeclarationMismatches(".nav-section-label", StylesheetReader.GetDeclarations(css, ".nav-section-label"), [("color", "var(--dug-text-muted)")])) From 89570e666657c633727a850d4f935041dc51538b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:19:25 +0000 Subject: [PATCH 20/24] Record gate stamp after review fix for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index c35bb1aa..b20f229d 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -26,3 +26,4 @@ are quoted in full. | 2026-11-28 20:16 | 8 Review | Reviewer | VERDICT: BLOCKING 2 \| NON-BLOCKING 1 on 3e435ea70abbdf590b1f62e8fd67f4e76cee673b. (1) app.css active drawer link loses to MudBlazor cascade (primary colour, weight 500): selector needs .mud-navmenu.app-nav-menu .mud-nav-link.active:not(.mud-nav-link-disabled) and font-weight 600 !important, test lookup to follow. (2) verbatim: web-ui.md:179 dialogs and snackbars keep MudBlazor shadows. Non-blocking verbatim: decision 0078 context line on dialogs. (opus/medium · 96,716 tokens · 24 tool uses · 207 s · 44 in · 20,165 out · 1,532,578 cache read · 94,261 cache write · 590,648 weighted) | | 2026-11-28 20:16 | 8 Verbatim fix | Orchestrator | verbatim: [BLOCKING, verbatim] docs/areas/web-ui.md:179; [NON-BLOCKING, verbatim] docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md:14 | | 2026-11-28 20:18 | 8 Fix | Dev | RESULT: DONE, active drawer link selector raised above MudBlazor cascade, font-weight 600 !important, hover/focus/active states grouped; browser-checked; test lookup and weight value adapted (the reviewer's fix prescribes !important); tests 2504+39 green (sonnet/medium · 7,934 tokens · 5 tool uses · 88 s · 12 in · 3,785 out · 730,583 cache read · 186,207 cache write · 324,754 weighted · continued) | +| 2026-11-28 20:19 | 7 Gate stamp | Orchestrator | PASS on eb80e29809ee53d82192a8799f9223041926d710 (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 87 hit(s) | From 6f56ee6b17082aec29aef6531592f4b5fde0d6e8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:19:51 +0000 Subject: [PATCH 21/24] Log delta review for feature 451 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index b20f229d..08d8ad50 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -27,3 +27,4 @@ are quoted in full. | 2026-11-28 20:16 | 8 Verbatim fix | Orchestrator | verbatim: [BLOCKING, verbatim] docs/areas/web-ui.md:179; [NON-BLOCKING, verbatim] docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md:14 | | 2026-11-28 20:18 | 8 Fix | Dev | RESULT: DONE, active drawer link selector raised above MudBlazor cascade, font-weight 600 !important, hover/focus/active states grouped; browser-checked; test lookup and weight value adapted (the reviewer's fix prescribes !important); tests 2504+39 green (sonnet/medium · 7,934 tokens · 5 tool uses · 88 s · 12 in · 3,785 out · 730,583 cache read · 186,207 cache write · 324,754 weighted · continued) | | 2026-11-28 20:19 | 7 Gate stamp | Orchestrator | PASS on eb80e29809ee53d82192a8799f9223041926d710 (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 87 hit(s) | +| 2026-11-28 20:19 | 8 Review delta | Reviewer | VERDICT: APPROVE on eb80e29809ee53d82192a8799f9223041926d710. All round-1 findings fixed and verified in Chromium; delta introduces nothing new. (opus/medium · 4,737 tokens · 3 tool uses · 16 s · 8 in · 1,648 out · 291,249 cache read · 6,265 cache write · 61,283 weighted · continued) | From 6e4fb12cead04e46083315fecebb8fbfe00b8d3d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:19:59 +0000 Subject: [PATCH 22/24] Accept decision records 0077 and 0078 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- ...ns-apply-to-the-whole-document-while-the-layout-is-dark.md | 2 +- ...dblazor-elevation-shadows-are-switched-off-in-the-theme.md | 2 +- docs/decisions/README.md | 4 ++-- specs/feature-451-flat-refresh-tokens/log.md | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md b/docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md index 6b6eedfb..5a14c513 100644 --- a/docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md +++ b/docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md @@ -1,6 +1,6 @@ # 0077: The dark theme's tokens apply to the whole document while the layout is dark -- **Status:** Proposed +- **Status:** Accepted - **Date:** 2026-11-28 - **Area:** Web UI - **Source:** Issue #451 diff --git a/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md b/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md index c5c3b0db..a164539e 100644 --- a/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md +++ b/docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md @@ -1,6 +1,6 @@ # 0078: MudBlazor elevation shadows are switched off in the theme -- **Status:** Proposed +- **Status:** Accepted - **Date:** 2026-11-28 - **Area:** Web UI - **Source:** Issue #451 diff --git a/docs/decisions/README.md b/docs/decisions/README.md index bc2b1762..c3479c23 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -137,6 +137,6 @@ once in the [area document](../areas/README.md) of the record's area, and the re | [0074](0074-a-docker-engine-stats-or-image-inspect-answer-that-is-not-a-json-object-is-an-invalid-response.md) | A Docker Engine stats or image inspect answer that is not a JSON object is an invalid response | Accepted | 2026-11-28 | | [0075](0075-a-docker-engine-container-list-or-image-history-that-is-not-a-json-array-is-an-invalid-response.md) | A Docker Engine container list or image history that is not a JSON array is an invalid response | Accepted | 2026-11-28 | | [0076](0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md) | The .NET release index is parsed as a remote JSON object, and an entry that is not one is left out | Accepted | 2026-11-28 | -| [0077](0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md) | The dark theme's tokens apply to the whole document while the layout is dark | Proposed | 2026-11-28 | -| [0078](0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md) | MudBlazor elevation shadows are switched off in the theme | Proposed | 2026-11-28 | +| [0077](0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md) | The dark theme's tokens apply to the whole document while the layout is dark | Accepted | 2026-11-28 | +| [0078](0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md) | MudBlazor elevation shadows are switched off in the theme | Accepted | 2026-11-28 | \ No newline at end of file diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 08d8ad50..2300992b 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -28,3 +28,4 @@ are quoted in full. | 2026-11-28 20:18 | 8 Fix | Dev | RESULT: DONE, active drawer link selector raised above MudBlazor cascade, font-weight 600 !important, hover/focus/active states grouped; browser-checked; test lookup and weight value adapted (the reviewer's fix prescribes !important); tests 2504+39 green (sonnet/medium · 7,934 tokens · 5 tool uses · 88 s · 12 in · 3,785 out · 730,583 cache read · 186,207 cache write · 324,754 weighted · continued) | | 2026-11-28 20:19 | 7 Gate stamp | Orchestrator | PASS on eb80e29809ee53d82192a8799f9223041926d710 (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 87 hit(s) | | 2026-11-28 20:19 | 8 Review delta | Reviewer | VERDICT: APPROVE on eb80e29809ee53d82192a8799f9223041926d710. All round-1 findings fixed and verified in Chromium; delta introduces nothing new. (opus/medium · 4,737 tokens · 3 tool uses · 16 s · 8 in · 1,648 out · 291,249 cache read · 6,265 cache write · 61,283 weighted · continued) | +| 2026-11-28 20:19 | 9 PR approval | Orchestrator | approved by checklist; records 0077 and 0078 set to Accepted | From ff9aca9a9f3eb1a8b8afc298c7f4582d48a0a44b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:20:13 +0000 Subject: [PATCH 23/24] Record gate stamp for decision status Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md index 2300992b..8307baa5 100644 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ b/specs/feature-451-flat-refresh-tokens/log.md @@ -29,3 +29,4 @@ are quoted in full. | 2026-11-28 20:19 | 7 Gate stamp | Orchestrator | PASS on eb80e29809ee53d82192a8799f9223041926d710 (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 87 hit(s) | | 2026-11-28 20:19 | 8 Review delta | Reviewer | VERDICT: APPROVE on eb80e29809ee53d82192a8799f9223041926d710. All round-1 findings fixed and verified in Chromium; delta introduces nothing new. (opus/medium · 4,737 tokens · 3 tool uses · 16 s · 8 in · 1,648 out · 291,249 cache read · 6,265 cache write · 61,283 weighted · continued) | | 2026-11-28 20:19 | 9 PR approval | Orchestrator | approved by checklist; records 0077 and 0078 set to Accepted | +| 2026-11-28 20:20 | 7 Gate stamp | Orchestrator | PASS on 6e4fb12cead04e46083315fecebb8fbfe00b8d3d (tier standard, verbatim): Format check pass; decision-check.py pass; scope-check.py pass | From 019aafd91840ed42ff1db429e69a27441bebce94 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 20:21:04 +0000 Subject: [PATCH 24/24] Remove squad working record Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_018g33AUvKfBT3ECDpcLbiBP --- specs/feature-451-flat-refresh-tokens/log.md | 32 --- specs/feature-451-flat-refresh-tokens/plan.md | 221 ------------------ specs/feature-451-flat-refresh-tokens/spec.md | 188 --------------- .../feature-451-flat-refresh-tokens/tasks.md | 16 -- 4 files changed, 457 deletions(-) delete mode 100644 specs/feature-451-flat-refresh-tokens/log.md delete mode 100644 specs/feature-451-flat-refresh-tokens/plan.md delete mode 100644 specs/feature-451-flat-refresh-tokens/spec.md delete mode 100644 specs/feature-451-flat-refresh-tokens/tasks.md diff --git a/specs/feature-451-flat-refresh-tokens/log.md b/specs/feature-451-flat-refresh-tokens/log.md deleted file mode 100644 index 8307baa5..00000000 --- a/specs/feature-451-flat-refresh-tokens/log.md +++ /dev/null @@ -1,32 +0,0 @@ -# Log: Feature #451 - -One line per pipeline step: date and time of day (UTC), step, member, result. Lead decisions and escalations -are quoted in full. - -| Date | Step | Member | Result | -| ---- | ---- | ------ | ------ | -| 2026-11-28 19:29 | 1 Intake | Orchestrator | Feature #451 (flat refresh 1/9), branch claude/brave-noether-h51k4d off main 3acc54e | -| 2026-11-28 19:33 | 2a Spec | Lead | RESULT: DONE, spec.md written (10 criteria, no security area), removed tokens replaced at use sites (opus/medium · 113,351 tokens · 32 tool uses · 266 s · 58 in · 22,751 out · 2,204,570 cache read · 112,061 cache write · 728,236 weighted) | -| 2026-11-28 19:37 | 2a Spec challenge | Devil's Advocate | VERDICT: OBJECTIONS 2 major, 4 minor. Major: (1) dark tokens do not reach menus/popovers/dialogs rendered outside .dug-dark; (2) Typo.h4 entity headings on five pages contradict S3/AC4 and have no size. Minor: (3) body text 14px needs a MudBlazor Default/Body1 typography target; (4) focus outline belongs on .metric-card-link, summary cards are not clickable; (5) buttons and drawer links must not move/scale/shadow either; (6) AC1/2/6/7 need a stated verification (unit test reading app.css, contrast computation). (opus/medium · 77,859 tokens · 23 tool uses · 209 s · 44 in · 18,594 out · 1,161,360 cache read · 74,562 cache write · 488,569 weighted) | -| 2026-11-28 19:38 | 2a Spec revise (challenge) | Lead | RESULT: DONE, all six objections accepted and answered in the spec's Challenge section; plan-check --spec passes (opus/medium · 15,755 tokens · 12 tool uses · 80 s · 14 in · 8,450 out · 725,840 cache read · 15,871 cache write · 196,790 weighted · continued) | -| 2026-11-28 19:45 | 2b Plan | Lead | RESULT: DONE, tier standard, no security area, spec Approved by Lead, plan.md and tasks.md written, decision records 0077 and 0078 proposed (opus/medium · 63,949 tokens · 22 tool uses · 367 s · 40 in · 36,295 out · 3,039,712 cache read · 63,267 cache write · 825,169 weighted · continued) | -| 2026-11-28 19:47 | 2b Plan challenge | Devil's Advocate | VERDICT: OBJECTIONS 0 major, 1 minor. Minor: scope the floating-layer border rule to .mud-popover:not(.mud-tooltip), .mud-dialog so tooltips get no hairline; confirm with rendered markup. (opus/medium · 81,022 tokens · 21 tool uses · 151 s · 40 in · 13,421 out · 1,148,041 cache read · 79,501 cache write · 447,847 weighted) | -| 2026-11-28 19:47 | 2b Challenge notes | Orchestrator | minor objections appended verbatim to plan.md | -| 2026-11-28 19:47 | 4 Skeleton skipped (G1) | Orchestrator | skipped — plan Signatures: None, production change adds no member another type calls | -| 2026-11-28 19:57 | 5 Tests first (G1) | Tester | RESULT: DONE, helpers StylesheetReader and ContrastRatio plus AppStylesheetTests and AppTests; confirmed 93 of 117 cases fail on current code, build clean. Deferred: AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress (sonnet/medium · 193,584 tokens · 29 tool uses · 525 s · 54 in · 57,909 out · 3,595,465 cache read · 190,510 cache write · 887,283 weighted) | -| 2026-11-28 20:00 | 6 Implement (G1) | Dev | RESULT: DONE, app.css tokens/rules, Space Grotesk font + OFL, preload; build clean, 2496+39 tests pass, 117 target cases green (sonnet/medium · 151,001 tokens · 16 tool uses · 169 s · 22 in · 17,312 out · 1,331,225 cache read · 97,385 cache write · 341,436 weighted) | -| 2026-11-28 20:02 | 6 Coverage (G1) | Tester | RESULT: DONE, both deferred tests written and passing (AppStylesheetKeepsReducedMotionRule, AppAndStylesheetReferenceNoExternalAddress) (sonnet/medium · 97,667 tokens · 10 tool uses · 101 s · 20 in · 4,239 out · 869,846 cache read · 41,901 cache write · 160,576 weighted) | -| 2026-11-28 20:02 | 4 Skeleton skipped (G2) | Orchestrator | skipped — plan Signatures: None, the theme stays the private field _theme | -| 2026-11-28 20:05 | 5 Tests first (G2) | Tester | RESULT: DONE, 6 failing theme test cases in MainLayoutRenderTests (typography, light/dark palette, contrast, elevations); existing layout tests green. Deferred: none (sonnet/medium · 16,419 tokens · 6 tool uses · 145 s · 14 in · 10,025 out · 1,064,744 cache read · 153,723 cache write · 348,767 weighted · continued from 5 Tests first (G1)) | -| 2026-11-28 20:07 | 6 Implement (G2) | Dev | RESULT: DONE, theme in MainLayout.razor.cs, image build check passes; 2504+39 tests green (sonnet/medium · 19,811 tokens · 10 tool uses · 145 s · 18 in · 6,122 out · 1,188,628 cache read · 117,818 cache write · 296,763 weighted · continued) | -| 2026-11-28 20:08 | 6 Coverage skipped (G2) | Orchestrator | Coverage gate passes: new/changed code 100.0% (97/97), overall 94.9%; no uncovered lines, no deferred tests open | -| 2026-11-28 20:09 | 6 Documentation | Dev | RESULT: DONE, ARCHITECTURE section 9 and web-ui.md updated; decision-check passes, tests green (sonnet/medium · 8,182 tokens · 5 tool uses · 61 s · 12 in · 3,548 out · 865,378 cache read · 8,120 cache write · 114,440 weighted · continued) | -| 2026-11-28 20:11 | 7 Gate stamp | Orchestrator | PASS on 3e435ea70abbdf590b1f62e8fd67f4e76cee673b (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 87 hit(s) | -| 2026-11-28 20:12 | 9 Manual check | Orchestrator | Ran the stamped head locally (dotnet run, local PostgreSQL) and screenshotted Dashboard and Runtime Containers, light and dark, 1360 and 400 px: both themes flat, dark ground rgb(15,18,22), Space Grotesk h3 28px and Inter 14px body, both fonts loaded, dug-dark on the layout. Not checked in the browser: compact top-bar menu in dark mode, tooltip border, focused metric card (no container data, no hover/keyboard run). Observation: at 400 px the brand title and theme toggle sit close/overlap, nowrap rule unchanged from main. | -| 2026-11-28 20:16 | 8 Review | Reviewer | VERDICT: BLOCKING 2 \| NON-BLOCKING 1 on 3e435ea70abbdf590b1f62e8fd67f4e76cee673b. (1) app.css active drawer link loses to MudBlazor cascade (primary colour, weight 500): selector needs .mud-navmenu.app-nav-menu .mud-nav-link.active:not(.mud-nav-link-disabled) and font-weight 600 !important, test lookup to follow. (2) verbatim: web-ui.md:179 dialogs and snackbars keep MudBlazor shadows. Non-blocking verbatim: decision 0078 context line on dialogs. (opus/medium · 96,716 tokens · 24 tool uses · 207 s · 44 in · 20,165 out · 1,532,578 cache read · 94,261 cache write · 590,648 weighted) | -| 2026-11-28 20:16 | 8 Verbatim fix | Orchestrator | verbatim: [BLOCKING, verbatim] docs/areas/web-ui.md:179; [NON-BLOCKING, verbatim] docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md:14 | -| 2026-11-28 20:18 | 8 Fix | Dev | RESULT: DONE, active drawer link selector raised above MudBlazor cascade, font-weight 600 !important, hover/focus/active states grouped; browser-checked; test lookup and weight value adapted (the reviewer's fix prescribes !important); tests 2504+39 green (sonnet/medium · 7,934 tokens · 5 tool uses · 88 s · 12 in · 3,785 out · 730,583 cache read · 186,207 cache write · 324,754 weighted · continued) | -| 2026-11-28 20:19 | 7 Gate stamp | Orchestrator | PASS on eb80e29809ee53d82192a8799f9223041926d710 (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 87 hit(s) | -| 2026-11-28 20:19 | 8 Review delta | Reviewer | VERDICT: APPROVE on eb80e29809ee53d82192a8799f9223041926d710. All round-1 findings fixed and verified in Chromium; delta introduces nothing new. (opus/medium · 4,737 tokens · 3 tool uses · 16 s · 8 in · 1,648 out · 291,249 cache read · 6,265 cache write · 61,283 weighted · continued) | -| 2026-11-28 20:19 | 9 PR approval | Orchestrator | approved by checklist; records 0077 and 0078 set to Accepted | -| 2026-11-28 20:20 | 7 Gate stamp | Orchestrator | PASS on 6e4fb12cead04e46083315fecebb8fbfe00b8d3d (tier standard, verbatim): Format check pass; decision-check.py pass; scope-check.py pass | diff --git a/specs/feature-451-flat-refresh-tokens/plan.md b/specs/feature-451-flat-refresh-tokens/plan.md deleted file mode 100644 index eed0ee19..00000000 --- a/specs/feature-451-flat-refresh-tokens/plan.md +++ /dev/null @@ -1,221 +0,0 @@ -# Plan: Flat refresh 1/9 — design tokens, typography and MudBlazor theme - -Source: Issue #451 | [spec.md](spec.md) -Tier: standard — a visible behavior change of the UI (stylesheet, theme, a shipped font) that creates, changes or removes no security control -Security areas touched: none - -## Problem / root cause - -See [spec.md](spec.md), *Problem*. - -## Verified facts - -| # | Claim | Evidence | Status | -| - | ----- | -------- | ------ | -| 1 | No file but `app.css` references a `--dug-*` property | `grep -rn "dug-…"` over `*.razor`, `*.cs`, `*.css`, `*.js` of the host: only `app.css` (the `dug-rail-*` hits are class names) | confirmed | -| 2 | Removed tokens are used by five rules besides the ones that go: received sparkline, `.table-link`, name-icon-link hover, warning card icon, `.summary-remediation--warning` | `app.css` lines 426–427, 557, 609, 710, 746 | confirmed | -| 3 | Page titles are `MudText Typo.h3` (14), entity names `Typo.h4` in a section header (5 pages), section titles `Typo.h5`; `.page-header h1` and `.section-header h2` match nothing | grep of `Typo.h[1-6]` under `Components/` | confirmed | -| 4 | MudBlazor 9.14.0 defaults: Roboto stack, every contrast text white in both palettes, `Default` .875rem/1.43, `Body1` 1rem/1.5, `H4` 2.125rem | scratch probe of `new MudTheme()`, `PaletteLight`, `PaletteDark` | confirmed | -| 5 | A typography without a font family takes `Default`'s; families with spaces are quoted; `Shadows.Elevation` (26 entries) feeds `--mud-elevation-N` | scratch probe of `MudThemeProvider.BuildTheme()` | confirmed | -| 6 | Filled buttons' shadows are literals in `MudBlazor.min.css` (`.mud-button-filled`, `:hover`, `:active`), not elevation variables | `MudBlazor.min.css` 9.14.0 | confirmed | -| 7 | The popover, dialog and snackbar providers sit beside `MudLayout` | `MainLayout.razor` lines 3–8 | confirmed | -| 8 | Every token-table text and chip pair of #451 passes 4.5:1; white on the dark Info, Success, Warning, Error, Primary reads 1.8–2.4:1, `#0F1216` 7.9–10.2:1 | WCAG formula over the issue's values (Lead, scratch script) | confirmed | -| 9 | The font and its OFL text are in `docs/ui-concept/flat-refresh/mockups/fonts/` (22,288 bytes) | `ls -la` | confirmed | -| 10 | `.dockerignore` keeps `wwwroot/fonts/*` and a `.txt` | `.dockerignore`: `*.md` at the root, `docs/` | confirmed | -| 11 | `HostProjectDirectory.GetPath()` resolves `src/DockerUpdateGuard` from the test output | `Helper/HostProjectDirectory.cs` | confirmed | -| 12 | No Content-Security-Policy header limits fonts | grep `Content-Security-Policy` in `src` | confirmed | -| 13 | An unsupported `:has()` inside `:is()` drops only that branch | Selectors Level 4, *forgiving selector list* | confirmed | - -## Tests per criterion - -| AC | Test(s) | Test file | -| -- | ------- | --------- | -| AC1 | `AppStylesheetContainsNoBlurGradientOrElevationShadow`, `AppStylesheetContainsNoRemovedToken`, `AppStylesheetHasNoDarkRuleBesideTokenBlock`, `AppStylesheetRulesOutsideTokenBlocksUseOnlyTokenColors` | `AppStylesheetTests.cs` | -| AC2 | `AppStylesheetRootBlockHoldsEveryLightToken`, `AppStylesheetDarkBlockHoldsEveryDarkToken`, `AppStylesheetDarkBlockAppliesToDocumentWhileLayoutIsDark`; manual: compact menu muted text in dark mode (below) | `AppStylesheetTests.cs` | -| AC3 | `AppStylesheetDeclaresSpaceGroteskFontFace`; `AppPreloadsShippedSpaceGroteskFont`, `AppAndStylesheetReferenceNoExternalAddress` | `AppStylesheetTests.cs`; `AppTests.cs` | -| AC4 | `MainLayoutThemeUsesInterAndSpaceGroteskTypography`; `AppStylesheetSetsTextAndDisplayFonts`; manual: rendered fonts | `MainLayoutRenderTests.cs`; `AppStylesheetTests.cs` | -| AC5 | `MainLayoutThemeCarriesLightPaletteAndRadius`, `MainLayoutThemeInDarkModeCarriesDarkPaletteAndContrastTexts` | `MainLayoutRenderTests.cs` | -| AC6 | `AppStylesheetTokenPairsReachMinimumContrast` (one row per pair and theme), `MainLayoutThemeStatusColorsReachMinimumContrast`; `ContrastRatioCalculateBlackOnWhiteReturnsTwentyOne`, `ContrastRatioCalculateSameColorReturnsOne` for the helper | `AppStylesheetTests.cs`, `MainLayoutRenderTests.cs`, `ContrastRatioTests.cs` | -| AC7 | `AppStylesheetInteractionRulesNeitherMoveNorScale`, `AppStylesheetKeepsReducedMotionRule`; manual: screenshots (below) | `AppStylesheetTests.cs` | -| AC8 | `MainLayoutThemeSwitchesOffElevationShadows`; `AppStylesheetFlattensFilledButtonsAndBordersFloatingLayers`; manual: screenshots | `MainLayoutRenderTests.cs`; `AppStylesheetTests.cs` | -| AC9 | the existing `MainLayoutRenderTests` and `MainLayoutTests`, unchanged | — | -| AC10 | check: the Reviewer reads ARCHITECTURE §9 and `web-ui.md` against the code in step 8 | — | - -`StylesheetReaderTests` covers the helper, its line-ending normalizer with CRLF input first (`docs/UNIT_TESTS.md`, -*Tests that read repository documents*): `app.css` and `App.razor` are checked out with CRLF. - -Manual (AC2, AC4, AC7, AC8, AC9): the orchestrator runs the branch head locally (`dotnet run` of the host against a -development database) and takes the pull request's before and after screenshots — Dashboard, Runtime Containers and -a detail page, light and dark, at 1360 px and 400 px wide, plus the top bar's compact menu open in dark mode and a -keyboard-focused metric card — on the stamped head before step 8; the Reviewer checks them against S1–S8, E4, E5, -E8 in round 1. - -## Approach - -Layout: no new output; every value comes from the issue's tables, the spec and this section. - -**Font.** Copy `SpaceGrotesk-Variable-latin.woff2` and `SpaceGrotesk-OFL.txt` from -`docs/ui-concept/flat-refresh/mockups/fonts/` to `src/DockerUpdateGuard/wwwroot/fonts/` unchanged. `@font-face` -`"Space Grotesk"`, `url("fonts/SpaceGrotesk-Variable-latin.woff2") format("woff2")`, weight `300 700`, normal, -`font-display: swap`, after Inter's. `App.razor`: a second preload line after Inter's, same form, -`@Assets["fonts/SpaceGrotesk-Variable-latin.woff2"]`. - -**Tokens.** `:root` holds every light value of #451 section 1 (also radii and font stacks) plus `--dug-transition`; -the dark block, selector `:is(.dug-dark, :root:has(.dug-dark))` (E8, [0077](../../docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md)), -holds the dark values. Hex values in upper case as in the issue (tests compare case-insensitively). The seven -removed tokens and every `.dug-dark …` rule go; replacements of the use sites as the spec's *Open questions* say. - -**Rules** (`app.css`, outside the token blocks only `var(--dug-…)`, `inherit`, `transparent`, `currentColor`, -`color-mix` of a token; `box-shadow` only `inset` or `none`): -- `body`: `--dug-font-text`, `0.875rem`, line height `1.45`. `.app-layout`: `--dug-bg-page`. -- Panels (`.hero-panel`, `.metric-card`, `.section-paper`, `.empty-state-panel`, `.summary-card`, `.mud-paper.app-topbar`): - `--dug-surface`, `1px solid --dug-border`, `--dug-radius-lg`, no shadow, no blur. The `::before` stripes, the - tinted backgrounds of hero, accent, warning and danger cards go; `.metric-card--warning .metric-value` / - `--danger .metric-value` take `--dug-attention` / `--dug-danger`, their icons too. Top-bar meta cards: - `--dug-surface-subtle`. -- Hover/press: `.metric-card-link:hover .metric-card` only `border-color: --dug-border-control`; - `.metric-card-link:focus-visible .metric-card` the 2 px `--dug-primary` outline at 2 px, `.metric-card-link:focus-visible` - no own outline; no `transform` in any hover or `:active` rule (cards, nav links, `.mud-button-root`); transitions - only of `border-color` and `background-color`; `.mud-button-root:focus-visible` keeps its outline. The rule - `.metric-card:focus-visible, .summary-card:focus-visible` drops those two selectors. -- Filled buttons and floating layers ([0078](../../docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md)): - `.mud-button-filled` with `:hover`, `:active`, `:focus-visible` → `box-shadow: none`; `.mud-popover`, `.mud-dialog` - → `border: 1px solid var(--dug-border)`. -- Drawer (`.app-drawer .mud-drawer-content`): `--dug-surface`, `border-right: 1px solid --dug-border`, no shadow; - brand title, nav links, version value in `--dug-text`; `.nav-section-label`, version label `--dug-text-muted`; - `.mud-nav-link.active` weight 600, color `--dug-text`, background `--dug-surface-subtle`, no border or shadow; - hover background `--dug-surface-subtle`. `.app-brand__logo` loses its shadow. -- Typography in CSS: `.metric-value` and `.app-brand__title` `--dug-font-display`, weight 600; the dead rules - `.page-header h1, …` and `.section-header h2` are deleted (the theme sizes the headings). -- Tables: `.section-table .mud-table-container` `--dug-surface`, `--dug-border`; head cells' bottom border - `--dug-border`; `.table-link` and `:hover` `--dug-link` (hover underlined); below 960 px row cards `--dug-surface`, - `--dug-border`, `--dug-radius-md`, rails as `inset` alone. -- Sparklines: `--dug-chart-cpu`, `-memory`, `-net-rx`, `-net-tx`. -- `prefers-reduced-motion` block unchanged. - -**Theme** (`MainLayout.razor.cs`, field `_theme`, still private): -- `LayoutProperties.DefaultBorderRadius = "6px"`; `Shadows = new Shadow { Elevation = 26 × "none" }`. -- `Typography`: Inter stack `["Inter", "Segoe UI", "Arial", "Helvetica", "sans-serif"]`, Space Grotesk stack - `["Space Grotesk", "Inter", "Segoe UI", "Arial", "sans-serif"]`. `Default` and `Body1`: Inter, `.875rem`, `1.45`, - `400`. `H1`, `H2`: Space Grotesk (sizes default). `H3`: Space Grotesk, `1.75rem`, `600`, `-0.02em`, line height - `1.2`. `H4`: Space Grotesk, `1.25rem`, `600`, `0`, `1.3`. `H5`: `.9375rem`, `600`, `0`, `1.4` (Inter by default). -- `PaletteLight`: the #451 values; `Secondary` `#5B6471`; `Divider`, `LinesDefault` `#E3E6EB`; `TableLines` - `#EEF0F3`; `LinesInputs` `#C9CED6`; `TableHover` `#FAFBFC`; contrast texts stay white. -- `PaletteDark`: the #451 values; `Secondary` `#9BA5B3`; `Divider`, `LinesDefault` `#272D36`; `TableLines` - `#20262E`; `LinesInputs` `#3A424E`; `TableHover` `#1B2027`; `PrimaryContrastText`, `SecondaryContrastText`, - `InfoContrastText`, `SuccessContrastText`, `WarningContrastText`, `ErrorContrastText` `#0F1216`. -The two stacks are private constants or static readonly arrays of `MainLayout` (one definition each); the CSS stacks -are the same text. - -**Test helpers** (Tester, `Helper/`): `StylesheetReader` reads a host file through `HostProjectDirectory`, normalizes -`\r\n`, finds a rule by its exact selector text and reads its custom properties; `ContrastRatio` computes the WCAG -ratio of two `#RRGGBB` colors. `AppStylesheetTests` keeps the expected token table of #451 (both themes) as data -rows; the pairs of N3 are: `--dug-text`, `-text-muted`, `-text-faint`, `-icon`, `-primary`, `-link`, `-attention`, -`-danger`, `-success`, `-info` each on `--dug-bg-page`, `-surface`, `-surface-subtle`; `--dug-on-primary` on -`--dug-primary`; each chip `-fg` on its `-bg`. The theme test pairs each status color (Primary, Secondary, Info, -Success, Warning, Error) with its contrast text in both palettes. A dark-mode render uses the existing toggle path of -`MainLayoutRenderTests` (`CreateContext`, the `.app-topbar__theme-toggle` click) and reads `MudThemeProvider`'s -`Theme` and `IsDarkMode`. - -Early draft PR: no - -## Options considered - -- E8: the selector on the document root (chosen), a wrapper element around providers and layout, or the class on - `` by script — see [0077](../../docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md). -- E4: theme-wide `none` elevations (chosen), per-surface CSS overrides, `Elevation="0"` in the markup — see - [0078](../../docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md). -- Removed tokens as aliases until 9/9: lost, see spec *Open questions*. -- Theme in its own type (`ApplicationTheme.Create()`): lost — one consumer, the render test reaches it through - `MudThemeProvider`, and a new type adds API for nothing. -- A test reading `app.css` linked into the test output by the test `.csproj`: lost — `HostProjectDirectory` already - serves the shipped files without a build change. - -## Affected projects and types - -| Project | Type / file | Change | -| ------- | ----------- | ------ | -| DockerUpdateGuard | `wwwroot/app.css` | tokens and rules as *Approach* | -| DockerUpdateGuard | `wwwroot/fonts/SpaceGrotesk-Variable-latin.woff2`, `SpaceGrotesk-OFL.txt` | new, copied | -| DockerUpdateGuard | `Components/App.razor` | preload line | -| DockerUpdateGuard | `Components/Layout/MainLayout.razor.cs` | `_theme` initializer, two font-stack constants | -| DockerUpdateGuard.Tests | `AppStylesheetTests`, `AppTests`, `StylesheetReaderTests`, `ContrastRatioTests`, `Helper/StylesheetReader`, `Helper/ContrastRatio`; `MainLayoutRenderTests` | new; new tests added | - -## Signatures (for the Dev's skeleton) - -None: the production change adds no member another type calls (the theme stays the private field `_theme`). The test -helpers are the Tester's (step 5), internal static classes without nested types: `StylesheetReader.ReadHostFile`, -`NormalizeLineEndings`, `GetRuleBody`, `GetCustomProperties`; `ContrastRatio.Calculate` (two `#RRGGBB` strings, -returns `double`). - -## Test files - -`src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs`, `AppTests.cs`, `StylesheetReaderTests.cs`, -`ContrastRatioTests.cs`, `Helper/StylesheetReader.cs`, `Helper/ContrastRatio.cs` (new); -`MainLayoutRenderTests.cs` (new tests, existing ones unchanged). - -Existing test code that calls a changed signature: none. - -Files of the change no unit test can cover: none in the coverage scope. `app.css` and the font are no coverage -pathspecs; the `App.razor` preload line is one changed `.razor` line no test renders (`App` needs the full host), -which the covered `_theme` lines outweigh in the new-code figure. - -## Areas - -- `docs/areas/web-ui.md` (3638 words, +110 words): *Light and dark mode* gains the rules of the spec's *Area - documents* (flat themes from one set of design values, 4.5:1, self-hosted fonts and styles, dark values on menus - and dialogs too, no shadows, floating layers bordered); *Related decisions* lists 0077 and 0078. - -## Documentation updates - -Written by the Dev once the code is green, against that code: -- `docs/areas/web-ui.md`: as *Areas*. -- `docs/ARCHITECTURE.md`, section 9: the design-system sentence becomes the token layer in `app.css` (light in - `:root`, dark block reaching the whole document, linked to 0077), the MudBlazor theme in `MainLayout` mirroring it - with elevations off (0078), and the two self-hosted fonts (Inter for text, Space Grotesk for titles and figures). -- The sweep found no other enumeration: no `README.md`, `INSTALL.md` or `DOCKER.md` text names fonts, colors or the - theme; `docs/ui-concept/flat-refresh/README.md` stays the concept. No changelog file (release notes come from the - PR label, `enhancement`). No edit of `.squad/project.md` or *Test doubles* (the helpers are no doubles). - -## Architecture check - -No guarantee of `.squad/project.md` is touched: no I/O, data, integration or layering change; wiring stays in the -host. Theme state stays in `MainLayout` (`dug-dark` on the layout, storage key unchanged). ARCHITECTURE §9 is updated -as above. - -## Security considerations - -- [x] No limits: the change parses no input. -- [x] No exception reaches a user-visible message: none. -- The font is a passive static asset under the SIL OFL 1.1, served from the application; no external host, no script, - no package. - -## Decision records - -- `docs/decisions/0077-the-dark-theme-tokens-apply-to-the-whole-document-while-the-layout-is-dark.md` (Proposed) -- `docs/decisions/0078-mudblazor-elevation-shadows-are-switched-off-in-the-theme.md` (Proposed) - -## Out of scope / follow-ups - -As the spec's *Out of scope*; the detail page's chart series colors go with #456. - -Image build check (Dev, before step 8): the change adds static web assets and edits a `.razor` file, so the Dev runs -the *Image build check* of `.squad/stack.md` and lists `publish/wwwroot/fonts/` with the Space Grotesk file and its -license. - -## Challenge notes - -Devil's Advocate, plan mode, specs/feature-451-flat-refresh-tokens/ - -The plan holds up. I checked these claims myself and they are true: -- **Five use sites (fact 2).** The removed tokens are used by exactly five rules outside the ones that get deleted: `/home/user/DockerUpdateGuard/src/DockerUpdateGuard/wwwroot/app.css` lines 426–427, 557, 609, 710 and 746. Line 392 is the accent stripe, which is removed anyway. No `.razor`, `.cs` or `.js` file references a `--dug-*` property. -- **Headings (fact 3).** The code has 14 `Typo.h3` (including Error and NotFound), 5 `Typo.h4` (the entity names), 31 `Typo.h5` and no h1 or h2. Every h5 is a section-header title except the top-bar brand title, and `.app-brand__title` sets its own font-size (app.css line 141), so the theme's new H5 does not resize it. `.page-header h1` (line 346) and `.section-header h2` (line 523) match no element. -- **Button shadows (fact 6).** In `MudBlazor.min.css` 9.14.0 the shadows of `.mud-button-filled` and its `:hover`, `:focus-visible` and `:active` states are literal values. No color variant (`-primary` and so on) sets its own shadow. `app.css` is linked after `MudBlazor.min.css` (`App.razor` lines 9–10), so a `box-shadow: none` with the same specificity wins. -- **Providers (fact 7).** The popover, dialog and snackbar providers sit beside `MudLayout` (`MainLayout.razor` lines 3–8). The drawer is the only `Elevation="1"` in the markup. `ContainerActionConfirmation` is a `MudDialog`, which keeps MudBlazor's literal dialog shadow and gains the border, so E4 holds. -- **Contrast.** I recomputed the theme pairs: white on the light Primary, Secondary, Info, Success, Warning and Error is 5.17 to 6.70:1. `#0F1216` on the dark status colors is 7.87 to 10.19:1. -- **Files (facts 9, 10, 12).** The font file is 22,288 bytes and its license text is next to it. `.dockerignore` excludes only `*.md`, `docs/` and secrets, not `wwwroot/fonts`. No Content-Security-Policy exists in `src`. -- **No-change outcome.** None applies: the feature does not exist yet and no accepted record covers it. - -Objections: - -1. **minor:** Scope the floating-layer border rule to `.mud-popover:not(.mud-tooltip), .mud-dialog`, not bare `.mud-popover`. Why: MudBlazor renders `MudTooltip` as a popover carrying the `mud-tooltip` class, and this app uses tooltips (`RuntimeContainerDetail.razor` lines 44, 390, 442; `ObservedImageDetail.razor` line 197; `MyImageDetail.razor` line 181). They are dark-grey (`.mud-tooltip-default` uses `--mud-palette-gray-darker`), so bare `.mud-popover` would put a hairline around them and their arrow that no criterion asks for. My evidence for the tooltip markup is indirect: the CSS gives `.mud-tooltip` its own z-index, which only makes sense on the popover element, and the class names appear in the 9.14.0 DLL. The Dev should confirm it with the rendered markup while doing the screenshots: hover a digest on the Runtime Container detail page in both themes. diff --git a/specs/feature-451-flat-refresh-tokens/spec.md b/specs/feature-451-flat-refresh-tokens/spec.md deleted file mode 100644 index 8b79af6d..00000000 --- a/specs/feature-451-flat-refresh-tokens/spec.md +++ /dev/null @@ -1,188 +0,0 @@ -# Spec: Flat refresh 1/9 — design tokens, typography and MudBlazor theme - -Source: Issue #451 (part of #450) -Status: Approved by Lead - -## Problem - -The look of the web UI is defined twice: the `--dug-*` custom properties in `src/DockerUpdateGuard/wwwroot/app.css` -and the inline `MudTheme` in `src/DockerUpdateGuard/Components/Layout/MainLayout.razor.cs`. Both describe a glass look -(translucent surfaces, `backdrop-filter: blur`, gradients on the page, the hero panel and the metric cards, 45 px -shadows, 24 px and 16 px radii, a navy gradient drawer, cards that lift on hover). MudBlazor components do not use the -application's font at all: the theme sets no typography, so they fall back to MudBlazor's Roboto stack (checked -against MudBlazor 9.14.0). The flat refresh (#450) needs one flat token set for both themes, a second font for -headlines and figures, and a MudBlazor theme that matches the tokens, so that the later sub-issues can rebuild the -pages on it. After this feature every page keeps its current structure and renders flat. - -The target values are the tables of issue #451 (*Scope*, sections 1–4) and the concept document -`docs/ui-concept/flat-refresh/README.md`; this spec refers to them instead of repeating them. - -## Scenarios - -- S1: Given the light theme, when a user opens any page, then the page ground is the plain page color (no gradient), - every panel (hero panel, metric cards, section panels, empty-state panels, summary cards, top bar) is an opaque - surface with a 1 px hairline border and an 8 px radius, and nothing on the page is blurred, shadowed or drawn with - a gradient. -- S2: Given the dark theme (toggled, stored, or taken from the system preference), when a user opens any page, then - the page looks like S1 in the dark token values; no part of the page keeps a light or translucent surface. -- S3: Given any page, when it renders, then its title (the large heading of the page header, the dashboard's hero - panel and the error and not-found panels), the entity name heading of a detail page, the figures of the metric - cards and the product name in the top bar are in Space Grotesk, and all other text is in Inter, including text - inside MudBlazor components (buttons, chips, inputs, tables, alerts, menus). Page titles are 28 px, semibold, - letter spacing −0.02 em; entity name headings are 20 px semibold; section titles are 15 px semibold Inter; body - text is 14 px with a line height of 1.45, in MudBlazor's text components as well as in plain markup. -- S4: Given either theme, when MudBlazor components render (buttons, chips, alerts, inputs, table lines, dividers, - the drawer), then they take the theme colors of issue #451 section 4 and a 6 px default radius. -- S5: Given a dashboard metric card (a card inside the link that leads to its page), when the user hovers it, then - only its border changes to the control border color — it neither lifts, nor gains a shadow, nor scales when - pressed; when its link receives keyboard focus the card shows a 2 px outline in the primary color 2 px away from - it. Summary cards are not clickable and do not change on hover. Buttons neither move, scale nor gain a shadow when - hovered or pressed. -- S6: Given the navigation drawer, when it is shown, then it is a surface-colored panel with a hairline on its right, - its links and product name in the text color, its section label in the muted text color; the active link is - semibold on the subtle surface, and a hovered link gets the subtle surface without moving, scaling or gaining a - shadow. -- S7: Given a table with links or the resource sparklines of Runtime Containers, when it renders, then links use the - link color and the CPU, memory, received and sent sparklines use the four chart line colors. -- S8: Given the dashboard's warning and danger metric cards, when they render, then they look like every other metric - card except that their figure is in the attention or the danger color. - -## Errors and edge cases - -- E1: Space Grotesk cannot be loaded or loads slowly: the text first shows in the fallback of the stack (Inter, then - system fonts) and swaps when the font arrives; the page is usable throughout. -- E2: Page titles are MudBlazor headings of the `h3` level today (all 14 of them), the entity names of the detail - pages and of the single-instance view of Docker Instances headings of the `h4` level inside a section header - (five pages), and section titles of the `h5` level; the selectors the issue names (`.page-header h1`, - `.section-header h2`) match no element, and MudBlazor's default `h4` (34 px) would be larger than the page title. - The required look of S3 holds for the headings as they are rendered, not for those selectors. -- E8: MudBlazor renders menus, popovers, dialogs and snackbars outside the layout element that carries the dark - class (the compact metrics menu of the top bar, the container action confirmation). In the dark theme their - content takes the dark token values too — the muted text of the compact menu, say, is the dark muted grey on the - dark surface, not the light one (2.9:1). The dark values apply to the whole document while the layout is dark; - the class `dug-dark` stays on the layout (AC9). -- E3: Filled MudBlazor chips and buttons in a status color (Primary, Info, Success, Warning, Error) — used today for - severities, update states and run states on every page that is not yet rebuilt — draw their label in the - palette's contrast text, which MudBlazor 9.14.0 defaults to white in both palettes. On the light-colored status - colors of the dark theme in issue #451 white reaches only 1.8:1 to 2.4:1; in the dark theme these labels use the page ground color - `#0F1216` instead (issue #451 names it for Primary only), which gives 7.8:1 or more. -- E4: MudBlazor draws its own elevation shadow on surfaces that set no elevation of zero: every table, the dashboard's - hero panel, the drawer and filled buttons. These show no drop shadow either. Menus, popovers, dialogs and snackbars, - which float over the content, stay visibly separated from it (by a border or their shadow). -- E5: Below 960 px table rows keep their card layout; each card is flat (surface, hairline border, control radius, - no shadow), and a row with a severity keeps its 3 px colored rail on the left. -- E6: The drawer is light in the light theme now: none of its texts (product name, section label, links, version - label and value) keeps a near-white color that would vanish on the white surface. -- E7: A user who asks for reduced motion still gets practically no transitions or animations. - -## Non-functional requirements - -- N1: No request leaves the application for a font or a style: `App.razor` and `app.css` contain no `http://` or - `https://` address, today or after the change. -- N2: Space Grotesk is the variable latin subset (weights 300–700, about 22 kB `woff2`) of - `docs/ui-concept/flat-refresh/mockups/fonts/`, shipped with its SIL Open Font License 1.1 text next to it. -- N3: Every text color and every chip of the token tables of issue #451, and every MudBlazor status color with its - contrast text, has a contrast of at least 4.5:1 against its background in both themes. (The issue's values pass: the - lowest are 4.82:1, light primary on the page ground, and 5.81:1, the light Info chip.) -- N4: Compatibility: no route, action, text, computed value, CSS class name, breakpoint, storage key or render mode - changes; the server-rendered first paint stays light. - -## Acceptance criteria - -- AC1: `app.css` contains no `backdrop-filter`, no `linear-gradient`/`radial-gradient`, no `box-shadow` other than an - `inset` line or `none`, none of the removed tokens (`--dug-secondary`, `--dug-primary-strong`, `--dug-warning`, - `--dug-shadow-card`, `--dug-shadow-hover`, `--dug-blur`, `--dug-bg-gradient`), and no `.dug-dark` rule except the - dark token block; outside the light and the dark token blocks every color is a token reference (or `inherit`, - `transparent`, `currentColor`, or a `color-mix` of a token) (S1, S2, E6). -- AC2: Every token of the tables of issue #451 section 1 exists in `:root` with its light value and, where the table - gives one, in the dark token block with its dark value; `--dug-transition` stays. The dark block applies to the - whole document while the layout carries `dug-dark`, so that in dark mode a `--dug-*`-colored text inside the top - bar's compact metrics menu shows its dark value (S1, S2, E8). -- AC3: Space Grotesk and its license text are in `wwwroot/fonts`, the font is declared with `@font-face` and - `font-display: swap` next to Inter and preloaded in `App.razor` through `@Assets[...]` like `InterVariable.woff2`, - and the preload points at an existing asset (N1, N2, E1). -- AC4: The MudBlazor theme's default font family is the Inter stack and `h1`–`h4` use the Space Grotesk stack; its - default and `body1` typography are 14 px with a line height of 1.45, its `h3` (page titles) 28 px, semibold, - −0.02 em, its `h4` (entity names) 20 px semibold, and section titles (the `h5` headings in section headers) render - at 15 px semibold in Inter; figures (`.metric-value`) and the product name are in Space Grotesk, and the page body - is 14 px / 1.45 in Inter (S3, E2). -- AC5: The theme the layout hands to MudBlazor carries, in light and in dark mode, the default radius `6px` and the - palette values of issue #451 section 4 (Secondary = the muted text color of each theme; of its "line colors" - the input lines take the control border color, which the concept assigns to inputs, and row hover the subtle surface), and in dark mode the - contrast text `#0F1216` for Primary, Info, Success, Warning and Error (S4, E3). -- AC6: Each pair named in N3 reaches 4.5:1 in both themes, including the dark values the issue lets the implementer - adjust (N3, E3). -- AC7: Panels, hover, focus, drawer, links, sparklines and the warning and danger cards look as S1, S5, S6, S7 and S8 - say, and below 960 px the row cards as E5 says; reduced motion still switches transitions off (S1, S5–S8, E5, E7). -- AC8: Tables, the hero panel, the drawer and filled buttons show no MudBlazor elevation shadow, while menus, - popovers, dialogs and snackbars stay visibly separated from the content (E4). -- AC9: The dark-mode toggle, its storage key `dug-dark-mode`, the fallback to the system preference, the light first - paint and the class `dug-dark` on the layout behave as before, and the existing tests of the layout pass unchanged - (S2, N4). -- AC10: `docs/ARCHITECTURE.md` section 9 describes the token layer, the two fonts and the theme as built, and the Web - UI area document states the rules of *Area documents* below (N1, N3). - -Verification of these criteria (the plan names the tests): AC1, AC2's token values and dark-block selector, AC6 -and the CSS parts of AC3 and AC4 by a unit test that reads `wwwroot/app.css` (banned constructs, token blocks, -WCAG contrast of each N3 pair computed from the token values and the theme); AC3's preload and asset by a test of -`App.razor` or the static assets; AC4's theme part and AC5 by a render test of the layout in both modes reading the -theme handed to `MudThemeProvider`; AC9 by the existing layout tests. What only a browser shows — AC7, AC8, the -rendered fonts of AC4 and the dark compact menu of AC2 — is reviewed by hand in both themes and below 960 px, with -the before and after screenshots of the pull request, before step 9. - -## Out of scope - -- Markup changes of pages and layout, new components, removal of the hero panel or the metric cards (sub-issues - 2–9), renaming CSS classes; the one exception is a change of the layout that E8 needs, should the plan carry - the dark class to a higher element. -- The series colors of the three resource charts on the Runtime Container detail page: `app.css` has no rule that - colors them, MudBlazor takes them from the chart's options in the page's markup, so they follow the chart tokens - with the rebuild of that page (#456). -- Column heads in sentence case, chip sizes, the 44 px control height and the content width of the concept document: - they come with the components and pages of the later sub-issues. -- Removal of `--dug-surface-solid` (#459). - -## Open questions - -- Should the removed tokens stay as aliases until 9/9 to keep this diff small, or be replaced at their use sites now? - Answered: replaced now, no aliases. Every use site is in `app.css` itself — no Razor, C# or script file references - a `--dug-*` property — and there are only five rules besides the ones this feature deletes anyway: the received - sparkline (`--dug-secondary` → `--dug-chart-net-rx`), `.table-link` and the hover of the runtime container name - icon (`--dug-primary-strong` → `--dug-link`), the warning metric card icon and `.summary-remediation--warning` - (`--dug-warning` → `--dug-attention`). Aliases would save about five lines but give old names new meanings and defer a - free removal to 9/9; the shadow, blur and gradient tokens leave with the rules that use them. -- Do the page-title and section-title selectors of the issue apply? Answered: no (from the code, see E2); the criteria - name the headings by what renders. -- Which contrast text do the dark status colors get? Answered: the page ground color - `#0F1216`, from the contrast computation (see E3). - -## Area documents - -- `docs/areas/web-ui.md`, *Light and dark mode*: both themes are flat and come from one set of design values with a - light and a dark variant; text and status labels keep at least 4.5:1 against their background in both; the UI's - fonts (Inter for text, Space Grotesk for titles and figures) and styles are served by the application itself, and - the browser loads nothing from another host for them. -- `docs/ARCHITECTURE.md`, section 9 *UI layer*: the token layer in `app.css`, the MudBlazor theme in the layout that - mirrors it, and the two self-hosted fonts. - -## Challenge - -- MAJOR 1 (dark tokens do not reach menus, popovers and dialogs): accepted. Checked: `MudPopoverProvider` and - `MudDialogProvider` sit beside `` in `MainLayout.razor`, so content MudBlazor - renders there resolves `--dug-*` against `:root`. Added E8; AC2 now requires the dark block to apply to the whole - document while the layout carries `dug-dark` and checks a `--dug-*`-colored text in the top bar's compact metrics - menu; AC1 speaks of the dark token block instead of a `.dug-dark` selector. How the block reaches the document (a - selector that matches while the layout is dark, or the class on a higher element) is the plan's choice; the class - on the layout stays (AC9). -- MAJOR 2 (`Typo.h4` entity names): accepted. Checked the five call sites. S3 now names the entity name heading as - Space Grotesk, 20 px semibold — below the 28 px page title and above the 15 px section title, in the concept's - range for figures and headlines; AC4 sets the theme's `h4` to it, and E2 lists the `h4` level. -- MINOR 3 (body text target): accepted. AC4 now sets the theme's default and `body1` typography to 14 px / 1.45 besides - the page body. -- MINOR 4 (focus outline of the metric card): accepted. Checked `Dashboard.razor`: the card is a `MudPaper` inside - `MudLink Class="metric-card-link"`. S5 now speaks of the dashboard metric card, outlined while its link has - keyboard focus, and says summary cards are not clickable and do not change on hover. -- MINOR 5 (buttons and drawer links on hover and press): accepted. S5 adds that buttons neither move, scale nor gain a - shadow when hovered or pressed; S6 that a hovered drawer link does not move, scale or gain a shadow. -- MINOR 6 (verification): accepted. A paragraph after the criteria names the kind of check for each criterion and - what stays a review by hand in a browser; the plan names the tests. diff --git a/specs/feature-451-flat-refresh-tokens/tasks.md b/specs/feature-451-flat-refresh-tokens/tasks.md deleted file mode 100644 index 8a067956..00000000 --- a/specs/feature-451-flat-refresh-tokens/tasks.md +++ /dev/null @@ -1,16 +0,0 @@ -# Tasks: Flat refresh 1/9 — design tokens, typography and MudBlazor theme - -Plan: [plan.md](plan.md) - -| # | Group | Task | Files | Criteria | Depends on | Owner | Done | -| - | ----- | ---- | ----- | -------- | ---------- | ----- | ---- | -| 1 | G1 | Skeleton: no new API (stylesheet, font and preload only) | — | — | — | Dev | [ ] | -| 2 | G1 | Test helpers `StylesheetReader` and `ContrastRatio` with their tests (normalizer with CRLF input first) | `src/Tests/DockerUpdateGuard.Tests/Helper/StylesheetReader.cs`, `src/Tests/DockerUpdateGuard.Tests/Helper/ContrastRatio.cs`, `src/Tests/DockerUpdateGuard.Tests/StylesheetReaderTests.cs`, `src/Tests/DockerUpdateGuard.Tests/ContrastRatioTests.cs` | AC1, AC2, AC6 | 1 | Tester | [ ] | -| 3 | G1 | Failing tests of the stylesheet and the preload | `src/Tests/DockerUpdateGuard.Tests/AppStylesheetTests.cs`, `src/Tests/DockerUpdateGuard.Tests/AppTests.cs` | AC1, AC2, AC3, AC4, AC6, AC7, AC8 | 2 | Tester | [ ] | -| 4 | G1 | Copy the font and its license, add `@font-face` and the preload, rewrite tokens and rules of `app.css` | `src/DockerUpdateGuard/wwwroot/fonts/`, `src/DockerUpdateGuard/wwwroot/app.css`, `src/DockerUpdateGuard/Components/App.razor` | AC1, AC2, AC3, AC4, AC6, AC7, AC8 | 3 | Dev | [ ] | -| 5 | G2 | Skeleton: no new API (the theme stays the private field `_theme`) | — | — | 4 | Dev | [ ] | -| 6 | G2 | Failing theme tests in both modes (typography, palettes, contrast texts, elevations, radius) | `src/Tests/DockerUpdateGuard.Tests/MainLayoutRenderTests.cs` | AC4, AC5, AC6, AC8, AC9 | 5 | Tester | [ ] | -| 7 | G2 | Theme of `MainLayout`: radius, shadows, typography, both palettes | `src/DockerUpdateGuard/Components/Layout/MainLayout.razor.cs` | AC4, AC5, AC6, AC8, AC9 | 6 | Dev | [ ] | -| 8 | G2 | Image build check: the font and its license in `publish/wwwroot/fonts/` | — | AC3 | 7 | Dev | [ ] | -| 9 | G2 | Local run and the screenshots of the plan's manual check | — | AC2, AC4, AC7, AC8, AC9 | 7 | Orchestrator | [ ] | -| 10 | G2 | Documentation: Web UI *Light and dark mode* and *Related decisions*, ARCHITECTURE section 9 | `docs/areas/web-ui.md`, `docs/ARCHITECTURE.md` | AC10 | 7 | Dev | [ ] |