Skip to content

Add optional card list slots and tablet columns - #2905

Open
Marwan Elwaraki (melwaraki) wants to merge 10 commits into
mainfrom
codex/card-list-slots-tablet
Open

Marwan Elwaraki (melwaraki) wants to merge 10 commits into
mainfrom
codex/card-list-slots-tablet

Conversation

@melwaraki

@melwaraki Marwan Elwaraki (melwaraki) commented Nov 25, 2026 •

Copy link
Copy Markdown

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 / emptyContent slots and useTwoColumnsOnTablet = 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 original rememberSaveable expansion 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 expandedCount unset, 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 --check and 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 resolving org.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 in 3e6fd9a; 0e038c1 adds 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

@melwaraki Marwan Elwaraki (melwaraki) added the minor A new & backwards compatible feature/component label Nov 25, 2026
@Caoilinn
Caoilinn (Caoilinn) marked this pull request as ready for review November 26, 2026 16:37
Copilot AI lite review requested due to automatic review settings November 26, 2026 16:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 controlsContent and emptyContent slots to BpkStackCardList, shown full-width (including when list is empty).
  • Add useTwoColumnsOnTablet opt-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)
Copilot AI lite review requested due to automatic review settings November 26, 2026 16:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread .idea/deviceManager.xml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These shouldn't be here.

Comment thread .idea/GitLink.xml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These shouldn't be here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor A new & backwards compatible feature/component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants