Component definition · AI filters

Precision control – states, motion and accessibility

New in 0.2: a failed generation makes the control unavailable – neutral colours and a tooltip – instead of Blank and the retry, because that is how it was built. Section 6.

The per-filter precision control as shipped in ai-filters-1.9: a four-point radio group with bespoke UI. Three AI-generated levels plus Broadest, which is the absence of a constraint rather than something the AI produced.

Filter
Values
1

Interactive example

The component as proposed, wired to its filter. Move between points and the values underneath change with them. It carries every fix in section 9: one tab stop, arrows that move and select while wrapping at the ends, Home and End for the extremes, and a polite announcement on every change. Tab into the track and use the arrow keys; the readout shows what a screen reader would be given.

Values follow the level. Precise on Skill is an AND across the critical few; every other level is an OR. That operator change is the clearest demonstration of what precision means, and the control never says it in words.

What the announcement carries is the count and the operator, not the level name. aria-checked already gives the name; the change is what happened to the search.

2

The model

The control's value is not a point index. It is a level, plus two flags that say whether any level describes the filter at all. Indexing by point would break silently if the display order ever changed, because Broadest is an end of the scale rather than a fixed position.

Piece of stateValuesWhat it means
strategyState[name] 0 · 1 · 2 · 'off' 0 is Precise, 2 the broadest generated level, 'off' is Broadest, which sits on the scale while producing nothing.
breadthUnset[name] true · false No level describes this filter. The track shows nothing selected and the fill is empty.
breadthEdited[name] true · undefined Only meaningful while unset. true means values exist but they are the recruiter's; undefined means the filter is empty.

Those three combine into six reachable states, below. Broadest and Blank both show an empty filter and are still different things: Broadest is a choice the recruiter made, Blank is the absence of one. That distinction is the reason the control has a fourth point at all.

3

Value states

All six at once, which is the comparison you cannot make by clicking, because reaching one destroys the last. Each names how it is reached. Specimens are frozen and sit at the real 273px. Anything below a keyline is this page talking, not the component: value counts and truncation notes are commentary.

4

Point vocabulary

Five treatments for a single dot. Colour says selected or not; the sparkle says AI or not. Keeping those two jobs on separate channels is what lets Broadest sit on the track without claiming to have generated anything. Ratios are computed at page load from the canon's own tokens against the panel's white, so this table cannot drift from styles.css without saying so.

5

Interaction states

Hover and focus forced on, so they can be read side by side. The tooltip appears on both and carries the level's gloss, so hovering says what you are about to pick as well as what it would do.

6

Container states

The control does not own these, the filter panel and the vacancy do, but they change what it looks like and whether it can be operated, so the component has to define its behaviour inside each. The last four were added 2026-09-22 and are live in 1.8 and 1.9 behind ?fail=1, ?fail=always and ?jd=none. The two generation-failed states were redrawn in 0.2 to match what engineering built, which the 1.8 and 1.9 prototypes do not: there the control is still the retry.

7

Motion

Four things move, on three different clocks. The fill is the only one that carries meaning, so it is the slowest and the only one that is eased. All four are live in section 1, so this table can be reviewed against the thing rather than read. Move the slider a long way, Broadest to Precise, to see the fill travel and the chips stage; move it one notch to see how little happens when little changes.

WhatDurationEasingWhyReduced motion
Rail fill450mscubic-bezier(.22,.61,.36,1) The one element that carries the sense of the search tightening. At 180ms it was over before the eye found it. Fixed here. 1.9 guards this in JS only; the component now stands the transition down itself.
Dot fill and halo120mslinear Hover and selection feedback. Fast enough to feel like a state rather than an animation. Fixed here. Same gap, same fix.
Chip swapenter and leave, staged– A level move can replace up to 19 chips. Departures stage before arrivals so the two do not fight for the space. Handled in 1.9. animateChipsOut calls back immediately and animations drop to 1ms.
Region height260msease Measured, pinned, released. In 1.9 this is the ai-slot swapping between the slider and a collapsed CTA; in section 1 it is the values region going from 3 chips to 12. Same mechanic, same reason: without it the page below jumps. Handled in 1.9 and here. Both return early rather than pinning a height they will not animate.

Two mechanics worth carrying into the canon, because both were bugs first. The fill's transition needs a value to move from, and every render replaces the node, so restartFillTransitions reads the outgoing width, starts the incoming one there, forces a reflow, then sets the target. It uses offsetWidth rather than requestAnimationFrame deliberately: rAF is throttled to nothing in a background tab and the fill would silently stick. And the slot is anchored flex-start, not center, because a centred item taller than its pinned box hangs half the overflow upwards, straight over the filter's own name. That was the live overlap bug.

8

Decisions

The questions this page raised, answered by Tim on 2026-09-22. Recorded so the next person does not reopen them.

QuestionDecisionWhat it means for the component
Does the sparkle thin out, or hold? Leave as is Passed points keep dropping their sparkle, so the AI signal is loudest at Broadest and quietest at Precise. Nothing generated at a passed level, so nothing claims to have been.
Is Blank worth keeping? Keep Six states stand. Blank and Broadest stay distinct: one is the absence of a choice, the other is a choice.
Does the operator belong in the control? Leave it AND versus OR stays visible only in the connectors between chips. The control does not say it.
Four names at 273px Drop the middle pair When space is short, only the two extreme names show. Implemented as .breadth--compact; the track and its points never change, only the labels.
Where does it live? Implementation team, leaning composition Preference is a documented composition of existing chip-radio parts over a new named component, so the system does not carry a second radio pattern.
9

