Skip to content

Extract CardCarousel out of the four card carousels - #3063

Draft
StylianosGakis wants to merge 1 commit into
feature/home-quotes-carouselfrom
refactor/extract-card-carousel
Draft

Extract CardCarousel out of the four card carousels#3063
StylianosGakis wants to merge 1 commit into
feature/home-quotes-carouselfrom
refactor/extract-card-carousel

Conversation

@StylianosGakis

Copy link
Copy Markdown
Member

a11y

  • if these are UI changes - check for their accessibility

The claim status cards, the home notice cards, the home quote sessions
and the profile member reminders all laid out the same thing by hand: a
single card when there is one item, otherwise a HorizontalPager with the
same page spacing, viewport count, gesture exclusion and page indicator.

The copies had drifted. Only the member reminders passed stable page
keys and clamped the current page when the list shrank, so the other
three could leave a blank page behind after an item was removed while
its page was on screen. CardCarousel does both for every caller.

It lives next to HorizontalPagerIndicator, which it uses. The design
system is a closer conceptual fit, but it cannot depend on this module,
and Modifier.systemGestureExclusion is Android only.

Two behaviour details worth noting:

- Page keys stay opt-in, because two items resolving to the same key is
  an error in HorizontalPager. The quote sessions and member reminders
  pass one; the claim cards deliberately don't, since they merge several
  backend lists and could contain the same claim twice.
- MemberReminderCards passed its own `modifier` parameter down to each
  card as well as to its Column, so the caller's modifier was applied
  several times over. In the profile screen that duplicated an
  onConsumedWindowInsetsChanged callback. Each card now gets only the
  carousel's own page modifier.

MemberReminderCard no longer needs its ColumnScope receiver; it only
used it for the ColumnScope AnimatedVisibility overload, whose enter and
exit transitions it passes explicitly anyway.
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