Skip to content

[UI] Flat refresh 2/9: shared components for status, severity, page header, panel and tables #452

Description

@LarsLaskowski

Part of #450. Depends on #451 (tokens). The page sub-issues 3 and 5–9 use the components of this issue.

Problem

The pages build the same things by hand, each a little differently:

  • Status colors are duplicated per page. GetScanStatusColor exists seven times (Dashboard, ScanHistory, ObservedImages, ObservedImageDetail, RuntimeContainerDetail, MyImages, MyImageDetail), GetUpdateStateColor twice (RuntimeContainers, RuntimeContainerDetail), GetBaseRuntimeAlertColor twice, and four pages wrap VulnerabilityDisplayFormatter. The copies disagree: the scan status helpers color only some states, so Succeeded and Partial are shown without color ([BUG] Scan status chips show Succeeded and Partial without color on list pages #274).
  • Page headers come in two shapes (hero-panel on the dashboard, page-header with an eyebrow label elsewhere), and most pages repeat the description a second time above the table.
  • Sections are MudPaper Class="section-paper" with a hand-written section-header.
  • Tables share the class section-table, whose head is uppercase with letter spacing and whose container has its own border and radius inside the bordered section.

Target

One set of small components and one table style, shown here on the Scan History and Vulnerabilities mockups (the pages themselves are converted in later sub-issues):

Scan History

Vulnerabilities

Scope

All components go to src/DockerUpdateGuard/Components/Common, follow the code style of the repository (code-behind, regions, XML documentation) and get bUnit tests. They render plain elements with CSS classes from app.css, not MudChip, so that their colors come from the tokens of #451 alone.

1. One place that maps a status to a tone

Add a shared formatter in src/DockerUpdateGuard/UI (next to VulnerabilityDisplayFormatter, or as an extension of it) that maps a value to a tone. Tones: Neutral, Info, Success, Warning, Danger, plus the four severities Critical, High, Medium, Low. Comparison ignores case; an unknown or empty value is Neutral.

Value Tone
Scan status Succeeded Success
Scan status Partial Warning
Scan status Failed Danger
Scan status Running Info
Scan status Pending Neutral
Update state Update available Warning
Update state Up to date Success
Update state Manual review required Info
Update state Failed Danger
Update state Unsupported and any other Neutral
Vulnerability status No findings Success
Vulnerability status Findings detected the highest severity present in the summary
Vulnerability status Failed Danger
Vulnerability status Not scanned, Not configured, Unsupported, Unavailable Neutral
Runtime status Running Info
Runtime status Paused, Restarting Warning
Runtime status Exited, Dead Neutral
Severity Critical, High, Medium, Low the same severity; anything else Low

The values are the texts the view models carry today (ApplicationViewService maps UpdateAssessmentStatus and VulnerabilityAssessmentStatus to them) and the names of ScanRunStatus and ContainerRuntimeStatus.

2. StatusChip

Parameters: Text (string), Tone. Renders <span class="dug-chip dug-chip--{tone}">. 12 px, semibold, padding 1 px / 8 px, radius --dug-radius-sm, background and text from the chip tokens of #451: Critical/Danger use the critical pair, High/Warning the high pair, Medium the medium pair, Low/Neutral the low pair, Success and Info their own.

3. ScanStatusIndicator

Parameter: Status (string). Renders an 8 px dot and the status text, 8 px apart.

Tone Dot Text
Success --dug-success normal weight, --dug-text
Warning --dug-attention semibold, --dug-chip-high-fg
Danger --dug-danger semibold, --dug-danger
Info --dug-primary semibold, --dug-link
Neutral --dug-text-muted normal weight, --dug-text-muted

The text is always shown; the dot alone never carries the meaning. This is the fix of #274 for every page that uses the component.

4. SeverityBar

Parameter: Summary (VulnerabilitySeveritySummaryViewData). Renders nothing when the total is 0. Otherwise:

  • a bar of 8 px height with radius 4 px, one segment per severity with a count above 0, widths proportional to the counts, 2 px gap, colors --dug-sev-critical … --dug-sev-low; findings of another severity count as low;
  • below it a legend in 12.5 px muted text: 2 critical, 9 high, 14 medium, 6 low (only the ones above 0);
  • the bar has role="img" and an aria-label that reads the distribution (Severity distribution: 2 critical, 9 high, 14 medium, 6 low).

VulnerabilitySeverityChips stays for the places that use it and renders its chips as StatusChips in the severity tones.

5. PageHeader

Parameters: Title, Description (optional), Actions (optional fragment, right-aligned, wraps below the text on narrow screens), Breadcrumb (optional fragment above the title), TitleContent (optional fragment next to the title, for chips).

  • h1, 28 px semibold in --dug-font-display; description 14 px in --dug-text-muted, 4 px below; at most 70 characters wide.
  • No eyebrow label, no background, no border.
  • PageHeaderSkeleton takes the same shape (its test asserts the class hero-panel today).

6. SectionPanel

Parameters: Title, Meta (optional muted text on the right of the title, for example 23 containers on 2 Docker instances), HeaderContent (optional fragment instead of Meta, for filters), ChildContent, Flush (bool: content runs to the panel edge, for tables).

  • Surface --dug-surface, 1 px --dug-border, radius --dug-radius-lg, no shadow.
  • Header: padding 16 px / 20 px, h2 15 px semibold in --dug-font-text, Meta 13 px muted, both on one baseline, wrapping on narrow screens.
  • TableSkeleton takes the same shape (its tests assert the class section-paper today).

7. Table style

Restyle .section-table (MudTable) in app.css:

  • Head cells: 13 px, medium weight (500), --dug-text-muted, sentence case — no uppercase, no letter spacing; a 1 px --dug-border rule above and below the head row.
  • Body rows: separated by 1 px --dug-border-inner; cell padding 12 px vertical, 16 px horizontal, 20 px on the first and last cell so that the content lines up with the panel header; top-aligned; hover background --dug-surface-subtle.
  • Inside a flush SectionPanel the table container has no border, radius or background of its own.
  • A secondary line in a cell (.table-secondary) is 13 px in --dug-text-muted.
  • Figures use font-variant-numeric: tabular-nums.
  • Below 960 px the rows stay cards, as today: --dug-surface, 1 px --dug-border, radius --dug-radius-lg, no shadow; the label in front of a value is 12 px muted in sentence case.

8. Buttons and inputs

Global rules for the MudBlazor controls the pages use:

  • Buttons are not uppercase. Primary (Variant.Filled, Color.Primary): background --dug-primary, text --dug-on-primary, radius --dug-radius-md, at least 44 px high, horizontal padding 18 px, semibold. Secondary (Variant.Outlined): background --dug-surface, 1 px --dug-border-control, text --dug-text.
  • Icon buttons in rows: 44 × 44 px, 1 px --dug-border, radius --dug-radius-md, icon in --dug-icon, with an aria-label.
  • Text fields and selects: at least 44 px high, 1 px --dug-border-control, radius --dug-radius-md, label above the field in 13 px medium weight.
  • VulnerabilityRescanControl: the rescan becomes such an icon button with aria-label="Rescan vulnerabilities"; tooltip, progress state, the text Checked … / Never scanned and the error message next to it stay.

9. Existing shared components

  • VulnerabilityFindingsTable uses StatusChip for the severity and the table style above.
  • VulnerabilityAssessmentCard keeps its content and uses the tokens and StatusChip.

Behavior that must not change

  • No page is converted here; the duplicated helpers of the pages are removed in the page sub-issues when the page adopts the components.
  • Texts of statuses are shown as the view models deliver them.
  • The rescan action, its disabled state while running and its error handling (Web UI, Actions).

Out of scope

  • Layout of any page, the dashboard, the app shell.
  • Coloring a status by anything other than the mapping above.

Affected files

  • New: Components/Common/StatusChip.razor(.cs), ScanStatusIndicator.razor(.cs), SeverityBar.razor(.cs), PageHeader.razor(.cs), SectionPanel.razor(.cs), the tone type and the formatter under UI/.
  • Changed: Components/Common/PageHeaderSkeleton.razor, TableSkeleton.razor, VulnerabilityRescanControl.razor, VulnerabilitySeverityChips.razor, VulnerabilityFindingsTable.razor, VulnerabilityAssessmentCard.razor, wwwroot/app.css.
  • Docs: docs/ARCHITECTURE.md section 9 (Components\Common now also holds the status, header and panel building blocks).

Tests

  • New bUnit tests per component: every row of the mapping table (data-driven), the rendered class per tone, SeverityBar with all, some and no severities (segments, legend, aria-label, nothing for a total of 0), PageHeader and SectionPanel with and without their optional parts.
  • Existing tests that assert markup of the changed components and must follow: PageHeaderSkeletonTests (hero-panel), TableSkeletonTests (section-paper), VulnerabilityRescanControlTests, VulnerabilitySeverityChipsTests, VulnerabilityFindingsTableTests, VulnerabilityAssessmentCardTests (summary-remediation--warning, div.summary-card__detail), VulnerabilityDisplayFormatterTests.

Proposed acceptance criteria

  1. Each value of the mapping table yields its tone, ignoring case; unknown and empty values yield Neutral.
  2. ScanStatusIndicator renders dot and text for all five scan statuses; Partial is marked as a warning and Succeeded as a success.
  3. StatusChip renders one class per tone, and the chip colors come from the tokens of [UI] Flat refresh 1/9: design tokens, typography and MudBlazor theme #451.
  4. SeverityBar renders proportional segments, the legend and the aria-label for a summary with findings and nothing for an empty one.
  5. PageHeader renders one h1 and no eyebrow; SectionPanel renders one h2, the optional meta text and its content.
  6. The table style has a sentence-case head, hairline rows and no nested border inside a flush panel; below 960 px rows are flat cards.
  7. The rescan control is a labelled 44 px icon button and behaves as before.
  8. Every new component has bUnit tests; the coverage gate passes.

Open questions for the spec

  • Should the tone mapping live in VulnerabilityDisplayFormatter (renamed) or in a new formatter next to it?
  • The runtime status tones (Paused, Restarting, Exited, Dead) are a proposal; today every runtime status is shown as an info chip.

Activity

  1. added
    enhancement
    on Nov 14, 2026
  2. LarsLaskowski commented on Nov 28, 2026

    @LarsLaskowski
    OwnerAuthor

    Squad working record

    Verification matrix of feature-452-shared-components on 02c8ca6

    Criterion Verification Tests or check Result
    AC1 unit StatusToneFormatterGetStatusToneKnownValueReturnsTone (DataRow per value of the issue's table, Q2 and Q4, mixed case); StatusToneFormatterGetStatusToneUnknownOrEmptyValueReturnsNeutral (null, "", " ", NotSet, Completed); StatusToneFormatterGetSeverityToneKnownSeverityReturnsSameSeverity; StatusToneFormatterGetSeverityToneOtherValueReturnsLow (null, "", Unknown, Negligible) pass on 02c8ca6: StatusToneFormatterTests.cs
    AC2 unit StatusToneFormatterGetStatusToneFindingsDetectedReturnsHighestSeverity; StatusToneFormatterGetStatusToneFindingsDetectedWithoutKnownSeverityReturnsLow; StatusToneFormatterGetStatusToneOtherStatusIgnoresSummary pass on 02c8ca6: StatusToneFormatterTests.cs
    AC3 unit StatusChipToneRendersToneClassAndText; StatusChipMarkupTextIsEncoded; AppStylesheetChipClassesUseTheirTokenPair pass on 02c8ca6: StatusChipTests.cs, AppStylesheetSharedComponentsTests.cs
    AC4 unit ScanStatusIndicatorStatusRendersDotAndText; AppStylesheetStatusIndicatorTonesUseIssueColors; --dug-chip-high-fg rows in GetContrastPairs pass on 02c8ca6: ScanStatusIndicatorTests.cs, AppStylesheetSharedComponentsTests.cs, AppStylesheetTests.cs
    AC5 unit SeverityBar* (all, some, other, 1 vs 500, empty); AppStylesheetSeverityBarSegmentsHaveMinimumWidth pass on 02c8ca6: SeverityBarTests.cs, AppStylesheetSharedComponentsTests.cs
    AC6 unit PageHeaderTitleOnly…; PageHeaderAllParts…; PageHeaderSkeletonRendersPageHeaderShape; AppStylesheetPageHeaderUsesDisplayFontAndMeasure pass on 02c8ca6: PageHeaderTests.cs, PageHeaderSkeletonTests.cs, AppStylesheetSharedComponentsTests.cs
    AC7 unit SectionPanel* (title only, meta, header content, flush); TableSkeletonRendersPanelShape and the embedded test; AppStylesheetSectionPanelIsFlatBorderedSurface pass on 02c8ca6: SectionPanelTests.cs, TableSkeletonTests.cs, AppStylesheetSharedComponentsTests.cs
    AC8 unit AppStylesheetTableHeadIsSentenceCaseWithHairlines; AppStylesheetTableRowsUseInnerBorderPaddingAndTabularFigures; AppStylesheetFlushPanelTableHasNoOwnFrame; AppStylesheetRowCardLabelIsSentenceCaseFaint; AppStylesheetRowCardsBelowBreakpointAreFlatSurfaceCards (radius lg) pass on 02c8ca6: AppStylesheetSharedComponentsTests.cs, AppStylesheetTests.cs
    AC9 unit AppStylesheetButtonsAreNotUppercase; AppStylesheetPrimaryAndSecondaryRulesMatchOnlyTheirColors; AppStylesheetButtonShapeRulesReachDisabledButtonsAndColorRulesDoNot; AppStylesheetRowIconButtonsAreBodyRowsOnly; AppStylesheetFieldsAreAtLeastControlHeight; AppStylesheetButtonClassesMatchRenderedButtons; VulnerabilityFindingsTableSearchFieldIsOutlined pass on 02c8ca6: AppStylesheetSharedComponentsTests.cs, VulnerabilityFindingsTableTests.cs
    AC10 unit VulnerabilityRescanControlButtonHasAriaLabelAndTooltip; VulnerabilityRescanControlRunningRescanDisablesButton; existing tests kept pass on 02c8ca6: VulnerabilityRescanControlTests.cs
    AC11 unit VulnerabilitySeverityChipsRendersStatusChipsInSeverityTones; VulnerabilityFindingsTableChipsUseTones; VulnerabilityAssessmentCardChipsUseTones pass on 02c8ca6: the three vulnerability widget test files
    AC12 check Test green with no page test file in the diff against main (Reviewer, step 8) pass on 02c8ca6: the diff changes no page test file (only shared-component, skeleton, stylesheet and vulnerability-widget tests)

    Spec, plan and tasks (last commit containing them, before the folder is removed from the branch):

    • spec.md: 12 acceptance criteria, challenge answered (filled error buttons protected, severity entry point, proportional weights plus minimum width).
    • plan.md: tier standard, security areas none, four task groups, decision record 0079.
    • tasks.md
    log.md
    Date Step Member Result
    2026-11-28 21:06 1 Intake Orchestrator Feature #452 (Flat refresh 2/9), open, label enhancement, no comments; #451 merged.
    2026-11-28 21:10 2a Spec Lead RESULT: DONE. spec.md written (12 criteria), no escalation.
    2026-11-28 21:13 2a Spec challenge Devil's Advocate VERDICT: OBJECTIONS 1 major, 5 minor.
    2026-11-28 21:14 2a Spec revise (challenge) Lead RESULT: DONE. All six objections answered.
    2026-11-28 21:20 2b Plan Lead RESULT: DONE. Tier standard, security areas none; decision record 0079.
    2026-11-28 21:24 2b Plan challenge Devil's Advocate VERDICT: OBJECTIONS 0 major, 3 minor.
    2026-11-28 21:24 2b Challenge notes Orchestrator minor objections appended verbatim to plan.md
    2026-11-28 21:26 to 21:49 4–6 (G1 to G3) Dev, Tester Tone mapping, five components, converted skeletons and vulnerability widgets: tests first, implementation, coverage gate passes.
    2026-11-28 21:55 to 21:59 5–6 (G4) Tester, Dev Stylesheet tests, app.css rules and documentation; coverage gate passes (98.9% new code, 95.0% overall).
    2026-11-28 22:00 7 Gate stamp Orchestrator PASS on f1ae618
    2026-11-28 22:04 8 Review Reviewer VERDICT: BLOCKING 1 | NON-BLOCKING 2 on f1ae618 (field label/border specificity; button size while disabled; web-ui.md sentence).
    2026-11-28 22:04 8 Verbatim fix Orchestrator verbatim: [NON-BLOCKING, verbatim] docs/areas/web-ui.md:57-60
    2026-11-28 22:06 8 Decide Lead RESULT: DECIDED — fix now (button shape rules without :not(:disabled)).
    2026-11-28 22:07 to 22:08 8 Fix tests / Fix Tester, Dev Field selectors raised to MudBlazor specificity, button shape rules moved.
    2026-11-28 22:09 7 Gate stamp Orchestrator PASS on 52f675c
    2026-11-28 22:11 8 Review delta Reviewer VERDICT: BLOCKING 0 | NON-BLOCKING 1 on 52f675c (autofill shrunk label).
    2026-11-28 22:11 8 Decide Lead RESULT: DECIDED — fix now (own autofill rule, three selectors tested).
    2026-11-28 22:12 to 22:13 8 Fix tests / Fix (delta) Tester, Dev Autofill rule added.
    2026-11-28 22:14 7 Gate stamp Orchestrator PASS on a254a7d
    2026-11-28 22:15 8 Review delta Reviewer VERDICT: APPROVE on a254a7d.
    2026-11-28 22:15 9 PR approval Lead RESULT: APPROVED. Record 0079 set to Accepted.
    2026-11-28 22:16 7 Gate stamp Orchestrator PASS on 02c8ca6 (verbatim: record status)

    The full per-launch log with token figures is in the last commit that contains it: log.md.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions