Repository navigation
feat(text-input)!: rename TextInput.Icon size to iconSize - #5262
Conversation
|
Found potential problems with the pull request:
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on 71547a6. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
BREAKING CHANGE: TextInput.Icon's `size` is renamed `iconSize`, matching IconButton.
18e96e6 to
535f3ef
Compare
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
src/components/__tests__/TextInput.test.tsx:1851 |
🆕 "rejects the named size" test asserts nothing about size; only the @ts-expect-error works |
🔕 1 dismissed finding, not raised again
| Finding | Dismissed by | |
|---|---|---|
| 🟡 | Legacy numeric size on TextInput.Icon is forwarded to IconButton and throws in getDimensions |
@lukewalczak |
To raise one again, reply @apex-sentinel-staging note ... in its thread. It stays dismissed only if Sentinel's re-check withdraws it.
Reviewed with this repository's own Sentinel configuration (86b9988da395).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 535f3ef. The verdict and the full list are in the summary comment.
| await render( | ||
| <TextInput | ||
| label="Search" | ||
| value="" | ||
| startAccessory={(props) => ( | ||
| <TextInput.Icon | ||
| {...props} | ||
| icon="magnify" | ||
| // @ts-expect-error `size` is not a TextInput.Icon prop | ||
| size="small" | ||
| /> |
There was a problem hiding this comment.
🆕 🔵 Nit · "rejects the named size" test asserts nothing about size; only the @ts-expect-error works
The test named "rejects the named size on TextInput.Icon" proves the type rule solely through its @ts-expect-error comment; the render and getByLabelText('Search') assertion check the field, not the icon, and are inert scaffolding. Drop the render and the assertion, keeping the @ts-expect-error as a type-only block.
Suggested change
Keep the size rejection as a type-level assertion only; remove the render and the empty test body, or move the @ts-expect-error into an existing type-check fixture.
Details
persona: maintainability
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
Motivation
After #5103,
IconButton'ssizeis a named container scale andiconSizesizes the glyph.TextInput.Iconstill tooksizefor the glyph, so the same prop name meant two different things. This renames it toiconSize.It also adds the convention to
.github/instructions/code.instructions.md:sizesizes the whole component,iconSizeonly the icon glyph inside it. The other components already follow it.Stacked on #5103.
Related issue
None.
Screenshots / Videos
No visual change.
Test plan
Use
<TextInput.Icon icon="magnify" iconSize={32} />in astartAccessoryand check that the glyph is 32dp. Passingsizeis now a type error.BREAKING CHANGE: TextInput.Icon's
sizeis renamediconSize, matching IconButton.