Skip to content

feat(text-input)!: rename TextInput.Icon size to iconSize - #5262

Merged
Doberjohn merged 3 commits into
mainfrom
feat/text-input-icon-icon-size
Nov 20, 2026
Merged

Doberjohn merged 3 commits into
mainfrom
feat/text-input-icon-icon-size

Conversation

@lukewalczak

@lukewalczak lukewalczak commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Motivation

After #5103, IconButton's size is a named container scale and iconSize sizes the glyph. TextInput.Icon still took size for the glyph, so the same prop name meant two different things. This renames it to iconSize.

It also adds the convention to .github/instructions/code.instructions.md: size sizes the whole component, iconSize only 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 a startAccessory and check that the glyph is 32dp. Passing size is now a type error.

BREAKING CHANGE: TextInput.Icon's size is renamed iconSize, matching IconButton.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Found potential problems with the pull request:

  • Screenshot or video evidence is missing. Make sure to include one if it affects the UI.

@lukewalczak
lukewalczak added this pull request to stack #5263 November 20, 2026 09:48
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 2 new findings on 71547a6. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

This comment has been minimized.

Base automatically changed from feat/refactor-icon-button-component to main November 20, 2026 14:32
@Doberjohn
Doberjohn force-pushed the feat/text-input-icon-icon-size branch from 18e96e6 to 535f3ef Compare November 20, 2026 14:32
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 535f3ef

Since the review of 18e96e6: 1 new · 0 still open · 0 no longer raised

1 finding(s): 1 nit.

🔵 Nit (1)
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.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 535f3ef. The verdict and the full list are in the summary comment.

Comment on lines +1851 to +1861
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"
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆕 🔵 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.

@Doberjohn
Doberjohn merged commit ef1e41c into main Nov 20, 2026
14 checks passed
@Doberjohn
Doberjohn deleted the feat/text-input-icon-icon-size branch November 20, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants