Skip to content

fix(Slider): a press on the mark label of coincident thumbs goes to the upper thumb, as a press on the thumbs does - #9184

Merged
cixzhang merged 2 commits into
meta:mainfrom
vjeux:fix/slider-coincident-press-focus
Oct 31, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
vjeux:fix/slider-coincident-press-focus

Conversation

@vjeux

@vjeux vjeux commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #8151. One change on main, with no dependencies.

User impact

When both thumbs of a range Slider share a value, the upper thumb is drawn over the lower one. A press on the thumbs that never moves leaves the press and focus on that visible thumb, but a press on the mark label of their shared value takes the lower, covered thumb: the focus ring and pressed look land on a thumb you can't see, and the next arrow key moves it.

Problem and solution fit

  1. Why it happens: a press that waits for its first movement holds the thumb it landed on. A mark label is no thumb, so it falls back to the closest-thumb rule, which prefers the lower thumb on a tie.
  2. Why it matters: focus decides which thumb the keyboard moves, and the pressed look shows which thumb the pointer holds; both should follow the visible thumb.

A waiting press is now held by the upper thumb wherever it landed. The first movement still picks the thumb that can travel that way.

Expected behavior and authority

  • component:Slider FR6, amended here: until the first movement, the upper thumb holds the press, its focus and its pressed state, so a press that never moves changes no value and leaves focus on the upper thumb; this covers a press on the shared value's mark label. It waits on the spec owner's approval of that text.
  • design:user-states DR4: the pressed overlay follows the thumb the pointer holds.

Smallest restoration

Slider.tsx: in the press handler, a waiting press that hit no thumb is held by the upper thumb. Slider.spec.md: FR6's sentence and its verification row. No new prop, style or visual.

Evidence

  • Before: both thumbs at 50, a press on the "50%" label shows the pressed look on the lower thumb and focuses it.
  • After: the upper thumb shows pressed and keeps focus; releasing without moving leaves both values at 50.
  • Unchanged: a press on the thumbs already held the upper thumb; a track press beside them still takes the thumb on its side.
  • Regression test: "coincident range thumbs" in Slider.test.tsx gains two cases. The mark-label case fails without the fix; the on-thumb case pins what already worked.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

On a range Slider with a mark at 50 and both thumbs at 50, with a mouse: press the "50%" label, or the thumbs, and release without moving. The upper thumb shows pressed and keeps focus, and the values stay at 50. A drag left from the label still moves the lower thumb.

Local gates at f75af1f: root build, typecheck, lint, Prettier, check:repo, check:knowledge, the CLI isolation test (34/34), the Storybook build, Slider's Chromium accessibility suites (13/13), pnpm test:ui (17,087 passed), and the node project apart from cache.test.mjs, whose failure is known on main and has an open fix (#8520).

Writing rubric results

  • R1 narration: none; FR6's added sentence states the rule in the present tense.
  • R2 research: none.
  • R3 evidence: FR6's basis stays "Current source and focused tests".
  • R4 rejected alternatives: none added.
  • R5 change references: none.
  • R6 open questions: none touched.

vjeux added 2 commits October 31, 2026 11:04
…cus on the upper thumb, wherever it lands

Two thumbs on one value: a press on the thumbs is held by the upper thumb,
drawn over the lower one, and a press that never moves leaves focus there.
A press on the mark label of their shared value is held the same way. It
fails today: the label press goes to the lower thumb, under the upper one.
…to the upper thumb, as a press on the thumbs does

Until the first movement, a press on two thumbs that share a value is held
by the upper thumb, the one drawn over the lower one, whether it landed on
the thumbs or on their shared value elsewhere, such as its mark label. A
press that never moves therefore leaves focus on the same thumb wherever it
lands. Before, a press on that label went to the lower thumb, which the
upper one covers. component:Slider FR6 states it, and its verification row
names the press that never moves.
@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Error Error Oct 31, 2026 6:27pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 31, 2026
@astracat-bot

astracat-bot Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 31, 2026, 8:34 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview availability: this branch's preview address cannot be known in advance; open the preview from Vercel's comment on this pull request.

Modified Components

Slider (@astryxdesign/core)
Metric Before After Delta
Entry File (ESM) 389B 389B 0B
Lines of Code 1051 1054 -
Complexity Very High Very High (173) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/Slider 50.3KB 50.3KB +9B 8.8KB 8.8KB 0B

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 36.0KB 36.0KB 0B

Accessibility Audit

Status: Accessibility did not run on this pull request; add ci:run-a11y to run it. It runs after merges to main and before each release.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change does what it says and I found no defects: the new mark-label test fails without the fix, and a press on the shared value's label now focuses the upper thumb exactly as a press on the thumbs does. Approval waits on one spec decision: the new component:Slider FR6 sentence, which says the upper thumb holds a press that has not moved yet wherever it lands on the shared value, is not in the current spec and needs an engineering owner's approval. An engineering owner records that decision by commenting /approve-spec f75af1fdbf2d5cf7036455bfbece127a8f8cf99c on this pull request, and the author may do so as an engineering owner.

[Automated review]

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Oct 31, 2026
@cixzhang
cixzhang marked this pull request as ready for review October 31, 2026 19:22
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec f75af1f

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 31, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ready to merge: the component:Slider FR6 amendment is now approved by an engineering owner for this exact revision, and the code does what the amended rule says with no defects found. The new mark-label test fails without the fix and passes with it, and the existing coincident-thumbs cases still pass. Nothing more is needed from you.

[Automated review]

@cixzhang
cixzhang merged commit dce0ccf into meta:main Oct 31, 2026
92 of 93 checks passed
@vjeux
vjeux deleted the fix/slider-coincident-press-focus branch October 31, 2026 21:30

This branch had an error being deployed

1 failed deployment
Preview — f75af1fd Deployed Oct 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants