Repository navigation
Conversation
The internal/touch re-exports, their identity test, the two header comments, and the two catalog messages move to their own Core pull request, #11283 (its changeset covers the catalog), so this one changes only Lab and the CLI's discover list. It merges after #11283. Co-authored-by: Rajatendu1 <[email protected]>
The record states Rating's candidate contract for engineering-owner approval: the controlled API, the radio-group keyboard model, the action-groups touch choice, the read-only image, and the colour roles.
This pull request stays Lab-only; the draft record lands separately for engineering-owner approval.
States Rating's candidate contract for engineering-owner approval: the controlled API, the radio-group keyboard model, the action-groups touch choice, the read-only image, and the colour roles. The component is Rajatendu1's contribution.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Approval waits on an engineering owner's decision on the draft component:Rating record, and two fixes are needed whatever that decision is.
The record adds requirements that no current record states yet (FR1–FR4, FR7, AR1–AR5, ORD1–ORD3, DD1–DD2 and the public concepts). It also leaves two decisions open: OQ1, whether Down raises or lowers the rating, and whether allowClear should use the system's existing hasClear name. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. An amended record needs a new head.
- Empty star outlines use
--color-border-emphasized(DD1 atRating.spec.md:184,Rating.tsx:85) and measure 1.48:1 on white, below the 3:1 thatarchitecture:theme-tokensINV13 requires for a radio's only visible edge; DD1 should name--color-border-controland the build should use a role that meets 3:1. - Shift with an arrow key, Home or End still changes the rating because
Rating.tsx:310-312ignores only Alt, Control and Meta, which contradicts FR3 and the description's "a modified key does nothing"; addevent.shiftKeyto that guard or narrow FR3 to Control, Meta and Alt chords.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: adds the draft Rating record with owner cixzhang: verified (record frontmatter).
- Claim: the record's props match the controlled Lab API: verified (
Rating.tsxRatingProps). - Claim: Down and the inline-end arrow raise the rating, Up and the inline-start arrow lower it, arrows do not wrap, Home and End pick the ends: verified (keyboard and right-to-left tests).
- Claim: a modified key does nothing: false, because Shift moves and commits (
Rating.tsx:310-312; browser capture). - Claim: touch uses the action-groups slide-and-lift: verified (10 pointer-stream tests).
- Claim: read-only is one image whose last star fills from the inline start: verified (tests; right-to-left capture).
- Claim: the colour roles and forced-colour roles are as listed: verified (
Rating.tsxstyles), though the empty-outline role fails 3:1 (finding above). - Claim: the branch sits on #11082 and only the record is new here: verified (the diff from #11082's head changes only the record).
- Claim: the writing rubric R1–R7 passes: verified.
- Claim: the knowledge check reports the records aligned: verified (run at this head).
- Changeset:
astryx discoverlists the experimental Rating: verified (the generated list is current). .changeset/cli-discover-rating.md: clearapps/storybook/stories/Rating.stories.tsx: cleardocs/specs/components/Rating/Rating.spec.md: owner decision pending; DD1 contrast; FR3 wordinginternal/shadcn-registry/routes.lock.json: clearpackages/cli/assets/discover/official-packages.json: clearpackages/lab/src/Rating/Rating.doc.mjs: clearpackages/lab/src/Rating/Rating.test.tsx: clearpackages/lab/src/Rating/Rating.tsx: empty-outline contrast; Shift guardpackages/lab/src/Rating/RatingTracking.test.tsx: clearpackages/lab/src/Rating/index.ts: clearpackages/lab/src/Rating/rating.stylex.ts: clearpackages/lab/src/index.ts: clear
|
|
||
| | ID | Decision | Intent or reason | Applies to | Allowed variation | | ||
| | --- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------- | ------------------------- | | ||
| | DD1 | Filled stars use `--color-icon-yellow`; empty star outlines use `--color-border-emphasized`; disabled filled stars use `--color-text-disabled`. | The rating color reads as a score; the outline keeps empty stars visible. | every star | themes repaint the tokens | |
There was a problem hiding this comment.
Empty star outlines are each unchosen radio's only visible edge, and --color-border-emphasized measures 1.48:1 on white in the light Storybook. architecture:theme-tokens INV13 asks for 3:1 on that edge and gives controls --color-border-control. Could DD1 name that role?
| event.altKey || | ||
| event.ctrlKey || | ||
| event.metaKey |
There was a problem hiding this comment.
Shift isn't in this guard, and useListFocus ignores only Control, Meta and Alt, so Tab, then Shift+ArrowRight or Shift+End, commits a star. FR3 in the record says "A modified key MUST do nothing". Add event.shiftKey || here, or narrow FR3 to Control, Meta and Alt chords.
Without a forced-colours value, the disabled colour replaced the filled star's forced-colours arm, so a disabled Rating drew Highlight fills like an enabled one. Core paints disabled controls GrayText there.
|
/approve-spec d2329f9 |
There was a problem hiding this comment.
Changes requested: an engineering owner approved the component:Rating record at this head, so its requirements are settled, but the Lab build and one design decision still need three fixes.
- A disabled Rating contradicts the approved DD1 and DD2:
filledDisabled(Rating.tsx:414) paints its empty outlines in the disabled colour instead of--color-border-emphasized, and under forced colours they turn GrayText while its chosen stars stay Highlight like an enabled rating, so write the disabled paint into DD1 and DD2 and make the build, with a forced-colours test, match it. - Empty star outlines use
--color-border-emphasized(DD1 atRating.spec.md:184,Rating.tsx:88) and measure 1.48:1 on white, below the 3:1 thatarchitecture:theme-tokensINV13 requires for a radio's only visible edge, so DD1 should name--color-border-controland the build should paint a role that meets 3:1. - Shift with an arrow key, Home or End still changes the rating because the guard at
Rating.tsx:310-316ignores only Alt, Control and Meta, which contradicts the approved FR3 and the description's "a modified key does nothing", so addevent.shiftKeythere or narrow FR3 to Control, Meta and Alt chords.
An amended record needs a fresh /approve-spec at its new head.
Claims and files checked
Review mode: same-head; reason: none
- changed rules (0): none
- Claim: adds the draft Rating record with one owner: verified (record frontmatter).
- Claim: the record governs once an engineering owner approves it at this head: an engineering owner approved it at this head.
- Claim: the record's props match the controlled Lab API: verified (
Rating.tsxRatingProps). - Claim: Down and the inline-end arrow raise the rating, Up and the inline-start arrow lower it: verified (keyboard and right-to-left tests).
- Claim: arrows do not wrap, and Home and End pick the ends: verified (keyboard tests).
- Claim: a modified key does nothing: false, because Shift with an arrow, Home or End commits (
Rating.tsx:310-316; Storybook). - Claim: touch uses the action-groups slide-and-lift: verified (10 pointer-stream tests).
- Claim: read-only is one image whose last star fills partway from the inline start: verified (tests; Storybook).
- Claim: filled, empty and disabled stars use the yellow icon, emphasized border and disabled text roles: verified for enabled stars; a disabled rating also paints its empty outlines in the disabled role (finding above).
- Claim: forced colours use Highlight and CanvasText: false for a disabled rating, whose empty outlines paint GrayText (
Rating.tsx:67-72). - Claim: the branch carries #11082's Lab files and only the record is new here: verified (the diff from #11082's carried commit changes only the record).
- Claim: the writing rubric R1–R7 passes: verified.
- Claim: the knowledge check reports the records aligned: verified (run at this head).
- Changeset:
astryx discoverlists the experimental Rating: verified (the generated list is current). .changeset/cli-discover-rating.md: clearapps/storybook/stories/Rating.stories.tsx: cleardocs/specs/components/Rating/Rating.spec.md: owner-approved; DD1 contrast against INV13internal/shadcn-registry/routes.lock.json: clearpackages/cli/assets/discover/official-packages.json: clearpackages/lab/src/Rating/Rating.doc.mjs: clearpackages/lab/src/Rating/Rating.test.tsx: clearpackages/lab/src/Rating/Rating.tsx: disabled paint; empty-outline contrast; Shift guardpackages/lab/src/Rating/RatingTracking.test.tsx: clearpackages/lab/src/Rating/index.ts: clearpackages/lab/src/Rating/rating.stylex.ts: clearpackages/lab/src/index.ts: clear
| styles.empty, | ||
| !partial && fill === 1 && styles.filled, | ||
| isInteractive && styles.interactivePath, | ||
| isDisabled && styles.filledDisabled, |
There was a problem hiding this comment.
This adds filledDisabled to empty stars too, so a disabled rating's empty outlines paint --color-text-disabled (DD1 says --color-border-emphasized) and GrayText under forced colours (DD2 says CanvasText). Its chosen stars keep filled's separate Highlight key, so they still look enabled. Could DD1 and DD2 state the disabled paint, with filled's and empty's forced-colours arms folded into their color objects so this style replaces them?
Summary
This adds the draft
component:Ratingrecord. It states the contract of the LabRatingthat Rajatendu1 contributed in #11082:label,value/onChange,max,size, a focusableisDisabled,isReadOnly,allowClear,getStarLabel).--color-icon-yellowfilled,--color-border-emphasizedempty,--color-text-disableddisabled; Highlight and CanvasText under forced colours.The record is
authority: draftwithowners: [cixzhang]. It becomes the governing record once an engineering owner approves it at this head.Open question for the owner (OQ1): does Down raise the rating, as it moves to the next radio in a radio group (as built), or lower it, as on a vertical scale?
Stack: #11082 → this. The branch sits on #11082's Lab-only head, so the record's doc and test links resolve. Review only
docs/specs/components/Rating/Rating.spec.md; the other files are #11082's and merge there.Credit: the component, its docs and tests are Rajatendu1's (#11082). This pull request only adds the record.
Writing rubric results
pnpm check:knowledge: the records are aligned (run with #11082's Rating doc in the tree).Overlap checked: #11082 (the Lab Rating this record describes; it merges first and stays Lab-only)