Skip to content

fix: figma code connect mappings#1109

Merged
georgewrmarshall merged 1 commit into
mainfrom
codex/fix-figma-code-connect
Apr 29, 2026
Merged

fix: figma code connect mappings#1109
georgewrmarshall merged 1 commit into
mainfrom
codex/fix-figma-code-connect

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Description

This updates the Figma Code Connect configuration to point at the live 🦊 MMDS Components file instead of the deprecated WIP file and fixes a small set of stale prop mappings that no longer matched the current Figma component schemas.

The main fixes are:

  • repoint all affected .figma.tsx files and both figma.config.json files to 🦊 MMDS Components
  • migrate ButtonIcon to a single Figma variant axis (Default / Filled / Floating) and update React + React Native Code Connect to use that enum directly
  • remove the stale isReverse mapping from AvatarGroup
  • narrow the React Native TextButton mapping to the subset the current RN component actually supports
  • update Code Connect documentation links to the live file

Figma branch reference

Figma branch used for validation and direct component edits:

Direct Figma changes made for reference:

  • ButtonIcon (node-id=1:2860): migrated the component set from isInverse + isFloating variant properties to a single variant property with Default, Filled, and Floating
  • Text Button (node-id=1:398): renamed the component set from ButtonText to Text Button

Related issues

Fixes:

Manual testing steps

  1. Run yarn figma:connect:publish:dry-run
  2. Confirm React validation passes for all Code Connect files
  3. Confirm React Native validation passes for all Code Connect files
  4. Run yarn figma:connect:publish
  5. Open 🦊 MMDS Components in Figma Dev Mode and verify connected components show published React and React Native Code Connect docs

Screenshots/Recordings

Before

Not included. Validation was failing because several Code Connect mappings targeted stale file URLs or stale component properties.

After

Not included. yarn figma:connect:publish:dry-run passes for both React and React Native, and yarn figma:connect:publish successfully uploads both platforms to 🦊 MMDS Components.

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
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

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
Low risk: updates Code Connect configuration/docs and a few component prop mappings, with no runtime production logic changes beyond Figma snippet generation.

Overview
Repoints all Figma Code Connect URLs (docs, both figma.config.json files, and multiple .figma.tsx connectors) from the deprecated WIP file to the live 🦊 MMDS Components design file.

Refreshes a few stale prop mappings to match current component schemas: removes AvatarGroup’s isReverse mapping, updates ButtonIcon to use a single variant enum (Default/Filled/Floating), and narrows React Native TextButton mapping to the supported text-size variants (wiring it through variant).

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

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@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 prepared a fix for the issue found in the latest run.

  • ✅ Fixed: RN TextButton figma file imports removed TextButtonSize type
    • Updated RN TextButton Code Connect to remove undefined TextButtonSize and invalid props, mapping Figma size to TextVariant via variant and simplifying the example to match the text-only API.

Create PR

Or push these changes by commenting:

@cursor push 70cd03db96
Preview (70cd03db96)
diff --git a/packages/design-system-react-native/src/components/TextButton/TextButton.figma.tsx b/packages/design-system-react-native/src/components/TextButton/TextButton.figma.tsx
--- a/packages/design-system-react-native/src/components/TextButton/TextButton.figma.tsx
+++ b/packages/design-system-react-native/src/components/TextButton/TextButton.figma.tsx
@@ -1,14 +1,11 @@
 // import figma needs to remain as figma otherwise it breaks code connect
 // eslint-disable-next-line import-x/no-named-as-default
 import figma from '@figma/code-connect';
+import { TextVariant } from '@metamask/design-system-shared';
 import React from 'react';
 
-import { IconName } from '../Icon';
-
 import { TextButton } from './TextButton';
 
