Enforce the shared WebUI pattern language
Dependency Audit / dependency-audit (push) Successful in 1m43s
Deployment Installer / deployment-installer (push) Successful in 6s
Security Audit / security-audit (push) Successful in 11m17s

This commit is contained in:
2026-08-18 13:17:22 +02:00
parent 5bb8028147
commit a1b80eda27
6 changed files with 248 additions and 65 deletions
@@ -1,29 +1,35 @@
# Shared WebUI Primitive Inventory
This 2026-08-18 inventory records the implementation state after the
product-wide toolbar, grid, form-section, dialog-anatomy, metric-group, and
description-list migrations. It is
evidence for prioritization, not a substitute for the normative
product-wide structural consolidation and second duplicate-rule audit. It is
evidence for enforcement, not a substitute for the normative
[interface pattern language](../architecture/INTERFACE_PATTERN_LANGUAGE.md).
## Implemented And Enforced
| Contract | Adoption evidence | Ownership now enforced |
| --- | ---: | --- |
| `ActionToolbar` and groups | 39 source files | Raw module-prefixed toolbar elements and local toolbar component definitions are rejected. |
| `ContentGrid` | 15 source files | Former `dashboard-grid` and `settings-grid` wrappers are rejected. |
| `FormGrid` and `FormLayout` | 53 source files | Former `form-grid` and `admin-form-grid` wrappers are rejected; equal-column dialog and editor grids were migrated even when they had module-prefixed names. |
| `FormSection` | 2 representative source files | The reusable section API, variants, responsive action placement, and heading anatomy are Core-owned; broader adoption is incremental. |
| `DialogActions` | Every Core `Dialog` footer | Footer wrapping and alignment are no longer repeated by consumers. |
| `DialogForm` | 6 source files | Raw `*-dialog-form` form wrappers are rejected. |
| `DialogSection` | 6 source files | Repeated dialog field/content grouping is available as a shared primitive. |
| `MetricGrid` | 29 uses in 25 source files | The former `metric-grid` class and module-specific column overrides were removed. Core now owns 15/auto-fit columns, minimum width, density, block/inset/zero spacing, and collapse. |
| `DescriptionList` and `DescriptionItem` | 51 lists in 28 source files; item composition in 11 files | The former `admin-details-grid` and `detail-list` classes were removed. Core now owns stacked and inline property layouts, density, term width, wrapping, and collapse while preserving native `dl`/`dt`/`dd` semantics. |
| Standard dialog sizing | 9 consumers and 6 duplicated width rules removed | Confirmations and compatible Calendar, credential, Campaign, Files, and Voting dialogs use the Core small/large/wide scale. The 61 remaining specialized selectors across 22 CSS files are registered and decrease-only. |
| `ActionToolbar` and groups | 50 source files | Raw module-prefixed toolbar elements and local toolbar definitions are rejected. Distribution, wrapping, density, grouping and panel/section surfaces are Core-owned. |
| `PageLayout` / `WorkspaceLayout` / `WorkspaceFrame` | 25 / 16 / 17 source files | Headed page anatomy, full-height viewport frames and navigation/list-detail panes no longer repeat inset, heading, notices, loading, shell height, surface, overflow or pane geometry. The raw page-frame and raw workspace exception baselines are both empty. |
| `FilterBar` | 14 source files | Catalogue and pane search/filter rows share width, surface, layout and wrapping. |
| `SelectionList` family | 19 source files | Resource navigation shares selection, title/description, leading-icon and truncation anatomy. |
| `StatePanel` | 25 source files | Whole-surface, compact and fill empty/blocked/error states replace module-local state shells. |
| `CountBadge` | 8 source files | Notification, folder, search, postbox and graph counts use one compact badge contract. |
| `ContentSection` | 5 source files | Repeated bordered/subtle editor sections and compact provenance panels share surface, density, flow and rhythm. |
| `ContentGrid` | 22 source files | Equal-column content geometry and former dashboard/settings/assignment copies are Core-owned. |
| `FormGrid` and `FormLayout` | 53 source files | Former generic/admin grids and equal-column dialog/editor copies use named collapse points and native form semantics. |
| `MetricGrid` / `MetricCard` | 31 / 33 source files | Module-local metric helpers, grids and card visual definitions were removed. |
| `DescriptionList` and `DescriptionItem` | 28 source files | Former generic property grids use semantic `dl`/`dt`/`dd` composition with central density and collapse. |
| `DefinitionPalette`, node/canvas visuals and `FloatingStatus` | 2 Dataflow/Workflow consumers each | The copied graph palette, canvas controls, minimap, node icon/port, empty overlay and activity overlay definitions are Core-owned; graph semantics remain local. |
| `DialogActions`, `DialogForm`, `DialogSection` | every Core footer / 6 / 6 source files | Footer action flow, native dialog form flow and dialog content grouping are Core-owned. |
| Standard dialog sizing | 61 reviewed specialized selectors | Any width matching the Core 460/560/680/1040/1440px scale must use `Dialog size`; the remaining decrease-only exceptions are explicit. |
`tools/checks/check-shared-webui-primitives.py` verifies Core exports and
ownership, representative consumers, the absence of the retired raw anatomy,
and composition of every `Dialog` footer through `DialogActions`.
`tools/checks/check-shared-webui-layouts.py` additionally requires the reviewed
Core and module consumers and rejects any raw page or workspace frame; there
are no remaining allow-listed layout exceptions.
## Dialog Width Classification
@@ -36,31 +42,33 @@ Their exact selector set lives in
for a new selector, a stale baseline entry, or any local width that duplicates
the Core scale.
## Remaining Promotion Candidates
## Audit Result And Deliberate Local Ownership
The post-migration scan still finds domain-specific grids, but the repeated
generic metric and property-list geometry is gone. Remaining grids are mostly
unequal-track editors, visualizations, workflow facts, import mappings, and
collection layouts. The next useful candidates depend on interaction semantics:
The second scan compared exact CSS declaration bodies and JSX anatomy across
every WebUI module after migration. All repeated generic structural candidates
found in that pass were promoted: viewport frames, catalogue/list shells,
filters, selectable lists, state panels, count badges, section frames,
equal-column grids, section headers, metrics, and definition-editor chrome.
The final legacy-baseline pass also migrated Access administration, Core
Settings, Docs, Mail bounce processing, and Organizations to the shared page
and workspace layouts and removed their copied responsive geometry.
| Priority | Remaining pattern | Evidence | Proposed contract |
| --- | --- | ---: | --- |
| 1 | Empty and collection state anatomy | More than 70 module-prefixed empty/state class uses remain; only loading, alerts, blockers, and DataGrid empty actions are centralized | A composable `StatePanel`/`CollectionState` covering empty, recoverable error, permission block, partial result, and next action without hiding domain consequences. First distinguish a whole-surface state from a compact empty row or optional-value placeholder. |
| 2 | Filter and search rows | More than 50 filter/search class tokens cover simple text search, facets, popovers, result counts, active filters, bulk selection, and overlay search | Define `FilterBar` only after the input/submit, live filtering, facet, result-summary, and bulk-action accessibility variants have been compared. Plain action placement already uses `ActionToolbar`. |
| 3 | Assignment/picker groups | `admin-assignment-grid`: 5 uses in 4 files | Promote a selection/assignment composition only after its list, search, empty, policy, and permission variants are compared; plain geometry can already use `ContentGrid`. |
| 4 | Repeated domain fact and statistic grids | `campaign-header-grid` (8), `review-flow-fact-grid` (6), `postbox-form-grid` (5), plus smaller families | Compare semantics before promotion. Some can use `ContentGrid` or `DescriptionList`; others intentionally own unequal tracks or workflow visualization. |
The remaining cross-module declaration matches are not independent component
anatomy. They are small token-based rules such as ellipsis, muted captions,
uppercase terms, or flex-column containment applied to different semantic
elements. Moving those rules into a component would erase meaning; their
visual values already come from Core tokens. Remaining larger local layouts
are deliberately domain-owned:
The other custom grids are mostly bounded domain visualizations or unequal-track
editors: conflict mappings, import mapping, campaign review facts, charts,
calendar time views, connector synchronization, records lists, and definition
editors. They should remain module-owned unless a second domain demonstrates
the same semantics and interaction contract. A shared primitive should not be
created merely because two implementations both use CSS Grid.
- unequal-track editors, import mappings and schema/data tables;
- calendar time grids, charts, graph node shapes and graph edge semantics;
- file/mail/postbox/records explorer panes whose interaction contracts differ;
- timelines, evidence histories, recipient compositions and policy-specific
detail sections;
- compact list-row internals that cannot preserve their semantics through
`SelectionListItemContent`.
## Next Audit
The next bounded slice should compare whole-surface empty states across list,
detail, permission, capability, and recoverable-error contexts and promote only
their shared anatomy. Filter/search composition follows after its live versus
submitted filtering and bulk-selection behavior is explicit. Assignment grids
remain deferred until their permission and policy variants are understood.
A future candidate is promoted only when a new audit identifies repeated
structure plus the same responsive, accessibility and interaction contract.
The enforcement script prevents regression for the patterns centralized in
this pass and maintains the reviewed dialog-width baseline.