Accessibility

Six findings, all measured against the running ai-filters-1.9 rather than read off the source. Five are fixed on this page and are what the canon should take; each says what 1.9 still owes. Evidence blocks give the exact measurement so they can be re-run.

Fixed here

A1 · The radio group is not a radio group

In 1.9 every point is a native <button role="radio"> with default tabindex, so all four are separate tab stops and arrow keys do nothing. The ARIA pattern is the opposite: one tab stop, with arrows moving and selecting. A keyboard user crossing the panel presses Tab twelve times and can never use the key they would reach for first.

ai-filters-1.9 · 3 radiogroups · 12 points · all tabIndex 0 · 12 tab stops
ArrowRight on a focused point → focus did not move, aria-checked unchanged

ai-filters-1.8 (chips) · 3 groups · 12 native radios · all tabindex="-1"
  → 0 tab stops. Not operable by keyboard at all, which is worse.

Fix: roving tabindex, where the checked point (or the first, when unset) gets 0 and the rest -1, plus a keydown handler for left, right, up, down, Home and End that moves focus and selects in one action, wrapping at the ends. Live in section 1.

The chip arm was not exempt, contrary to what was assumed. 1.8 builds the control from native radios, which normally hand the whole pattern to the browser for free, and it was skipped in the first port for that reason. It carried tabindex="-1" on every input, so it had no tab stop at all and could not be operated by keyboard in any way. The fix there is the opposite of 1.9's: delete the attribute and let the native behaviour work. One difference survives and is acceptable, since the APG makes them optional for radio groups: Home and End work in 1.9 and not in 1.8.

Fixed here Scope narrowed

A2 · The blank Broadest marker fails non-text contrast

1.4.11 wants 3:1 for the parts of a control needed to identify it. Two dot treatments are under it, and only one of them matters. The unselected dot is accepted as-is (Tim, 2026-09-22): the disc is indigo-100 at 1.18:1, but the sparkle inside it is indigo-500 at 5.96:1, and the sparkle is what identifies the point. The disc is a tint behind a mark that passes.

Broadest in the blank state has no sparkle, by design, because nothing is generated there. That leaves a 10px indigo-200 disc at 1.40:1 with nothing inside it, and nothing else to carry it.


        

Fix, applied: a 4px solid indigo-500 core inside the blank Broadest marker, at 7.01:1. It identifies the point without giving it a sparkle it has not earned. Suppressed on hover, where the disc goes indigo-900 and the core would become the low-contrast element instead. Compare the Broadest specimen in section 4 against the Blank state in section 3.

Fixed here

A3 · Changing level announces nothing

Moving the slider replaces the filter's values, up to 19 chips on Job role, and writes a new sentence underneath. In 1.9 neither is announced: the description sits in no live region and is not referenced by aria-describedby, so a screen-reader user hears "AI generated, Precise, selected" and nothing about what happened to the search.

ai-filters-1.9 · level change → 5 aria-live regions on the page, none updated
.breadth-desc has no id · 0 points carry aria-describedby

Fix, applied: every .breadth-desc now carries an id and the radiogroup points aria-describedby at it, so the meaning is available on demand. The consequence is announced separately through a polite region as "Skill: Precise. 3 values, all must match", because the count and the operator are the change, not the level name, which aria-checked already gives.

Fixed here

A4 · The tooltip is invisible to assistive tech

.breadth-tip carries role="tooltip" but nothing references it in 1.9, which makes the role inert. The accessible name gives "AI generated, Narrow"; the gloss explaining what Narrow means is sighted-hover only. It also shows on :focus-visible with no way to dismiss it, which 1.4.13 asks for.

Fix, applied: each tooltip has an id and its point references it with aria-describedby, so the gloss reaches assistive tech. Escape dismisses a visible tooltip while focus stays on the point, and moving focus clears the dismissal.

Fixed here

A5 · Reduced motion is honoured in JS but not in CSS

In 1.9 the chips, the fill restart and the slot height all check prefers-reduced-motion in script and stand down properly. The CSS behind them does not: .breadth-rail-fill keeps its 450ms transition, and .breadth-dot and .breadth-sparkle keep theirs. No fill transition actually fires there today, because the node is replaced at its final width, so this is latent rather than visible. It stops being latent the moment someone animates the fill in place instead of re-rendering it.

Fix, applied: a @media (prefers-reduced-motion: reduce) block zeroing the three transitions, so the guarantee lives with the component rather than in the caller.

Spec, not a bug

A6 · The disabled state is defined but unreachable

.filter.toggled-off.active dims the editor to opacity: .45 and kills pointer-events. Nothing in 1.9 ever adds that class, confirmed by zero classList.add('toggled-off') calls, so it is dead CSS inherited from 1.2. It matters anyway, because the canon will need a disabled state and this one is wrong: pointer-events: none does not remove anything from the tab order, so a keyboard user can still reach and operate a control that looks switched off.

Spec for when it is built: disabled on each button, plus aria-disabled on the group. Never pointer-events alone. Shown dimmed in section 6 so the appearance is defined, but it is not wired here either.