Repository navigation
Conversation
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, with no release fade. - Its image arms paint the controller's press for every pointer. - Its hover and pressed colours yield while the press is on, so a press never paints twice, and paint again over the release, so a hovering pointer's release lands on the tab's hover (as the shared overlay does). Checkbox and Radio are #8696's; Switch is #8681's. Test: Tab's compiled CSS paints both arms outside the coarse media.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Recommending approval: a mouse or pen press on a tab now paints through the press controller at once and fades onto the hover tint, as spec:AST-094 FR11 and DEC-21 require, and the new source-build test fails on the base and passes here. This lands after its base, #8727. An optional follow-up: under Reduce Motion the release shows the bare tab for one frame before the hover returns, as TopNav items already do through the shared overlay, and a 0s colour transition on the hover layer under prefers-reduced-motion: reduce would remove it.
[Automated review]
There was a problem hiding this comment.
Recommending approval: a mouse or pen press on a tab now paints through the press controller at once and its release fades onto the hover tint, as spec:AST-094 FR11 and DEC-21 require, and the new source-build test fails on the base and passes here. This lands after its base, #8727. An optional follow-up: under Reduce Motion the release shows the bare tab for one frame before the hover fades back in, as TopNav items already do through the shared overlay, and a 0s colour transition on the hover layer under prefers-reduced-motion: reduce would remove it.
[Automated review]
c810adf to
7470b07
Compare
6f77c85 to
4b7e067
Compare
There was a problem hiding this comment.
Requesting changes: one blocking finding, unchanged at this head.
- Desktop behavior change needs an owner decision: a mouse or pen press on an enabled Tab now paints the press controller's layer instead of
:active's colour and fades on release (packages/core/src/TabList/Tab.tsx, lines 164-184), with no touch gate; either gate it to touch input or cite the owner's decision for this desktop behavior in the description.
On the note citing spec:AST-094 FR11 and DEC-21: they describe this press, but on main the mouse press through the press controller has not shipped yet, so this is new desktop behavior rather than a restoration, and the records alone do not carry the owner's decision for it. The non-blocking comment and test suggestions from the earlier review still apply. This lands only after its base, #8727.
[Automated review]
| [stylex.when.ancestor('[data-astryx-press="on"]', tabScope)]: { | ||
| default: null, | ||
| default: pressedOverlayImage, | ||
| '@media (pointer: coarse)': pressedOverlayImage, | ||
| }, | ||
| [stylex.when.ancestor('[data-astryx-press="fading"]', tabScope)]: { | ||
| default: null, | ||
| default: pressedOverlayImage, | ||
| '@media (pointer: coarse)': pressedOverlayImage, | ||
| }, |
There was a problem hiding this comment.
Blocking: desktop behavior change needs an owner decision. These unconditioned arms, with the colour yield at lines 164-168, make a mouse or pen press paint the controller's layer instead of :active's colour, and the release then fades over about 190 ms. Nothing gates this to touch input. Gate it to touch input, or cite the owner's decision in the description.
| // While the press is on, the hover and pressed colours yield to the | ||
| // image (same shape as the arm above, so it outranks it). Over the | ||
| // release they paint again: a hovering pointer's hover sits beneath the | ||
| // fading image, so the release lands on it. |
There was a problem hiding this comment.
Non-blocking: the first sentence carries two topics (the yield, and why this arm wins). Suggested:
// While the press is on, the hover and pressed colours yield to the image.
// This arm has the `:active` arm's shape, so it compiles after it and wins.
// Over the release the colours paint again, so the release lands on the hover.| // The touch press, as an image layer over the colour: an image change is | ||
| // discrete, so the layer's colour transition cannot fade the onset in, | ||
| // and the strength the tab's `pressedAlpha` arms own (1 while on, 1 → 0 | ||
| // over the release) is what moves. Coarse pointers only, like the colour | ||
| // arms above; see interactionOverlay.stylex.ts. | ||
| // over the release) is what moves. Every pointer: a mouse paints at once; | ||
| // see interactionOverlay.stylex.ts. |
There was a problem hiding this comment.
Non-blocking: this still opens with "The touch press", but the layer now paints every pointer's press, and the first sentence runs past 40 words. Suggested:
// The press paints as an image over the colour. An image change is
// discrete, so the colour transition cannot fade the onset in. The tab's
// `pressedAlpha` arms move the strength instead: 1 while on, 1 → 0 over
// the release.| for (const arm of ['on', 'fading']) { | ||
| const rules = pressImageRules(css, arm); | ||
| expect(rules.length, `${control} ${arm}`).toBeGreaterThan(0); | ||
| expect( | ||
| rules.some(rule => !rule.coarseOnly), | ||
| `${control} ${arm}`, | ||
| ).toBe(true); |
There was a problem hiding this comment.
Non-blocking: this pins only the image arms. Deleting the colour yield (Tab.tsx lines 164-168) keeps it green, though a hover-capable desktop would then paint :active's 10% under the image. You could also assert a [data-astryx-press="on"] rule with background-color:transparent outside the coarse media.
humbertovirtudes
left a comment
There was a problem hiding this comment.
Reviewed at 4b7e067. The change itself looks correct and in scope; holding approval on its base.
Authority: a mouse or pen press replacing :active is admitted by spec:AST-094 FR11 (under a fine pointer the press paints "through the same press controller and release fade as a finger's, in place of CSS :active") and DEC-21, both authority: current. The earlier automated request to gate this to touch can be resolved by citing those.
Base: this PR targets fix/press-release-lands-on-hover (#8727), which in turn targets stack/press-on-8682. #8682 was closed as superseded by #9762 and #9783, and on main the press controller still paints a mouse press only where the stylesheet dropped :active (pressFeedback.ts, stylesheetDroppedActive). So this change takes effect only on top of that stack, and because the base is not main, the CI workflow has not run tests, lint or typecheck at this head. I suggest redoing these three files against main once the press-for-every-pointer work (#8469) settles, then I am happy to approve with green CI.
Non-blocking:
- pressEveryPointer.source-build.test.mjs:90 pins only the image arms. Deleting the colour yield at Tab.tsx:164-168 keeps it green. Consider also asserting a [data-astryx-press="on"] rule with background-color:transparent outside the coarse media.
- Tab.tsx:179 and :183: the (pointer: coarse) arms now equal their defaults and can be dropped.
- Tab.tsx:103, :170 and :405 still describe this as the touch press.
- The test covers only Tab; colocating it as TabList/Tab.press.source-build.test.mjs would match sibling source-build tests, unless more controls are planned for the list.
|
I'll run a full review to re-check this with your note. |
|
(Posted by Cindy's agent.) Closing: this was stacked on #8682, which closed without merging (superseded by the touch press-token work), so it has no path to main and no fine-pointer press ships today. Re-raise if a fine-pointer (mouse/pen) press through the press controller comes back. |
User impact
On desktop, a mouse or pen press on a tab showed only CSS
:active's colour: no press from the controller and no release fade, while a finger got both. Underspec:AST-094FR43 every pointer presses the same way.After this change, a mouse press on a tab paints the controller's press layer, and the release lands on the tab's hover tint.
Problem and solution fit
@media (pointer: coarse), so the controller'sdata-astryx-presspainted nothing for a mouse.Expected behavior and authority
spec:AST-094FR11 and FR43 (DEC-21).Smallest restoration
TabList/Tab.tsxonly, plus a source-build test. It's stacked on the release-lands-on-hover PR, fix(core): a mouse release lands on the hover the control still has #8727.Evidence
:active's colour only, then a jump on release (235 → 242).:active).pressEveryPointer.source-build.test.mjschecks that Tab's compiled CSS paints both press arms outside the coarse media.Scope
Testing
pnpm vitest run packages/core/src/TabList packages/core/src/utilspnpm -F @astryxdesign/core typecheckSupersedes #8714.