Repository navigation
Add optional card list slots and tablet columns - #2905
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
2 files not reviewed
.idea/GitLink.xml: Generated file.idea/deviceManager.xml: Generated file
What changed in this PR
Adds optional full-width slots for stack card lists and an opt-in two-column tablet layout, while preserving expansion state across empty/filtered transitions.
Changes:
- Add optional
controlsContentandemptyContentslots toBpkStackCardList, shown full-width (including when list is empty). - Add
useTwoColumnsOnTabletopt-in that renders cards in two equal columns on tablet-width windows for both lazy and embedded modes. - Add/extend Robolectric snapshot + adaptive behavior tests and update demo + documentation.
| File | Description |
|---|---|
| docs/compose/CardList/README.md | Documents new slots and tablet column behavior and adds screenshots/example usage. |
| backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/cardlist/stack/internal/BpkStackCardListImpl.kt | Implements optional slots, empty behavior, and 2-column rendering for both Column/LazyColumn paths. |
| backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/cardlist/stack/BpkStackCardList.kt | Exposes new public API parameters and documents behavior. |
| app/src/test/java/net/skyscanner/backpack/compose/cardlist/stack/BpkStackCardListTest.kt | Adds snapshot coverage for new slots and tablet two-column mode. |
| app/src/test/java/net/skyscanner/backpack/compose/cardlist/stack/BpkStackCardListAdaptiveTest.kt | Adds parameterized adaptive tests for width threshold, empty/resize transitions, and typography scaling. |
| app/src/main/res/values/strings.xml | Adds demo/test strings for chips and empty state CTA. |
| app/src/main/java/net/skyscanner/backpack/demo/compose/CardListStory.kt | Adds an interactive demo story showcasing chips + empty state + adaptive columns. |
Review effort: Lite
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
2 files not reviewed
.idea/GitLink.xml: Generated file.idea/deviceManager.xml: Generated file
Review effort: Lite
…s and add contentPadding Co-authored-by: OpenCode <noreply@opencode.ai>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
Review effort: Lite
| /** | ||
| * A stack of cards with optional full-width content below its section header and when empty. | ||
| * | ||
| * @param useTwoColumnsWhenWide When true, uses two equal-width columns when wide. On Android, "wide" | ||
| * means the current window is wider than the Backpack tablet breakpoint (769 dp). This is measured on | ||
| * the whole window, not on the space available to the list. Defaults to false. Counts refer to cards, | ||
| * not rows; odd counts are not rounded. | ||
| * @param contentPadding Padding around the list's content. Defaults to none. Its horizontal part is | ||
| * not applied to [controlsContent], so scrolling controls such as a chip rail can scroll to the | ||
| * list's edges. Use this instead of padding [modifier] when [controlsContent] scrolls horizontally. | ||
| * @param controlsContent Optional content below the section header, including when there are no cards. | ||
| * Null adds no spacing. It extends through the horizontal [contentPadding], so supply your own inset, | ||
| * e.g. `BpkSingleSelectChipGroup(contentPadding = PaddingValues(horizontal = BpkSpacing.Base))`. | ||
| * The caller owns any state inside this slot, such as chip selection. | ||
| * @param emptyContent Optional content shown instead of cards/accessories when [totalCount] is zero. | ||
| * Null preserves the existing empty appearance. Expansion state survives an empty list. | ||
| */ |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
1 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
Review effort: Lite
| accessibilityHeaderTagEnabled: Boolean? = true, | ||
| isInScrollableContainer: Boolean = false, | ||
| content: @Composable ((Int) -> Unit), | ||
| useTwoColumnsWhenWide: Boolean = false, |
There was a problem hiding this comment.
Could we retain an overload with the original parameter order? Adding defaulted parameters before content breaks callers that passed the content lambda as the ninth positional argument:
BpkStackCardList(
"Destinations", 1, Modifier, null, null, null, true, true,
{ index -> BpkText("Card $index") },
)I ran this as a compile fixture with :app:compileOssDebugUnitTestKotlin on this head. It fails with Boolean was expected and No value passed for parameter 'content'. This call matches the previous public signature.
The existing Recent Searches consumer uses named arguments and a trailing lambda; its local snapshot build and all 143 module tests passed. This is a public source-compatibility concern rather than a demonstrated app failure. Keeping the original overload delegating to the extended implementation, plus this compile fixture, would preserve that call form.
There was a problem hiding this comment.
Yes, I did think of this earlier but the only caller of BpkStackCardList currently in the codebase is RecentSearch, and it passes through everything as a named parameter so it won't break. Rather than having two APIs, and needing to support both, I thought that only having the one would be simpler. Is backpack still public? Because if so and some codebases are using it then 100% we need to not introduce a breaking contract change, but otherwise what is the general approach here; do we ideally want to have two contracts or decommission one eventually (from what I can tell as far as the Skyscanner android codebase goes we can do that now)?
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
Review effort: Lite
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
Review effort: Lite

Card lists can now retain their header controls and expansion state while a filtered list is empty, and opt into two equal-width columns when wide.
Adds independently optional
controlsContent/emptyContentslots,useTwoColumnsWhenWide = falseandcontentPadding(defaults to none). On Android, "wide" means the current window is wider than 769 dp (the Backpack tablet breakpoint, viaisTablet()), measured on the whole window, including live resize/fold changes. This matches iOS'suseTwoColumnsWhenWide.isInScrollableContainer = true) variants use a single layout for one and two columns (LazyVerticalGridand a small internalLayoutrespectively), so each card's state is kept when the column count changes.controlsContentextends through the horizontalcontentPadding, so a chip rail can scroll to the list's edges; callers supply the inset inside the controls (e.g. the chip group'scontentPadding). This matches the iOS controls slot.rememberSaveableexpansion owner and count calculation are preserved.ExpandableColumnandExpandableLazyColumnare now private; they were previously public, but nothing outside the component uses them.This is the Android Backpack part of Recent Searches v2 (TASK-004). TASK-003 count hardening is explicitly excluded. The app will cap its selected list, pass its actual size, leave
expandedCountunset, and omit the accessory when all cards fit. App dependency updates follow a Backpack release separately.Validation:
Parameterized component/snapshot tests for both variants: crossing the 769 dp breakpoint, default/false opt-in, odd/single cards, independent slots, expansion across empty/resize transitions, card state across column changes, controls extending through
contentPadding, and 200% text scaling.Screenshot test for an edge-to-edge scrolling chip rail.
Interactive chip/empty-state demo and API/README documentation.
Read the contributing guidelines
Component README
Tests added
Full Android checks and generated screenshots reviewed