Repository navigation
docs(Button): in link mode the ref receives the link element; pin today's ref type - #12371
Conversation
…type Button FR11 and FR17 already say the ref reaches the rendered root, which is the link when href is set. The type still names HTMLButtonElement. Widening or splitting the type changes public API, so this change records the mismatch instead: an FR17 gap line, a ref entry in Button's docs, and a public type test that pins today's type.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec e71eeda |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Button · Storybook | 65.9 kB (0) · 10.8 kB CSS (0) | 841 (0) | — · ✓ · ✗ |
Package size: @astryxdesign/core 7.63 MB packed (+85 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: one wording fix in the Button record.
docs/specs/components/Button/Button.spec.mdline 150 says the ref receives the anchor "withhref", but FR11 puts Button in link mode only withhrefand not disabled (a disabled one renders a<button>, whose ref matches its type) and may render a link component instead of an anchor, so please reword it to "in link mode (FR11), the ref receives the link element (the anchor, or the link component's element)" and give the title the same wording.
The new doc entry and the changeset already describe this correctly. Two smaller points: most of the Button.doc.mjs diff is a reformat with identical content, which the description does not mention, and the comment in Button.public.test.ts repeats the shorter wording. The new type test has not been compiled at this head yet, because CI's typecheck was skipped on the draft.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claims
- The docs now say a link-mode ref holds the anchor or the link component's element: verified (
Button.doc.mjs:297). - No runtime or type change: verified (only a docs data file, a record, a test and a changeset change).
Button.doc.mjsadds arefentry naming the root and thehrefcase: verified (lines 293-298); the rest of the file is reformatted with identical tokens.- FR17 gains an implementation-gap sentence: present (
Button.spec.md:150), but false for a disabledhrefButton (the blocking point above). - The FR17 verification row names the type test: verified (
Button.spec.md:304). - The new test pins
ButtonProps['ref']asReact.Ref<HTMLButtonElement> | undefined: the assertion is present (Button.public.test.ts:19); not yet compiled at this head. - The changeset is a docs patch for
@astryxdesign/core: verified. - FR11 and FR17 already say the ref reaches the rendered root: verified against the Button record.
- Widening or splitting the type would make valid callers change source: not checked.
- Typecheck, lint and the knowledge and changeset checks were clean on the parent commit: not checked (CI skipped at this head).
- The record edit adds one gap sentence and names a test in a verification row: verified.
- The docs now say a link-mode ref holds the anchor or the link component's element: verified (
- Files
.changeset/button-href-ref-doc.md: clear.docs/specs/components/Button/Button.spec.md: line 150 blocking; line 304 clear.packages/core/src/Button/Button.doc.mjs: clear (the new entry matches FR11; the reformat is a no-op).packages/core/src/Button/Button.public.test.ts: comment wording note; compile result pending CI.
…formatting The FR17 gap line and the type test's comment now say that in link mode (FR11) the ref receives the link element, the anchor or the link component's element. A disabled Button with href renders a button, whose ref matches its type. Button.doc.mjs keeps its existing formatting; only the ref entry is added.
|
/approve-spec f4a1bb8 |
There was a problem hiding this comment.
Changes requested: one wording fix in the changeset.
- Miss:
.changeset/button-href-ref-doc.mdline 5 says the docs describe the ref receiving the anchor "withhref", but the doc entry and FR11 limit that to link mode (a disabledhrefButton renders a<button>, whose ref matches its type), so please reword it to "in link mode (withhrefand not disabled)" and give the description's User impact bullet the same wording.
The record line, title, doc entry and test comment match FR11, and the new type test compiles under Core's typecheck at this head. One optional point: astryx component Button prints only each prop's first sentence, so the new row reads "Ref to the root element." there, and leading with the link-mode clause would put it in that view.
Claims and files checked
Review mode: same-head; reason: none
- Claims
- Changeset: the docs now list
refand say that withhrefthe ref receives the anchor or the link component's element, although the type namesHTMLButtonElement: false as worded: the doc entry limits it tohrefand not disabled (Button.doc.mjs:226), and a disabledhrefButton renders a<button>(Button.tsx:924); the blocking point above. - Changeset: no runtime or type change: verified: the change is a docs data entry, a record edit, a type test and a changeset; the
reftype is unchanged (Button.tsx:375). - Changeset: a docs patch for
@astryxdesign/core: verified; the changeset check passes at this head. - Primary intent: in link mode (
hrefand not disabled) the ref receives the link element while its type namesHTMLButtonElement: verified (Button.tsx:924,:1161-1162,:375). - User impact: the docs say the ref holds the link element when
hrefis set: false as worded, the same gap as the changeset; the doc entry itself is correct. - No runtime or type change: verified.
- The doc file adds a
refentry naming the root and the link-mode case, and the rest of the file is unchanged: verified (+6/-0,Button.doc.mjs:222-227). - The record's FR17 gains the link-mode gap line: verified (
Button.spec.md:150). - The FR17 verification row names the type test: verified (
Button.spec.md:304). - The new test pins
ButtonProps['ref']asReact.Ref<HTMLButtonElement> | undefined: verified (Button.public.test.ts:19-21): it compiles under Core's typecheck, and a widened type fails the same assertion. - FR11 and FR17 already say the ref reaches the rendered root: verified against the Button record.
- Widening the type, or splitting it on
href, would make valid callers change source: verified with a type probe: a ref forwarded to a native<button>, and a button ref passed withhref, each stop compiling. - Core typecheck with the new test, lint, the knowledge check and the changeset check are clean: verified at this head.
- Writing rubric: one gap sentence and a test name in a verification row, in the present tense with no history: verified.
- Changeset: the docs now list
- Files
.changeset/button-href-ref-doc.md: line 5 blocking.docs/specs/components/Button/Button.spec.md: clear (lines 150 and 304).packages/core/src/Button/Button.doc.mjs: clear; one non-blocking note on the CLI's first-sentence view.packages/core/src/Button/Button.public.test.ts: clear.
The changeset now says link mode (with href and not disabled). The ref entry leads with the link-mode clause, so the first sentence the CLI prints carries it.
|
/approve-spec a5cc79e |
There was a problem hiding this comment.
Approved pending CI: CI started on this head when the pull request left draft and has not finished yet.
The code is unchanged since the last review: the doc entry, the FR17 gap line, the type pin and the changeset all describe the ref in link mode, with href and not disabled, as FR11 does.
Claims and files checked
Review mode: same-head; reason: none
- Claims
- Changeset: Button's docs now list
ref: verified (Button.doc.mjs:222-227). - Changeset: in link mode (with
hrefand not disabled) the ref receives the anchor or the link component's element, although its type namesHTMLButtonElement: verified (Button.tsx:924,:1161-1162,:375). - Changeset: no runtime or type change: verified: the built API surface of Core and the themes is identical before and after, and no runtime file changes.
- Changeset: a docs patch for
@astryxdesign/core: verified; the changeset check passes at this head. - Title and primary intent: in link mode the ref receives the link element while its type names
HTMLButtonElement, and today's type is pinned: verified (Button.tsx:924,:1161-1162,:375;Button.public.test.ts:19-21). - User impact: the docs say the ref holds the link element in link mode, with
hrefand not disabled: verified (Button.doc.mjs:226). - No runtime or type change: verified, as for the changeset.
- The doc entry leads with the link-mode case, so the first sentence the CLI prints carries it, and the rest of the file is unchanged: verified: the default component view prints the whole row, and the file only gains the six-line entry.
- The record's FR17 gains the link-mode gap line, and its verification row names the type test: verified (
Button.spec.md:150,:304). - The new test pins
ButtonProps['ref']asReact.Ref<HTMLButtonElement> | undefined: verified: it compiles under Core's typecheck, and the same assertion over a widened type fails. - FR11 and FR17 already say the ref reaches the rendered root: verified against the Button record, which reads the same on
maintoday. - Widening the type, or splitting it on
href, would make valid callers change source: verified with a type probe: a ref forwarded to a native<button>, and a button ref passed withhref, each stop compiling. - Core typecheck with the new test, lint, the knowledge check and the changeset check are clean: verified at this head; the Lint workflow also passes here.
- Writing rubric: one gap sentence and a test name in a verification row, in the present tense with no history: verified.
- Changeset: Button's docs now list
- Files
.changeset/button-href-ref-doc.md: clear.docs/specs/components/Button/Button.spec.md: clear.packages/core/src/Button/Button.doc.mjs: clear.packages/core/src/Button/Button.public.test.ts: clear.
Primary intent
Docs and record: say that in link mode (FR11:
hrefand not disabled), Button'srefreceives the link element (the anchor, or the link component's element) while its type namesHTMLButtonElement, and pin today's type with a test.User impact
<Button href ref>: the docs now say the ref holds the link element (the anchor, or the link component's element) in link mode (withhrefand not disabled), so nobody expects button-only APIs on it.Change
Button.doc.mjs: arefentry that leads with the link-mode case, so the first sentence the CLI prints carries it. The rest of the file is unchanged.Button.spec.mdFR17: an implementation-gap line ("in link mode (FR11), the ref receives the link element (the anchor, or the link component's element) while the type namesHTMLButtonElement"). The FR17 verification row names the type test.Button.public.test.ts:ButtonProps['ref']isReact.Ref<HTMLButtonElement> | undefined.[docs]patch for@astryxdesign/core.Authority
Button FR11 and FR17 already say the ref reaches the rendered root, so the runtime is correct and only the type under-describes it. Widening the type, or splitting it on
href, would make valid callers change source (AST-017 FR1), so that stays a separate decision.Evidence
expectTypeOftest), eslint,check:knowledgeandcheck:changesetsare clean at main be7f821.Writing rubric results
Owner and land path