Skip to content

refactor(button): share the shape morph between Button and IconButton - #5264

Open
lukewalczak wants to merge 5 commits into
mainfrom
refactor/shared-shape-morph
Open

lukewalczak wants to merge 5 commits into
mainfrom
refactor/shared-shape-morph

Conversation

@lukewalczak

@lukewalczak lukewalczak commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Motivation

Button and IconButton each built the corner morph themselves, and the copies had drifted: IconButton capped the spring curve for the outer corner, so on an outlined button the inner corner could overshoot below 0.

Both now use useShapeMorph from src/utils, which caps the curve against the inner corner and applies it to both corners. Button behaves as before. The ripple color helper moved to TouchableRipple/utils, so IconButton no longer imports from Button. Renamed: getButtonShapeCurvePoints → getShapeCurvePoints, getButtonRippleColor → getRippleColorFromContent.

Related issue

Follow-up to #5103.

Screenshots / Videos

No visual change except outlined IconButton, whose inner corner no longer overshoots. Checked on iOS and Android.

Test plan

Open the Button and IconButton examples on iOS and Android, pick outlined + extra-large, then press, release and toggle.

@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.

@apex-sentinel-staging

This comment has been minimized.

@Doberjohn
Doberjohn deleted the branch feat/refactor-icon-button-component November 20, 2026 14:49
@Doberjohn Doberjohn closed this Nov 20, 2026
@Doberjohn Doberjohn reopened this Nov 20, 2026
@Doberjohn
Doberjohn changed the base branch from feat/refactor-icon-button-component to main November 20, 2026 15:02
Move the corner morph into a shared useShapeMorph hook. IconButton now
caps the spring curve against the inner corner, as Button does, so the
inner corner of an outlined button can't overshoot below 0.
@Doberjohn
Doberjohn force-pushed the refactor/shared-shape-morph branch from e9e6e27 to 3dabed2 Compare November 20, 2026 15:02
@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: 1 new finding on 3dabed2. The verdict and the full list are in the summary comment.

Comment thread src/utils/useShapeMorph.ts Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

apex-sentinel-staging Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 616a2b0

Since the review of b0580cc: 0 new · 0 still open · 0 no longer raised

No open findings. 1 withdrawn by a re-check since this review.

Reviewed with this repository's own Sentinel configuration (059519962e02).

💬 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 616a2b0. The verdict and the full list are in the summary comment.

This branch has not been deployed

No deployments
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