<quality-target>
Polygon-as-UI quality prioritization surface. Click any axis to set its level + rationale; the centre readout tracks Critical spend against the project's capacity. Pairs with iron-triangle via data-bind-to.
Overview
The <quality-target> component is the planning surface's quality decision. The polygon IS the picker — each of the 11 ility axes is a clickable hit-target that opens a per-ility <dialog> with a level radio group (Critical / Important / Acceptable / Not relevant) plus a required rationale when Critical. The same SVG shows the chosen vector on three level rings, with a centre readout of Critical spend against the project's capacity, so picking and reading happen on the same surface.
Pair it with <iron-triangle> via data-bind-to and the capacity comes from the project shape. "Quality" is the word the surface uses; the older "NFR" jargon and its separate compass + radar pair collapse into this one component, two roles.
<iron-triangle id="shape" data-quality-href="#quality"></iron-triangle> <quality-target id="quality" name="quality" data-bind-to="shape"></quality-target>
Per-axis editors
Click an axis (or focus it and press Enter / Space) to open its dialog. Each editor has a radio group for the four priority levels, a <form-field>-wrapped rationale textarea (required when Critical, ≥10 chars by default via data-min-rationale), and Cancel + Save buttons; the dialog uses method="dialog" so submit closes it. Save is refused with an inline message until a level is picked and, for Critical, the rationale is long enough. The marker and label colour follow the level: red Critical, amber Important, green Acceptable, muted Not relevant. The polygon is the closed shape across all picked axes; unpicked ilities don't pull the shape toward the centroid.
Capacity budget
Every ility has a cost when Critical. Only Critical picks spend capacity; Important, Acceptable, and Not relevant are free. The running total is criticalSum:
criticalSum = Σ costWeights[ility] for every ility picked "critical"overBudget = criticalSum > capacityPoints
The centre of the radar shows criticalSum over the capacity ("5" above "of 4"), or "unbounded" when no capacity is known. Capacity resolves in this order: a bound <iron-triangle>'s capacityPoints, then data-capacity-points, then the capacityPoints property, then unbounded. There is no envelope polygon; the three level rings are the only backdrop.
Going over budget is allowed, but it is never silent:
- the centre sum turns to the error colour and the vector stroke to the warning colour (
:state(over-budget)); - an "Over budget — explain why." panel appears below the radar with the exact overrun ("You're over budget by 1 point (5/4).") and a labelled Overrun rationale textarea (≥10 chars by default via
data-min-overrun-rationale); - the element is invalid until that rationale is long enough, so a parent
<form>won't submit (see Form association); quality-target:over-budgetandquality-target:under-budgetfire once each time the selection crosses the capacity line.
const target = document.querySelector('quality-target'); target.addEventListener('quality-target:over-budget', (e) => { console.log(`Over by ${e.detail.delta} pts (${e.detail.criticalSum}/${e.detail.capacityPoints})`);});target.addEventListener('quality-target:under-budget', (e) => { console.log(`Back within budget; ${e.detail.slack} pts of slack`);});
Default ility list and cost weights
The 11 default ilities (cost dropped — that's <iron-triangle>'s job), with their default cost-when-Critical weights:
| Ility | Weight | Ility | Weight |
|---|---|---|---|
| performance | 5 | compatibility | 2 |
| accessibility | 3 | scalability | 5 |
| security | 5 | portability | 3 |
| reliability | 4 | internationalization | 4 |
| maintainability | 2 | privacy | 4 |
| observability | 3 |
The weights sum to 40 — against a realistic budget of 10–15 that forces real trade-offs. Override with data-cost-weights='{"performance": 8, "scalability": 8}' or set the ilities property to a custom array.
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
name | string | quality | Form-association field name |
data-bind-to | string | — | ID of a sibling <iron-triangle> to read capacityPoints from |
data-capacity-points | number | — | Literal capacity fallback when no triangle is bound |
data-cost-weights | string | — | JSON object overriding default per-ility cost weights |
data-radius | number | 100 | Base radius in SVG units |
data-min-rationale | number | 10 | Min characters for a Critical row's rationale |
data-max-rationale | number | 200 | Max characters for the rationale textarea |
data-min-overrun-rationale | number | 10 | Min characters for overrunRationale |
data-max-overrun-rationale | number | 400 | Max characters for overrunRationale |
disabled | boolean | — | No editing: axes leave the tab order, openEditor() is a no-op, dialog and footer controls are disabled; also bars the element from form validation |
locked | boolean | — | Read-only mode for shipped vectors; same editing lock as disabled, but the value still submits and validates |
Properties & methods
| Member | Type | Description |
|---|---|---|
value | R object | Snapshot { vector, rationales, costWeights, capacityPoints, capacitySource, criticalSum, overrunRationale, ironTriangleHash }. capacityPoints is null when unbounded; capacitySource is 'formula' when bound to a formula-mode triangle, otherwise 'manual'. The same JSON is the form value. |
vector | R/W Record<ility, level> | Current picks. Setting merges into the existing picks; entries with an unknown level are ignored. |
rationales | R/W Record<ility, string> | Per-Critical rationales. |
costWeights | R | Effective merged weights. |
capacityPoints | R/W | Resolved capacity (triangle > attribute > property > Infinity). Setting only fills the property slot of that order. |
criticalSum | R | Live sum of Critical weights. |
overBudget | R boolean | criticalSum > capacityPoints. |
overrunRationale | R/W string | Required when over budget; mirrors the footer textarea. |
ilities | R/W string[] | Override the default 11. |
openEditor(ility) | method | Imperatively open one axis's dialog. No-op while disabled or locked. |
checkValidity() | method | Validate Critical rationales + the over-budget rationale; sets :state(missing-rationale) and fills the error message below the radar. |
Events
| Event | Detail | Description |
|---|---|---|
quality-target:change | { vector, rationales, costWeights, capacityPoints, criticalSum, overrunRationale, ironTriangleHash, source, field } | Any pick or rationale changes |
quality-target:over-budget | { delta, criticalSum, capacityPoints } | The selection just crossed into over-budget |
quality-target:under-budget | { slack, criticalSum, capacityPoints } | The selection just returned within budget |
States
| State | When |
|---|---|
:state(over-budget) | criticalSum exceeds a finite capacity. The vector stroke turns to the warning colour and the overrun panel shows. |
:state(missing-rationale) | The last checkValidity() call failed. Reveals the error message below the radar. |
CSS Tokens
| Token | Default | Purpose |
|---|---|---|
--quality-target-max | 36rem | Max inline size of the host (the SVG scales to fit) |
--quality-target-vector-fill | color-mix(in oklab, var(--color-interactive) 22%, transparent) | Vector polygon fill |
--quality-target-vector-stroke | var(--color-interactive) | Vector polygon and spoke stroke |
--quality-target-label-size | 0.625rem | Axis label font size |
--quality-target-capacity-size | 1.25rem | Centre sum font size |
Form association
The element is form-associated: inside a <form> it submits the value JSON under its name (default quality). Its validity is reported through ElementInternals, so the form's own checkValidity(), reportValidity(), and native submit are blocked while a Critical pick lacks its rationale or an over-budget selection lacks its overrun rationale. When the overrun rationale is the problem, the browser points at that textarea. disabled takes the element out of validation entirely; locked keeps it submitting and validating, but read-only.
Accessibility
- Keyboard. Each axis is a focusable
role="button"(tabindex="0") inside an SVGrole="group"; Enter and Space activate exactly like a click. Each axis'saria-labelstarts with its visible name, then its level and cost (“Performance — critical · 5 pts. Activate to edit.”); the hover tooltip shows just the level and cost. - Editors. Each dialog is a native
<dialog>(focus is trapped and returned by the browser, Escape closes it) with anaria-labelnaming the ility, a<fieldset>/<legend>radio group, and a labelled rationale textarea. Generated ids are unique per instance, so several targets on one page keep their labels straight. - Never colour-only. Priority levels are conveyed by the radio label text and each axis's accessible name, so the red/amber/green/muted coding is reinforcement rather than the only signal. Over budget surfaces as visible text with the exact overrun, plus a required, labelled rationale field, not just a colour change.
- Disabled / locked. Mouse input is off, the axes leave the tab order and carry
aria-disabled="true",openEditor()does nothing, and every dialog and footer control is disabled.
Related
<iron-triangle>— suppliescapacityPoints; the target reads it viadata-bind-to.<capacity-plan>— readscriticalSumfrom the target and reconciles it against capacity plus slotted feature costs.<requirement-card>— renders a single ility's row outside the target for status dashboards and ADR appendices.