Skip to content

refactor: Addressed follow up for ListItem#1232

Open
brianacnguyen wants to merge 1 commit into
mainfrom
followup/listitem
Open

refactor: Addressed follow up for ListItem#1232
brianacnguyen wants to merge 1 commit into
mainfrom
followup/listitem

Conversation

@brianacnguyen

Copy link
Copy Markdown
Contributor

Description

Addresses review follow-ups from #1231 for the React Native ListItem / Content accessory refactor.

Why: The original refactor moved row shell accessories to ListItem and hardcoded gap={0} on the internal BoxRow, removing the previous 16px spacing. Review also called for a MIGRATION.md entry for the breaking prop removals and symmetric test coverage for endAccessory.

What changed:

  • accessoryGap prop — New ListItem prop (BoxSpacing, default 0) controls spacing between startAccessory / endAccessory and the inner Content row. Pass accessoryGap={4} to restore legacy 16px spacing.
  • MIGRATION.md — Added 0.29.0 → 0.30.0 entry documenting:
    • startAccessory / endAccessory moved from Content to ListItem
    • topAccessory / bottomAccessory removed; compose with BoxColumn instead
    • accessoryGap={4} note for restoring previous spacing
  • Tests — Added standalone endAccessory + avatar test (symmetric with existing startAccessory coverage)
  • Docs/stories — Documented accessoryGap in README; added AccessoryGap story and Storybook control; updated StartAccessory / EndAccessory stories to use accessoryGap={4}

Related issues

Follow-up to #1231

Fixes:

Manual testing steps

  1. Run React Native Storybook: yarn storybook:ios or yarn storybook:android
  2. ListItem
    • Verify StartAccessory, EndAccessory, and AccessoryGap stories
    • Compare AccessoryGap story rows — accessoryGap={0} vs accessoryGap={4} spacing should be visibly different
    • Toggle accessoryGap in Storybook controls on accessory stories
  3. Run tests:
    yarn workspace @metamask/design-system-react-native run jest src/components/ListItem/ListItem.test.tsx

Screenshots/Recordings

Before

ListItem hardcoded gap={0} between shell accessories and inner content with no way for consumers to adjust spacing.

After

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2026-06-12.at.15.03.50.mov

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.

@brianacnguyen brianacnguyen self-assigned this Jun 12, 2026
@brianacnguyen brianacnguyen requested a review from a team as a code owner June 12, 2026 22:06
@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@brianacnguyen brianacnguyen enabled auto-merge (squash) June 12, 2026 22:10
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.

1 participant