Skip to content

chore: Add Code Connect for SelectButton - #1487

Merged
andrewjcohen merged 2 commits into
mainfrom
code-connect/select-button
Sep 4, 2026
Merged

andrewjcohen merged 2 commits into
mainfrom
code-connect/select-button

Conversation

@andrewjcohen

@andrewjcohen andrewjcohen commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds Figma Code Connect mappings for React Native.

SelectButton.figma.tsx

New SelectButton.figma.tsx for React Native

Matched props

  • variant → variant
  • size → size
  • isDisabled → isDisabled (true when disabled; omitted when false)
  • label (nested ButtonBase) → placeholder (via figma.nestedProps())

Intentionally omits Figma-only properties: startIcon (Figma Only), endIcon (Figma Only), hasAvatar (Figma Only), hasBadge (Figma Only)

SelectButton exists only in @metamask/design-system-react-native, so no React web mapping was added.

The snippet matches Storybook Default usage: placeholder, variant, size, endArrowDirection={SelectButtonEndArrow.Down}, isDisabled, and onPress={() => undefined}.

Related issues

Manual testing steps

  • Open SelectButton in Figma Dev Mode and confirm the React Native snippet appears
  • Toggle key Figma variants (size, variant, isDisabled) and verify the snippet updates
  • Confirm matched props render correctly in the example snippet

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Made with Cursor

@andrewjcohen
andrewjcohen marked this pull request as ready for review September 3, 2026 21:29
@andrewjcohen
andrewjcohen requested a review from a team as a code owner September 3, 2026 21:29
@andrewjcohen
andrewjcohen enabled auto-merge (squash) September 3, 2026 21:29
@andrewjcohen andrewjcohen self-assigned this Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📖 Storybook Links

Compare the preview for this pull request with the latest Storybooks from the main branch.

🔀 Pull Request Preview

🌳 Main Branch (Latest)

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7517e34. Configure here.

isDisabled: figma.enum('isDisabled', {
true: true,
false: undefined,
}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Disabled mapped with enum helper

Medium Severity

isDisabled is mapped with figma.enum even though it is a boolean property. Other button Code Connect files bind this with figma.boolean, including when false is omitted from the snippet. Using figma.enum can leave the Figma snippet out of sync when the disabled state is toggled.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7517e34. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unable to do boolean to buttons due to structure of buttonbase and apperance within figma

@andrewjcohen
andrewjcohen merged commit c6e24ef into main Sep 4, 2026
33 checks passed
@andrewjcohen
andrewjcohen deleted the code-connect/select-button branch September 4, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants