Repository navigation
Description
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.
GetScanStatusColorexists seven times (Dashboard,ScanHistory,ObservedImages,ObservedImageDetail,RuntimeContainerDetail,MyImages,MyImageDetail),GetUpdateStateColortwice (RuntimeContainers,RuntimeContainerDetail),GetBaseRuntimeAlertColortwice, and four pages wrapVulnerabilityDisplayFormatter. The copies disagree: the scan status helpers color only some states, soSucceededandPartialare shown without color ([BUG] Scan status chips show Succeeded and Partial without color on list pages #274). - Page headers come in two shapes (
hero-panelon the dashboard,page-headerwith 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-writtensection-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):
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 anaria-labelthat 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.
PageHeaderSkeletontakes the same shape (its test asserts the classhero-paneltoday).
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,
h215 px semibold in--dug-font-text,Meta13 px muted, both on one baseline, wrapping on narrow screens. TableSkeletontakes the same shape (its tests assert the classsection-papertoday).
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-borderrule 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
SectionPanelthe 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 anaria-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 witharia-label="Rescan vulnerabilities"; tooltip, progress state, the textChecked …/Never scannedand the error message next to it stay.
9. Existing shared components
VulnerabilityFindingsTableusesStatusChipfor the severity and the table style above.VulnerabilityAssessmentCardkeeps its content and uses the tokens andStatusChip.
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 underUI/. - Changed:
Components/Common/PageHeaderSkeleton.razor,TableSkeleton.razor,VulnerabilityRescanControl.razor,VulnerabilitySeverityChips.razor,VulnerabilityFindingsTable.razor,VulnerabilityAssessmentCard.razor,wwwroot/app.css. - Docs:
docs/ARCHITECTURE.mdsection 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,
SeverityBarwith all, some and no severities (segments, legend,aria-label, nothing for a total of 0),PageHeaderandSectionPanelwith 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
- Each value of the mapping table yields its tone, ignoring case; unknown and empty values yield
Neutral. ScanStatusIndicatorrenders dot and text for all five scan statuses;Partialis marked as a warning andSucceededas a success.StatusChiprenders 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.SeverityBarrenders proportional segments, the legend and thearia-labelfor a summary with findings and nothing for an empty one.PageHeaderrenders oneh1and no eyebrow;SectionPanelrenders oneh2, the optional meta text and its content.- 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.
- The rescan control is a labelled 44 px icon button and behaves as before.
- 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
LarsLaskowski commentedon Nov 28, 2026
Squad working record
Verification matrix of feature-452-shared-components on
02c8ca6StatusToneFormatterGetStatusToneKnownValueReturnsTone(DataRow per value of the issue's table, Q2 and Q4, mixed case);StatusToneFormatterGetStatusToneUnknownOrEmptyValueReturnsNeutral(null,""," ",NotSet,Completed);StatusToneFormatterGetSeverityToneKnownSeverityReturnsSameSeverity;StatusToneFormatterGetSeverityToneOtherValueReturnsLow(null,"",Unknown,Negligible)02c8ca6: StatusToneFormatterTests.csStatusToneFormatterGetStatusToneFindingsDetectedReturnsHighestSeverity;StatusToneFormatterGetStatusToneFindingsDetectedWithoutKnownSeverityReturnsLow;StatusToneFormatterGetStatusToneOtherStatusIgnoresSummary02c8ca6: StatusToneFormatterTests.csStatusChipToneRendersToneClassAndText;StatusChipMarkupTextIsEncoded;AppStylesheetChipClassesUseTheirTokenPair02c8ca6: StatusChipTests.cs, AppStylesheetSharedComponentsTests.csScanStatusIndicatorStatusRendersDotAndText;AppStylesheetStatusIndicatorTonesUseIssueColors;--dug-chip-high-fgrows inGetContrastPairs02c8ca6: ScanStatusIndicatorTests.cs, AppStylesheetSharedComponentsTests.cs, AppStylesheetTests.csSeverityBar*(all, some, other, 1 vs 500, empty);AppStylesheetSeverityBarSegmentsHaveMinimumWidth02c8ca6: SeverityBarTests.cs, AppStylesheetSharedComponentsTests.csPageHeaderTitleOnly…;PageHeaderAllParts…;PageHeaderSkeletonRendersPageHeaderShape;AppStylesheetPageHeaderUsesDisplayFontAndMeasure02c8ca6: PageHeaderTests.cs, PageHeaderSkeletonTests.cs, AppStylesheetSharedComponentsTests.csSectionPanel*(title only, meta, header content, flush);TableSkeletonRendersPanelShapeand the embedded test;AppStylesheetSectionPanelIsFlatBorderedSurface02c8ca6: SectionPanelTests.cs, TableSkeletonTests.cs, AppStylesheetSharedComponentsTests.csAppStylesheetTableHeadIsSentenceCaseWithHairlines;AppStylesheetTableRowsUseInnerBorderPaddingAndTabularFigures;AppStylesheetFlushPanelTableHasNoOwnFrame;AppStylesheetRowCardLabelIsSentenceCaseFaint;AppStylesheetRowCardsBelowBreakpointAreFlatSurfaceCards(radius lg)02c8ca6: AppStylesheetSharedComponentsTests.cs, AppStylesheetTests.csAppStylesheetButtonsAreNotUppercase;AppStylesheetPrimaryAndSecondaryRulesMatchOnlyTheirColors;AppStylesheetButtonShapeRulesReachDisabledButtonsAndColorRulesDoNot;AppStylesheetRowIconButtonsAreBodyRowsOnly;AppStylesheetFieldsAreAtLeastControlHeight;AppStylesheetButtonClassesMatchRenderedButtons;VulnerabilityFindingsTableSearchFieldIsOutlined02c8ca6: AppStylesheetSharedComponentsTests.cs, VulnerabilityFindingsTableTests.csVulnerabilityRescanControlButtonHasAriaLabelAndTooltip;VulnerabilityRescanControlRunningRescanDisablesButton; existing tests kept02c8ca6: VulnerabilityRescanControlTests.csVulnerabilitySeverityChipsRendersStatusChipsInSeverityTones;VulnerabilityFindingsTableChipsUseTones;VulnerabilityAssessmentCardChipsUseTones02c8ca6: the three vulnerability widget test files02c8ca6: 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):
log.md
The full per-launch log with token figures is in the last commit that contains it: log.md.
Generated by Claude Code