Selector: only a group that fills its row is a size container (red web job) #333

Closed
kayg wants to merge 1 commit from issue/325-selector-collapse into dev
Owner

Part of #325 and the red web job on dev.

What was red. CI's web job fails in "Primitives browser tests" at selector.spec.ts:63, "labels never move when they turn bold", in Chromium and WebKit (the toast.spec.ts:73 line in the log is only the progress line of the next test starting). The labels all shifted left by 100 to 120 px after a click.

Cause. Reproduced locally. .selector had container-type: inline-size (added so .fill .opt can use a container query). Size containment gives the group no inline size from its content, so a group that sizes to its words (fill={false}) in a shrink-to-fit place (the harness's grid with justify-items: start) collapsed to its 4px of padding (clientWidth 4, scrollWidth 338) and scrolled its words sideways inside itself. Clicking an option scrolled the group to it, so every label moved. This is a real bug, not a stale test: any non-fill selector in a grid cell or flex item would have collapsed.

Fix. Only .fill is a size container. The only container query is .fill .opt, so nothing else changes.

Evidence. Before: the two failures above, reproduced. After: all 90 primitives browser tests pass locally (Chromium and WebKit, one worker, through the slot lock).

🤖 Generated with Claude Code

Part of #325 and the red web job on dev. **What was red.** CI's web job fails in "Primitives browser tests" at `selector.spec.ts:63`, "labels never move when they turn bold", in Chromium and WebKit (the `toast.spec.ts:73` line in the log is only the progress line of the next test starting). The labels all shifted left by 100 to 120 px after a click. **Cause.** Reproduced locally. `.selector` had `container-type: inline-size` (added so `.fill .opt` can use a container query). Size containment gives the group no inline size from its content, so a group that sizes to its words (`fill={false}`) in a shrink-to-fit place (the harness's grid with `justify-items: start`) collapsed to its 4px of padding (`clientWidth 4, scrollWidth 338`) and scrolled its words sideways inside itself. Clicking an option scrolled the group to it, so every label moved. This is a real bug, not a stale test: any non-fill selector in a grid cell or flex item would have collapsed. **Fix.** Only `.fill` is a size container. The only container query is `.fill .opt`, so nothing else changes. **Evidence.** Before: the two failures above, reproduced. After: all 90 primitives browser tests pass locally (Chromium and WebKit, one worker, through the slot lock). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Selector: only a group that fills its row is a size container
Some checks failed
CI / server (pull_request) Successful in 21s
CI / web (pull_request) Failing after 20s
CI / rust (pull_request) Successful in 1m21s
6ce5e7af14
container-type: inline-size gives a group that sizes to its words no inline size at all. In a
shrink-to-fit place (a grid cell with justify-items: start, as in the primitives harness) the
Widths selector collapsed to its 4px of padding and scrolled its words sideways, so clicking an
option moved every label (selector.spec 'labels never move when they turn bold', red on dev in
Chromium and WebKit). The container query only styles '.fill .opt', so only .fill needs it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
kayg closed this pull request 2026-10-14 20:53:49 +00:00
Some checks failed
CI / server (pull_request) Successful in 21s
CI / web (pull_request) Failing after 20s
CI / rust (pull_request) Successful in 1m21s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!333
No description provided.