Skip to content

fix(core): Tab paints the press for every pointer - #8714

Closed
cixzhang wants to merge 3 commits into
fix/press-release-to-hoverfrom
fix/press-tab-every-pointer
Closed

cixzhang wants to merge 3 commits into
fix/press-release-to-hoverfrom
fix/press-tab-every-pointer

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #8728 (owner decision: keep the hover painted beneath the fading press instead of a 0s hover swap).

User impact

On desktop, a mouse or pen press on a tab showed only CSS :active's colour. It had no press feedback from the controller and no release fade, while a finger got both. Under spec:AST-094 FR43 every pointer presses the same way.

After this change, a mouse press on a tab paints the same press layer a finger's does, and the release fades back to the tab's hover tint.

Problem and solution fit

  • Why does it happen? Tab's pressed image arms were set only inside @media (pointer: coarse), so the controller's data-astryx-press painted nothing for a mouse.
  • Why does it matter? The tab doesn't answer a click the way the rest of the system now does (buttons, cards, list rows, checkboxes and radios on feat(core): a checkbox and a radio option press the same way for every pointer (spec:AST-094 FR43) #8696).
  • What's the fix? The image arms paint for every pointer, and the colour arms yield while the controller paints, so a press never paints twice. Tab's hover layer swaps its colour at once under a hovering mouse. Otherwise the hand-back from the press image to the hover colour shows the bare tab for a frame: in real Chromium, 232 → 240 → 255 before settling at 242.

Expected behavior and authority

  • spec:AST-094 FR11 and FR43 (DEC-21): every pointer's press is painted through the press controller.

Smallest restoration

Evidence

Tab paints the press for every pointer

  • Reproduction before the change: a mouse press shows :active's colour only, then jumps on release (235 → 242).
  • Result after the change: the controller's press layer, then a fade into the hover tint (232 → 239 → 242), for an unselected tab and the selected one alike.
  • Representative unchanged path: a finger's press on a tab, and a Space press (:active).
  • Regression test: pressEveryPointer.source-build.test.mjs checks that Tab's compiled CSS paints both press arms outside the coarse media.

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

  • pnpm vitest run packages/core/src/TabList packages/core/src/utils
  • pnpm -F @astryxdesign/core typecheck
  • Real Chromium timelines above, against base and head storybook builds.

Under spec:AST-094 FR43 the press controller paints a mouse's or a pen's
press too (data-astryx-press), not only a finger's. Tab painted its
pressed image only inside @media (pointer: coarse), so a mouse press
showed nothing but :active's colour.

- Its image arms paint the controller's press for every pointer, and its
  colour arms yield while it paints, so a press never paints twice.
- Its hover layer swaps its colour at once under a hovering mouse, as Step
  and Outline do, so the hand-back from the press to the hover does not
  flash.

Checkbox and Radio are #8696's; Switch is #8681's.

Test: Tab's compiled CSS paints both arms outside the coarse media.

(Rebuilt from 9cf836c8 with only its Tab part.)
…g mouse

The controller's press image hands back to the hover layer's colour when a
mouse release ends; the layer's eased colour swap showed the bare tab for
a frame in between (real Chromium: 232, 240, then 255 before settling at
the hover's 242). Under a hovering mouse the swap is instant, as Step and
Outline do.
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 27, 2026 4:57pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 27, 2026, 5:18 PM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to merge into the release-to-hover branch: Tab's hover layer now paints the press controller's image for a mouse or pen press and drops its :active colour while the controller paints, which matches the fine-pointer press profile in spec:AST-094 FR11, and the new compiled-CSS test fails on the base and passes on the head. One optional follow-up: the 0s hover duration also makes every mouse hover-in on a tab appear at once instead of easing, which is worth a line in the changeset if it is intended. Because the release fades to --_press-rest, this should land into #8713's branch or after it.

[Automated review]

default: durationVars['--duration-fast'],
[stylex.when.ancestor(':hover', tabScope)]: {
default: null,
'@media (hover: hover)': '0s',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Non-blocking: keying the 0s on :hover also makes every mouse hover-in on a tab appear at once instead of easing over --duration-fast (the hover-out still eases). If that is intended, a line in the changeset would tell consumers; no current spec sets Tab's hover timing either way.

@cixzhang cixzhang closed this Oct 27, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 27, 2026
@github-actions
github-actions Bot deleted the fix/press-tab-every-pointer branch October 28, 2026 06:17

This branch was successfully deployed

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

Labels

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.

1 participant