Repository navigation
experimental theme: a resting background color, outline or shadow keeps a part's hover and keyboard focus visible - #13464
josephfarina wants to merge 4 commits into
Conversation
…s its hover and keyboard focus visible Folds in the fixes from review: Core's own hover, press and focus come back under a resting background or outline, under Core's disabled and touch conditions; a state the theme sets for that scope, a wider one, or one mode stays; a wider focus outline is copied per property under a resting look for a variant and a size, keeping what that scope sets itself.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec f41fc0a |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Changes requested: the restore works for the cases it covers, and two small fixes are needed before it lands.
- The changeset and title say any resting setting keeps hover and keyboard focus visible, but only a
backgroundcolor shorthand,outline/outline-style/outline-widthand a shadow on a ringed part are handled (a gradient background,background-image: noneoroutline-color: transparentstill hide them), so please name those three settings and say that a background with its own image keeps that image in every state. - The image check at
packages/cli/api/theme-edit/_settings.mjs:7634missesimage-set("…"), so a restingimage-set()background is replaced by Core's overlay on hover and press; reusing thegradient(/url(/image-set(test from line 7503, with a test beside the gradient case, fixes it.
Also worth a look, non-blocking: the touch press fade ([data-astryx-press="fading"]) is still masked by a resting background shorthand, and a revert-layer for that state would hand it back to Core.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the editor keeps hover and keyboard focus visible whenever a setting changes a part's resting look. False: only three settings are handled; a gradient background,
background-image: noneandoutline-color: transparentstill hide them. - Claim: a resting
backgroundshorthand gives back Core's hover and press layer under Core's conditions. Verified for a color background (new tests and generated CSS); false for gradient,url()andimage-set()backgrounds. - Claim: Core's focus and hover rings draw over a resting shadow. Verified (
_settings.mjs:8102and the ring tests). - Claim: a resting
outlinegives the focus state Core's focus outline back. Verified (new outline tests). - Claim: a hover, press or focus outline the theme sets for that scope, a wider one, or one mode stays as set. Verified (new tests).
- Claim: under a variant-and-size resting look, a wider focus outline is copied per property and the scope's own property stays. Verified (the small ghost green ring test).
- Claim: on main, a resting background, a resting shadow or
outline: nonehid hover, press or focus. Verified: 14 of the 22 new cases fail on main. - Claim: no press layer on a disabled part and no hover left after a tap. Verified: the restored states fall back to Core's own enabled and hover-capable rules.
- Claim: the new test file has 22 cases. Verified.
- Claim: the whole theme-edit suite passes. Partly checked: the 81 related theme-edit test files pass at this head.
- Claim: no new public API. Verified.
- Claim: the code is about 300 lines. Verified (289 added, 4 removed).
.changeset/experimental-theme-rest-look-keeps-hover-focus.md: release note overclaims (blocking).packages/cli/api/theme-edit/_settings.mjs:image-set()guard (blocking); touch press fade (non-blocking).packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs: clear.packages/cli/api/theme-edit/theme-resting-shadow-part-rings.test.mjs: clear.packages/cli/api/theme-edit/theme-part-state-wins-build.test.mjs: clear.packages/cli/api/theme-edit/theme-part-text-sits-core.test.mjs: clear.packages/cli/api/theme-edit/theme-state-part-states-changed.test.mjs: clear.packages/cli/api/theme-edit/theme-titles-shadows-alpha-state.test.mjs: clear.
| ); | ||
| }); | ||
| }; | ||
| for (const state of ['hover', 'active']) { |
There was a problem hiding this comment.
Non-blocking: Core also paints the press overlay on [data-astryx-press="fading"] while a touch press releases. The resting shorthand still masks that state, so the overlay cuts off instead of fading; a revert-layer for it too would hand it back to Core.
… the release note names the three settings Review findings on #13464: image-set() joins gradient and url() as a background with its own image, which keeps it in every state; the release note and title name the resting settings handled (background color shorthand, outline, a shadow on a ringed part).
|
/approve-spec e102173 |
There was a problem hiding this comment.
Changes requested: the release note and the image-set() guard are fixed, and one restore case still needs a fix before this lands.
- Miss: a resting
backgroundon AvatarGroup's overflow (background #ff0000 --on avatar-group-overflow) now getsbackground-image: revert-layerin its hover and press rules, and Core's base value there includes the overflow's own neutral tint, so the theme's color takes that tint under the pointer, even on the non-interactive+Nindicator (packages/cli/api/theme-edit/_settings.mjs:7733-7778); skipping the restore for a part whose Core restingbackground-imageis notnone(or writing only Core's overlay layer there, under Core's hover media and enabled guard), with a test onavatar-group-overflow, fixes it.
Also worth a look, non-blocking: the touch press fade ([data-astryx-press="fading"]) is still masked by a resting background shorthand, and the description's "22 cases" is 23 at this head.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Claim: the editor keeps hover and keyboard focus visible under three resting settings. Verified (
_settings.mjs:7629-7637). - Claim: a resting
backgroundcolor shorthand gives back Core's hover and press layer under Core's own conditions (no press layer on a disabled part, no hover after a tap). Verified for parts whose resting look has no image of Core's (tests for the disabled press and the touch hover, and the generated selectors); false for AvatarGroup's overflow (the blocking finding). - Claim: a background with its own image (gradient,
url(),image-set()) keeps that image in every state. Verified (_settings.mjs:7634; the new image test fails with the previous guard and passes here). - Claim: a resting
outline,outline-styleoroutline-widthgives the focus state Core's focus outline back. Verified (new outline tests). - Claim: Core's focus and hover rings are drawn over a resting shadow on a ringed part. Verified (
_settings.mjs:8102and the ring tests). - Claim: a hover, press or focus outline the theme sets for that scope, a wider one, or one mode stays as set. Verified (new tests).
- Claim: under a variant-and-size resting look, a wider focus outline is copied per property and the scope's own property stays. Verified (the small ghost green ring test).
- Claim: on main, a resting background, a resting shadow or
outline: nonehid hover, press or focus. Verified (the base compiles only the resting rule; the new cases fail there). - Claim: the change is the two functions, the shadow order, the new test file, five updated tests and the release note, about 300 lines of code. Verified (289 added, 4 removed in
_settings.mjs). - Claim: the new test file has 22 cases. False: it has 23 at this head (non-blocking).
- Claim: the whole theme-edit suite passes. Partly checked: the six changed test files and the 65 theme-edit test files that set a background, outline or shadow pass at this head.
- Claim: no components and no new public API. Verified.
.changeset/experimental-theme-rest-look-keeps-hover-focus.md: accurate apart from "Core's own conditions" for AvatarGroup's overflow (the blocking finding).packages/cli/api/theme-edit/_settings.mjs: AvatarGroup overflow tint (blocking); touch press fade (non-blocking).packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs: clear (no AvatarGroup overflow case yet).packages/cli/api/theme-edit/theme-resting-shadow-part-rings.test.mjs: clear.packages/cli/api/theme-edit/theme-part-state-wins-build.test.mjs: clear.packages/cli/api/theme-edit/theme-part-text-sits-core.test.mjs: clear.packages/cli/api/theme-edit/theme-state-part-states-changed.test.mjs: clear.packages/cli/api/theme-edit/theme-titles-shadows-alpha-state.test.mjs: clear.
…nt gets no overlay back Review finding on #13464: a resting background on AvatarGroup's overflow got revert-layer in its hover and press rules, so Core's neutral tint came back under the pointer. A part whose plain resting background-image (not under an attribute state) is not none now gets no overlay restore.
|
/approve-spec 17cdf0f |
There was a problem hiding this comment.
Changes requested: the AvatarGroup overflow tint is fixed, and the release note needs one clause to match that fix.
- Regression: the release note (
.changeset/experimental-theme-rest-look-keeps-hover-focus.md) says a restingbackgroundcolor shorthand gives the part's hover and press layer back, but the new skip inpackages/cli/api/theme-edit/_settings.mjs:7736-7747(asserted by the test attheme-rest-look-keeps-hover-and-focus.test.mjs:540) leaves AvatarGroup's clickable+Nwith no hover or press underbackground … --on avatar-group-overflow, exactly as on main, so add the description's own clause, "a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back", to that sentence.
Also worth a look, non-blocking: the touch press fade ([data-astryx-press="fading"]) is still masked by a resting background shorthand.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Claim: the editor keeps hover and keyboard focus visible under three resting settings. Verified for the settings and parts tested (
_settings.mjs:7629-7637). - Claim: a resting
backgroundcolor shorthand gives the part's hover and press layer back from Core under Core's own conditions (no press layer on a disabled part, no hover after a tap). Verified for the button and calendar day (tests and compiled CSS); false for AvatarGroup's overflow, which now gets nothing back (the blocking finding). - Claim: a background with its own image (gradient,
url(),image-set()) keeps that image in every state. Verified (_settings.mjs:7634; test at line 550 of the new test file). - Claim: a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back. Verified (
_settings.mjs:7736-7747; the new test fails on the previous revision and passes here; the compiled CSS for that part now matches main's). - Claim: a resting
outline,outline-styleoroutline-widthgives the focus state Core's focus outline back. Verified (outline tests). - Claim: Core's focus and hover rings are drawn over a resting shadow on a ringed part. Verified (
_settings.mjs:8117and the ring tests). - Claim: a hover, press or focus outline the theme sets for that scope, a wider one, or one mode stays as set. Verified (tests).
- Claim: under a variant-and-size resting look, a wider focus outline is copied per property and the scope's own property stays. Verified (the small ghost green ring test).
- Claim: on main, a resting background, a resting shadow or
outline: nonehid hover, press or focus. Verified (main compiles only the resting rule). - Claim: the change is the two functions, the shadow order, the new test file, five updated tests and the release note, about 300 lines of code. Verified (304 added, 4 removed in
_settings.mjs; five test files updated). - Claim: the new test file has 24 cases. Verified.
- Claim: the whole theme-edit suite passes. Partly checked: the six changed test files and the 64 theme-edit test files that set a background, outline or shadow pass.
- Claim: no components and no new public API. Verified.
.changeset/experimental-theme-rest-look-keeps-hover-focus.md: the AvatarGroup overflow exception is missing (blocking).packages/cli/api/theme-edit/_settings.mjs: clear apart from the touch press fade (non-blocking).packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs: clear.packages/cli/api/theme-edit/theme-resting-shadow-part-rings.test.mjs: clear.packages/cli/api/theme-edit/theme-part-state-wins-build.test.mjs: clear.packages/cli/api/theme-edit/theme-part-text-sits-core.test.mjs: clear.packages/cli/api/theme-edit/theme-state-part-states-changed.test.mjs: clear.packages/cli/api/theme-edit/theme-titles-shadows-alpha-state.test.mjs: clear.
Review finding on #13464: the release note now says a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back, as the code and description do. Text only.
|
/approve-spec ee9e702 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
The release note now names the AvatarGroup overflow exception, which was the last blocking point, and the code is unchanged since the previous review. One optional follow-up: under a resting background color the touch press fade ([data-astryx-press="fading"]) is still masked, so the restored press overlay cuts off instead of fading on touch screens; a revert-layer for that state would hand it back to Core.
Claims and files checked
Review mode: incremental; reason: none
- Claim: a resting
backgroundcolor shorthand gives the part's hover and press layer back under Core's own conditions (no press layer when disabled, no hover after a tap): verified,_settings.mjs:7631-7636and:7788, tests for the ghost hover and press, the disabled press and the touch hover. - Claim: a background with its own image (gradient,
url(),image-set()) keeps that image in every state: verified,_settings.mjs:7634, test for a gradient and animage-set(). - Claim: a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back: verified,
_settings.mjs:7736-7747, test attheme-rest-look-keeps-hover-and-focus.test.mjs:540. - Claim: a resting
outline,outline-styleoroutline-widthgives the focus state Core's focus outline back: verified,_settings.mjs:7629-7630and:7955-7983, test at:82. - Claim: Core's focus and hover rings are drawn over a resting shadow on a ringed part: verified,
_settings.mjs:8117,theme-resting-shadow-part-rings.test.mjsincluding the deep-bevel case. - Claim: a hover or press background or focus outline property the theme sets for that scope, a wider one, or one mode stays as set: verified,
_settings.mjs:7758-7793and:7824-7845, tests at:97,:114,:129,:465,:484,:503,:522,:562. - Claim: under a variant-and-size resting look a wider focus outline is copied per property and the scope's own property stays: verified,
_settings.mjs:7886-7954, tests at:182,:205,:238,:280,:308. - Claim: the change returns the earlier merged editor change against main with its three follow-up fixes folded in: consistent, the earlier pull request merged into the editor feature branch and the three follow-ups are closed unmerged with matching titles.
- Claim: on main a resting background wiped the hover and press layer, a resting shadow covered the focus ring and
outline noneremoved the focus outline: verified, main's compile step has neither restore and writes the shadow before the ring, and the theme layer sits above Core's (packages/core/src/reset.css:40). - Claim: 24 new cases, five existing test files updated for the ring order, about 300 lines of code: verified, 24 cases all passing, five files, +304/−4 in
_settings.mjs. - Claim: the theme-edit suite passes: verified, all 561 test files under
packages/cli/api/theme-editpass at this head (6,134 tests passed, 4 skipped). - Claim: no component and no public API changes, and this head changes only the release note since the previous one: verified, the CLI's exports, bin and command docs are unchanged and the only commit since edits one changeset line.
- File
.changeset/experimental-theme-rest-look-keeps-hover-focus.md: clear. - File
packages/cli/api/theme-edit/_settings.mjs: clear, with the non-blocking touch press fade note. - File
packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs: clear. - File
packages/cli/api/theme-edit/theme-resting-shadow-part-rings.test.mjs: clear. - Files
theme-part-state-wins-build.test.mjs,theme-part-text-sits-core.test.mjs,theme-state-part-states-changed.test.mjs,theme-titles-shadows-alpha-state.test.mjs: clear, each follows the new ring order.
- #13358 fix(cli): a theme family checks its compiled registries as plain Node loads them Author: @josephfarina - #13388 fix(cli): --check reads a theme family's committed compiled registries Author: @josephfarina - #13464 experimental theme: a resting background color, outline or shadow keeps a part's hover and keyboard focus visible Author: @josephfarina - #13433 cli(icons): icon response types say "icon meaning" and "variant" Author: @josephfarina - #13456 feat(templates): dashboard-scorecard shows two headline numbers per row on a phone when they fit Author: @josephfarina - #13473 docs(icons): icon-set guide's relatives line; template icons say icon component Author: @josephfarina
|
Landed in #13542. |
Returns #13235 against main with the fixes from its review folded in (#13293, #13357, #13390), as one change.
User impact
astryx experimental theme editor set: a setting that changes a part's resting look hid its hover or keyboard focus. Examples:backgroundon a button wiped Core's hover and press layer; a resting shadow covered the focus ring;outline noneremoved the focus outline.Now:
backgroundcolor shorthand, the part's hover and press layer comes back from Core, under Core's own conditions: no press layer on a disabled part, and no hover left on a touch screen after a tap. A background with its own image (a gradient,url(),image-set()) keeps that image in every state, and a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back.outline,outline-styleoroutline-width, the part's focus state gets Core's focus outline back.--when variant:ghost+size:sm), a wider focus outline is copied per property, and a property that scope sets itself stays. For example, a small ghost keeps its own green ring color and gets the ghost's solid 2px ring.Smallest restoration
packages/cli/api/theme-edit/_settings.mjs:withOverlayStates(revert-layer for hover and press),withFocusOutline(Core's focus values, and the theme's own and wider values), and shadow ring order.packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjsand five existing tests updated for the ring order..changeset/experimental-theme-rest-look-keeps-hover-focus.md: the release note.Not split: the review fixes change the same two functions as the original change. Landing them apart would ship the regressions they fix. The code is about 300 lines; the rest is tests.
Evidence
packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs(24 cases)packages/cli/api/theme-editsuite passes.Scope
Components: none (experimental theme editor only)
replay: worse 0 at ee9e702 (carried from 17cdf0f: release-note text only)
preflight: pass ee9e702 (carried from 17cdf0f: release-note text only) (CI half pass; review: astracat at this head)