Repository navigation
Add optional card list slots and tablet columns - #2905
Marwan Elwaraki (melwaraki) wants to merge 10 commits into
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
| val first = boundsOf("card-0") | ||
| val second = boundsOf("card-1") | ||
| val header = boundsOf("header") | ||
| assertTrue(header.width > first.width + second.width) |
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
There was a problem hiding this comment.
These shouldn't be here.
There was a problem hiding this comment.
These shouldn't be here.

Card lists can now retain their header controls and expansion state while a filtered list is empty, and opt into two equal-width columns on wider windows.
Adds independently optional
headerContent/emptyContentslots anduseTwoColumnsOnTablet = false. Opted-in lists use two columns at current-window width >= 600 dp, including live resize/fold changes. Both embedded and lazy paths retain full-width slots/accessories and card-based indices. The existing overload and public renderer signatures remain available; the originalrememberSaveableexpansion owner and count calculation are preserved.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:
Added parameterized component/snapshot tests for both scrolling modes: 599/600/601 dp, default/false opt-in, odd/single cards, independent slots, expansion across empty/resize transitions, the original positional API, and 200% text scaling.
Added an interactive chip/empty-state demo and API/README documentation.
git diff --checkand standalone Detekt core rules passed.Local full compilation/tests and Detekt plugin checks are blocked before source compilation: this environment cannot establish TLS connections to
plugins.gradle.org/ Maven Central. Gradle fails resolvingorg.gradle.kotlin.kotlin-dsl:6.7.13. A temporary JDK 17 was used; the machine also lacks an Android SDK. The first CI run compiled the component and demo and passed Detekt, then found two invalid test imports. Those imports are removed in3e6fd9a;0e038c1adds 200% text-scale coverage. The latest CI run is validating those corrections; full tests, lint and screenshot review are still pending.Read the contributing guidelines
Component README
Tests added
Full Android checks and generated screenshots reviewed