-import { TextButtonSize } from '.';
-
 /**
  * -- This file was auto-generated by Code Connect --
  * React Native implementation of TextButton component
@@ -23,38 +20,14 @@
   'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=1%3A398',
   {
     props: {
-      size: figma.enum('size', {
-        BodyMd: TextButtonSize.BodyMd,
-        BodySm: TextButtonSize.BodySm,
+      // Map Figma "size" variant to Text variant used by RN TextButton
+      variant: figma.enum('size', {
+        BodyMd: TextVariant.BodyMd,
+        BodySm: TextVariant.BodySm,
       }),
-      isDisabled: figma.boolean('isDisabled'),
-      isInverse: figma.boolean('isInverse'),
-      startIconName: figma.boolean('startIcon (Figma Only)', {
-        true: IconName.Add,
-        false: undefined,
-      }),
-      endIconName: figma.boolean('endIcon (Figma Only)', {
-        true: IconName.Add,
-        false: undefined,
-      }),
     },
-    example: ({
-      size,
-      isDisabled,
-      isInverse,
-      startIconName,
-      endIconName,
-      ...props
-    }) => (
-      <TextButton
-        size={size}
-        isDisabled={isDisabled}
-        isInverse={isInverse}
-        startIconName={startIconName}
-        endIconName={endIconName}
-        {...props}
-        onPress={() => undefined}
-      >
+    example: ({ variant, ...props }) => (
+      <TextButton variant={variant} {...props} onPress={() => undefined}>
         Text Button
       </TextButton>
     ),

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit ffeb383. Configure here.

@georgewrmarshall georgewrmarshall changed the title [codex] Fix figma code connect mappings fix: figma code connect mappings Apr 24, 2026
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-WIP--MMDS-Components?node-id=310%3A2005',
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=310%3A2005',
{
props: {

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.

Removing isReverse here matches the current published Figma AvatarGroup component, which no longer exposes an isReverse property in its variant set. @amandaye0h @brianacnguyen if reversed stacking is no longer supported on the design side, we should consider deprecating the code prop as follow-up.

'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-WIP--MMDS-Components?node-id=310%3A2005',
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=310%3A2005',
{
props: {

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.

Removing isReverse here matches the current published Figma AvatarGroup component, which no longer exposes an isReverse property in its variant set. @amandaye0h @brianacnguyen if reversed stacking is no longer supported on the design side, we should consider deprecating the code prop as follow-up.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@georgewrmarshall georgewrmarshall force-pushed the codex/fix-figma-code-connect branch from 35595ba to f1c61e2 Compare April 28, 2026 21:44
@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@georgewrmarshall georgewrmarshall marked this pull request as ready for review April 28, 2026 21:45
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner April 28, 2026 21:45
@georgewrmarshall georgewrmarshall enabled auto-merge (squash) April 28, 2026 21:46
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-WIP--MMDS-Components?node-id=1%3A398',
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=1%3A398',
{
props: {

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.

RN TextButton was intentionally simplified in an earlier breaking refactor, so this mapping only keeps the subset that still exists on the native component. We leave the broader React/Figma TextButton alignment for a follow-up instead of making RN Code Connect claim support for inverse, disabled, or icon props it no longer has.

figma.connect(
ButtonIcon,
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-WIP--MMDS-Components?node-id=1%3A2860',
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=1%3A2860',

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.

This points at the MMDS branch node where ButtonIcon was migrated from separate isInverse and isFloating properties to a single variant axis. We should merge that Figma branch change as well so the live component model stays aligned with the code mapping in this file.

figma.connect(
ButtonIcon,
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-WIP--MMDS-Components?node-id=1%3A2860',
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=1%3A2860',

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.

This points at the MMDS branch node where ButtonIcon was migrated from separate isInverse and isFloating properties to a single variant axis. We should merge that Figma branch change as well so the live component model stays aligned with the code mapping in this file.

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.

Makes sense, I am assuming this failure is expected and will be resolved once the branch is merged.

Screenshot 2026-04-29 at 6 16 21 PM

@georgewrmarshall georgewrmarshall merged commit a061939 into main Apr 29, 2026
44 checks passed
@georgewrmarshall georgewrmarshall deleted the codex/fix-figma-code-connect branch April 29, 2026 10:17
@georgewrmarshall georgewrmarshall mentioned this pull request Apr 30, 2026
18 tasks
georgewrmarshall added a commit that referenced this pull request Apr 30, 2026
## Release 37.0.0

This release focuses on consumer-facing changelog cleanup for the
packages being published, plus migration-guide coverage for the React
Native `TextField` API changes included in this release.

### 📦 Package Versions

- `@metamask/design-system-shared`: **0.15.0**
- `@metamask/design-system-react`: **0.20.0**
- `@metamask/design-system-react-native`: **0.22.0**

### 🔄 Shared Type Updates (0.15.0)

#### Shared type additions
([#1034](#1034),
[#1038](#1038),
[#1081](#1081))

**What Changed:**

- Added shared `ButtonBaseSize`, `ButtonSize`, `ButtonHeroSize`,
`ButtonVariant`, `ButtonBasePropsShared`, and `ButtonPropsShared`
- Added shared `ButtonIconSize`, `ButtonIconVariant`, and
`ButtonIconPropsShared`
- Added shared `TextFieldPropsShared` for the controlled text-field
contract used across platforms

**Impact:**

- Continues ADR-0003 and ADR-0004 migration toward shared const-object
plus string-union exports
- Gives React and React Native one shared source of truth for these
component contracts

### 🌐 React Web Updates (0.20.0)

#### Changed

- **BREAKING:** Updated `Button`, `ButtonBase`, and `ButtonHero` size
and variant exports to use shared const-object + string-union types
rather than platform-local enum-based definitions
([#1034](#1034))
- No migration required for typical usage; continue importing from
`@metamask/design-system-react` as before
- **BREAKING:** Updated `ButtonIconSize` and `ButtonIconVariant` to use
shared const-object + string-union types rather than platform-local
enum-based definitions
([#1038](#1038))
- No migration required for typical usage; continue importing from
`@metamask/design-system-react` as before
- Updated Figma Code Connect to the live `MMDS Components` file and
aligned `ButtonIcon` and `TextButton` mappings with the current
component APIs shown in Dev Mode
([#1109](#1109))
- Expanded the `TextButton` migration guide for extension consumers
replacing `ButtonLink` and `ButtonVariant.Link` with the current
design-system APIs
([#1098](#1098))

### 📱 React Native Updates (0.22.0)

#### Changed

- **BREAKING:** Updated `Button`, `ButtonBase`, and `ButtonHero` size
and variant exports to use shared const-object + string-union types
rather than platform-local enum-based definitions
([#1034](#1034))
- No migration required for typical usage; continue importing from
`@metamask/design-system-react-native` as before
- **BREAKING:** Updated `ButtonIconSize` and `ButtonIconVariant` to use
shared const-object + string-union types rather than platform-local
enum-based definitions
([#1038](#1038))
- No migration required for typical usage; continue importing from
`@metamask/design-system-react-native` as before
- **BREAKING:** `TextField` and `TextFieldSearch` now use a root
`Box`/`View`, require native `TextInput` props under `inputProps`,
rename `isReadonly` to `isReadOnly`, and use `inputRef` for the inner
input ref
([#1081](#1081))
- Updated Figma Code Connect to the live `MMDS Components` file and
aligned `ButtonIcon` and `TextButton` mappings with the current
component APIs shown in Dev Mode
([#1109](#1109))

### ⚠️ Breaking Changes

#### Shared button size and variant exports (Both Platforms)

**What Changed:**

- `ButtonVariant`, `ButtonBaseSize`, `ButtonSize`, `ButtonHeroSize`,
`ButtonIconSize`, and `ButtonIconVariant` now come from shared
ADR-0003/ADR-0004 definitions instead of platform-local enums
- Runtime values and standard imports remain stable for typical usage

**Impact:**

- Affects TypeScript consumers that depended on enum-specific behavior
rather than the exported members themselves

#### React Native TextField prop layering (React Native)

**What Changed:**

- `TextField` and `TextFieldSearch` now treat the root as a `Box`/`View`
- Native `TextInput` props must move under `inputProps`
- `isReadonly` is renamed to `isReadOnly`
- `ref` now targets the outer container and `inputRef` targets the inner
`TextInput`

**Migration:**

```tsx
// Before (0.21.0)
<TextField
  value={query}
  onChangeText={setQuery}
  placeholder="Search"
  keyboardType="default"
  secureTextEntry
  onFocus={handleFocus}
/>

// After (0.22.0)
<TextField
  value={query}
  onChangeText={setQuery}
  placeholder="Search"
  onFocus={handleFocus}
  inputProps={{
    keyboardType: 'default',
    secureTextEntry: true,
  }}
/>
```

**Impact:**

- Affects React Native consumers passing `TextInput` props or
pressable-only props at the top level of `TextField` / `TextFieldSearch`

See migration guides for complete instructions:

- [React Native Migration
Guide](./packages/design-system-react-native/MIGRATION.md#from-version-0210-to-0220)

### ✅ Checklist

- [x] Changelogs updated with human-readable descriptions
- [x] Changelog validation passed (`yarn changelog:validate`)
- [x] Version bumps follow semantic versioning
- [x] design-system-shared: minor (`0.14.0` → `0.15.0`) - shared type
additions
- [x] design-system-react: minor (`0.19.0` → `0.20.0`) - includes
breaking changes under pre-1.0 semver
- [x] design-system-react-native: minor (`0.21.0` → `0.22.0`) - includes
breaking changes under pre-1.0 semver
- [x] Breaking changes documented with migration guidance where needed
- [x] Migration guides updated with before/after examples for the React
Native `TextField` changes
- [x] PR references included in changelog entries

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [x] I've reviewed the [Release
Workflow](./.cursor/rules/release-workflow.md) cursor rule
- [ ] All tests pass (`yarn build && yarn test && yarn lint`)
- [x] Changelog validation passes (`yarn changelog:validate`)

## **Pre-merge reviewer checklist**

- [ ] I've reviewed the [Reviewing Release
PRs](./docs/reviewing-release-prs.md) guide
- [ ] Package versions follow semantic versioning
- [ ] Changelog entries are consumer-facing (not commit message
regurgitation)
- [ ] Breaking changes are documented in MIGRATION.md where migration
guidance is required
- [ ] All unreleased changes are accounted for in changelogs

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Release-only change: bumps package versions and updates
changelog/migration documentation without modifying runtime code. Low
risk aside from potential downstream confusion if documented breaking
changes don’t match what was actually published.
> 
> **Overview**
> Bumps the monorepo release to `37.0.0` and increments package versions
for `@metamask/design-system-shared` (`0.15.0`),
`@metamask/design-system-react` (`0.20.0`), and
`@metamask/design-system-react-native` (`0.22.0`).
> 
> Updates consumer-facing release notes: adds new changelog entries
(including documented *breaking* type-export contract changes and RN
`TextField` API migration details), refreshes the RN migration guide
section for `0.21.0` → `0.22.0`, and updates changelog compare links
accordingly.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2140b12. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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