Skip to content

feat!: modernize List-related components to the latest MD3 specs - #5224

Merged
Doberjohn merged 31 commits into
callstack:mainfrom
jacekAtCK:feat/modernize-list-md3
Nov 29, 2026
Merged

Doberjohn merged 31 commits into
callstack:mainfrom
jacekAtCK:feat/modernize-list-md3

Conversation

@jacekAtCK

@jacekAtCK jacekAtCK commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Takes over #5143. Brings List.Item and List.Accordion in line with the MD3 list spec: tokens, spacing and typography, selected state, animated accordion, and leading and trailing slots on List.Item. left and right on List.Item are deprecated.

Related issue

Closes #4976
Part of #4930

Screenshots / Videos

List.Accordion on Android
list-accordion.mp4

Test plan

In the List example:

  1. Compare rows against the spec.
  2. Expand and collapse an accordion. Rows below move with it.
  3. A selected row uses the secondary container colors.

@Doberjohn Doberjohn assigned Doberjohn and jacekAtCK and unassigned Doberjohn Nov 16, 2026
@Doberjohn Doberjohn added this to the 6.0.0-beta.0 milestone Nov 16, 2026
@jacekAtCK jacekAtCK changed the title feat: modernize List-related components to the latest MD3 specs feat!: modernize List-related components to the latest MD3 specs Nov 16, 2026
@Doberjohn
Doberjohn self-requested a review November 17, 2026 18:52
@Doberjohn

Copy link
Copy Markdown
Collaborator

/review

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 3 new findings on cd9dfe1. The verdict and the full list are in the summary comment.

Comment thread src/components/List/ListAccordion.tsx Resolved
Comment thread src/components/List/ListAccordion.tsx Resolved
Comment thread src/components/List/ListItem.tsx Resolved
@apex-sentinel-staging

This comment has been minimized.

Comment thread src/components/List/ListItem.tsx Resolved
Comment thread src/components/List/utils.ts Resolved
Comment thread src/components/List/ListAccordion.tsx Resolved
Comment thread src/components/List/ListItem.tsx Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on 70280c9. The verdict and the full list are in the summary comment.

Comment thread src/components/List/ListItem.tsx Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on f68bc28. The verdict and the full list are in the summary comment.

Comment thread src/components/List/utils.ts Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

A pressable List.Item now defaults to role="button". React Native gives
`role` precedence over `accessibilityRole`, so the default hid a role
that a caller set with `accessibilityRole`, such as "checkbox" on a
selectable row, and screen readers announced a button instead. The
default now applies only when the caller sets neither, and the selected
state on web follows the caller's `accessibilityRole` too.
The row detects a wrapped description with onTextLayout, which React
Native Web doesn't support, so on web a three-line row keeps 8dp of
vertical padding and is 80dp tall.
The chevron's CSS transition keeps its duration, easing and reduce
motion handling, now built with the getTransition helper that Badge,
Checkbox and TextInput use since callstack#5112.
@apex-sentinel-staging

This comment has been minimized.

@Doberjohn

Copy link
Copy Markdown
Collaborator

Since this one's in our hands, I pushed a few small things on top:

  • b520d37 keeps a caller's accessibilityRole on a pressable List.Item. React Native gives role precedence over accessibilityRole, so the new default role="button" hid it, and <List.Item onPress={toggle} accessibilityRole="checkbox" /> was announced as a button. The default now applies only when neither is set, with two tests.
  • A merge of main, then 58cdbe9 notes in the migration guide that the 88dp three-line height is Android and iOS only for now (react-native-web has no onTextLayout), and 3c0e9d3 builds the chevron transition with getTransition from feat(motion): adopt spring tokens and add shared CSS-transition helper #5112, with the same values.

Everything else from the last round looks good to me. CI is green on the new head, so I'll merge after a last check on devices.

When a fully expanded List.Accordion started to collapse, its content
disappeared for one or two frames on Android and web, and the rows
below jumped up before the collapse animated. The content left the
layout flow in the React commit, but the wrapper's height only changed
from `auto` to a number when Reanimated applied it a frame later, so
the wrapper shrank to nothing for that frame. The content now leaves
and rejoins the flow through an animated style, in the same frame as
the height changes.
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 7d3b1cc

Since the review of 3c0e9d3: 0 new · 0 still open · 0 no longer raised

No open findings.

Not in the reviewers' scope (4 files)
  • src/components/__tests__/__snapshots__/ListAccordion.test.tsx.snap: generated or a lockfile, so its lines were left out
  • src/components/__tests__/__snapshots__/ListImage.test.tsx.snap: generated or a lockfile, so its lines were left out
  • src/components/__tests__/__snapshots__/ListItem.test.tsx.snap: generated or a lockfile, so its lines were left out
  • src/components/__tests__/__snapshots__/ListSection.test.tsx.snap: generated or a lockfile, so its lines were left out

1 finding below minor hidden (user_settings.min_severity).

1 new finding away from what changed since 3c0e9d3 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (7fc418c5e598).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@Doberjohn

Doberjohn commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

The last check on devices turned up one thing: when a fully expanded accordion started to collapse, its content disappeared for a frame or two on Android and web, and the rows below jumped up before the collapse animated. The content left the layout flow in the React commit, but the wrapper's height only switched from auto to a number when Reanimated applied it a frame later.

7d3b1cc switches the content's position through useAnimatedStyle instead, so it changes in the same frame as the height. The content still leaves the flow while it animates, since Yoga caps an in-flow child at its parent's height and it couldn't measure its full height otherwise. I checked it frame by frame on an Android emulator, the iOS simulator and Chromium: expand, collapse, an expand interrupted halfway and reduce motion are all smooth now.

@Doberjohn
Doberjohn merged commit ebe1913 into callstack:main Nov 29, 2026
11 checks passed
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.

feat: modernize List related components to the latest MD3 specs

6 participants