Extract CardCarousel out of the four card carousels - #3063
Draft
StylianosGakis wants to merge 1 commit into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
a11y