Skip to content

feat: migrate BadgeIcon to ADR-0004 shared types (DSYS-479)#1010

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/enum-shared-type-migration-5ff7
Draft

feat: migrate BadgeIcon to ADR-0004 shared types (DSYS-479)#1010
cursor[bot] wants to merge 1 commit intomainfrom
cursor/enum-shared-type-migration-5ff7

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor bot commented Mar 29, 2026

Description

This PR migrates the BadgeIcon component to follow ADR-0004 (Centralized Types Architecture) by creating a shared BadgeIconPropsShared type in @metamask/design-system-shared and updating both React and React Native platform packages to extend it.

What changed:

  • Created packages/design-system-shared/src/types/BadgeIcon/BadgeIcon.types.ts with BadgeIconPropsShared (platform-independent iconName: string prop)
  • Added packages/design-system-shared/src/types/BadgeIcon/index.ts and exported from shared package index
  • Updated packages/design-system-react/src/components/BadgeIcon/BadgeIcon.types.ts to import and extend BadgeIconPropsShared, narrowing iconName to the platform-specific IconName enum
  • Updated packages/design-system-react-native/src/components/BadgeIcon/BadgeIcon.types.ts to import and extend BadgeIconPropsShared, narrowing iconName to the platform-specific IconName enum

This is a non-breaking internal refactor — the component APIs remain identical to consumers.

Related issues

Fixes: DSYS-479

Manual testing steps

  1. Run yarn build — should complete without errors
  2. Run yarn test — all tests should pass with 100% coverage
  3. Run yarn lint — should pass with no issues

Screenshots/Recordings

N/A — internal type refactor with no visual changes.

Before

BadgeIconProps defined independently in each platform package with no shared base type.

After

BadgeIconPropsShared defined once in @metamask/design-system-shared; both platform packages extend it.

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.
Open in Web View Automation 

- Create BadgeIconPropsShared in packages/design-system-shared
- Export from shared package index
- Update React package BadgeIcon.types.ts to extend shared props
- Update React Native package BadgeIcon.types.ts to extend shared props

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@georgewrmarshall georgewrmarshall self-assigned this Mar 30, 2026
georgewrmarshall added a commit that referenced this pull request Apr 7, 2026
…ignment (#994)

## **Description**

### Why

Cursor Automations are configured in the Cursor product UI and are
**not** version-controlled in git. We need an in-repo **canonical spec**
for the DSYS-468 / ADR-0003–0004 internal migration workflow (Jira
pickup, which rules to follow, verification, PR expectations) so it can
be reviewed in PRs and linked or copy-pasted into **Private** or **Team
Visible** automations.

### What changed

- **Added** `.cursor/automations/enum-shared-type-migration.md` — JQL
(interactive vs scheduled unassigned backlog), Jira pickup steps, Cursor
Cloud Automation notes (billing/identity, tools), implementation
pointers to `CLAUDE.md` and Layer 2 rules
(`component-enum-union-migration`, etc.), verification (`yarn build`,
`yarn test`, `yarn lint`), and a **paste-ready** cloud prompt.
- **Updated** `docs/ai-agents.md` — **Cursor Cloud Automations**
subsection aligned with repo agent principles (*reference over
duplication*, checklists, context efficiency, verification) and explicit
note that **`.cursor/automations/`** is the VCS source of truth because
the Automations UI has no native version control.
- **Removed** unrelated migration tracking artifacts from this branch:
`.cursor/rules/component-migration-tracking.md`,
`.cursor/rules/enum-shared-type-migration.mdc`, and docs
`component-migration-project.md`, `extension-migration-tracker.md`,
`jira-ticket-creation.md`, `mobile-migration-tracker.md`. Automation is
invoked via `@.cursor/automations/enum-shared-type-migration.md` only
(no companion `.mdc` rule).
- **Chore** — Prettier on touched markdown where required by hooks.

### Linking specs from Cursor Automations (for reviewers)

There is **no official Cursor documentation** that guarantees a cloud
agent will **fetch and follow** an arbitrary GitHub blob URL.
**Recommended:** configure the automation with a **repository + branch**
that contains this file, and instruct the agent to read
**`.cursor/automations/enum-shared-type-migration.md` in the
workspace**. A **GitHub link** (especially `raw.githubusercontent.com`
or a **pinned commit**) is still useful for humans, pinning a frozen
spec, or external tooling—but treat it as **supplementary** to the
checked-out file.

## **Related issues**

Fixes: (none — contributor workflow / tooling only)

## **Manual testing steps**

1. On this branch, open
`.cursor/automations/enum-shared-type-migration.md` and confirm
structure, JQL blocks, and links render as expected.
2. In Cursor Chat, `@`-mention
`.cursor/automations/enum-shared-type-migration.md` and confirm the
agent is directed to `docs/ai-agents.md` and the listed
`@.cursor/rules/*.md` files for implementation (not
`component-migration.md` for this epic).
3. Confirm no remaining references to deleted paths (e.g.
`component-migration-tracking`, removed tracker docs) via repo search.
4. (Optional) Create or edit a **Private** test automation: paste the
**cloud prompt** snippet from the automation doc and run against a
branch that includes this file; confirm the agent can see
`.cursor/automations/enum-shared-type-migration.md` on disk.

## **Example PRs**

PRs that have been successfully created with this automation

- #996
- #1009
- #1010
- #1015

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable (N/A — docs only)
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable (N/A)
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: documentation-only changes that add guidance for Cursor
Automations and do not affect runtime code paths.
> 
> **Overview**
> Adds a version-controlled Cursor Automation spec at
`.cursor/automations/enum-shared-type-migration.md` that defines the
DSYS-468 Jira pickup workflow (JQL for interactive vs scheduled runs),
required tools/identity notes, which `.cursor/rules/` to follow for the
migration, and a paste-ready automation prompt (plus post-merge
Jira-closing guidance).
> 
> Updates `docs/ai-agents.md` to explicitly document how Cursor Cloud
Automations should follow the repo’s agent principles (*reference over
duplication*, checklists, verification) and to treat
`.cursor/automations/` as the canonical, reviewable source of truth for
automation prompts.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2594fa9. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
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