Skip to content

chore: Add Code Connect for HeaderBase - #1484

Closed
andrewjcohen wants to merge 3 commits into
mainfrom
code-connect/header-base
Closed

andrewjcohen wants to merge 3 commits into
mainfrom
code-connect/header-base

Conversation

@andrewjcohen

@andrewjcohen andrewjcohen commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds Figma Code Connect mappings for HeaderBase on both platforms, pointing at the
refactor -- Header Figma component (node 19284-754).

HeaderBase.figma.tsx

New HeaderBase.figma.tsx for React and HeaderBase.figma.tsx for React Native.

Matched props

  • title (TEXT) → children
  • subtitle (TEXT) → composed into children (HeaderBase has no subtitle prop)
  • startAccessory (SLOT) → startAccessory (via figma.slot('startAccessory').connectedInstances)
  • endAccessory (SLOT) → endAccessory (via figma.slot('endAccessory').connectedInstances)

Two figma.connect variants switch the snippet when hasSubtitle (Figma only) is toggled, so the examples stay pure JSX with no conditionals. Off matches Storybook Default (title only). On composes title as TextVariant.HeadingSm and subtitle as TextVariant.BodySm / TextColor.TextAlternative. Nested ButtonIcon instances in the accessory slots surface when those nested components are published.

Intentionally omits Figma-only properties: hasSubtitle (Figma only) (used only as a variant selector)

Intentionally omits code-only props: className, twClassName, style,
childrenWrapperProps, startAccessoryWrapperProps, endAccessoryWrapperProps, and
(React Native only) startButtonIconProps, endButtonIconProps, includesTopInset,
textProps. Figma models the accessories as slots rather than an icon-props shorthand, and
the wrapper props are implementation hooks with no design equivalent.

Related issues

Manual testing steps

  • Open HeaderBase in Figma Dev Mode and confirm both React and React Native snippets appear
  • Edit the title text property and verify the snippet's title updates
  • Toggle hasSubtitle (Figma only) on and confirm the snippet adds a BodySm / TextAlternative subtitle under the title
  • Toggle it off and confirm the subtitle leaves the snippet
  • Drop a code-connected ButtonIcon into startAccessory / endAccessory and verify the snippet picks up the instances
  • Clear both slots and confirm the accessory props drop out of the snippet
  • Confirm the snippet is plain JSX (no function body or inline conditionals)

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.

Note

Low Risk
Adds design-time Code Connect files only; no changes to HeaderBase runtime behavior or app logic.

Overview
Adds Figma Code Connect for HeaderBase in both design-system-react and design-system-react-native, wired to the refactor Header component (node 19284-754).

Each package gets a new HeaderBase.figma.tsx with two figma.connect variants keyed on hasSubtitle (Figma only) so Dev Mode snippets stay unconditional JSX. Title maps to children; start/end accessory slots use connectedInstances. When the subtitle toggle is on, the example composes heading + body Text children because the component has no subtitle prop. The React Native title-only variant passes the title as a string child (Storybook default); the web title-only variant still wraps the title in TextVariant.HeadingSm. Code-only props (styling, wrappers, RN icon/inset helpers) are intentionally omitted from the mappings.

Reviewed by Cursor Bugbot for commit a2332a1. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Sep 2, 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)

@github-actions

github-actions Bot commented Sep 2, 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)

@andrewjcohen
andrewjcohen marked this pull request as ready for review September 3, 2026 20:08
@andrewjcohen
andrewjcohen requested a review from a team as a code owner September 3, 2026 20:08
@andrewjcohen
andrewjcohen deleted the code-connect/header-base branch September 3, 2026 20:09
@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)

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.

1 participant