Skip to content

[MUON-1865] Rename BpkGraphicPromo image param to background#2743

Merged
Henrik Sym (henrik-sky) merged 3 commits into
mainfrom
muon-1865-bpkgraphicpromo_api_bkg
Jul 16, 2026
Merged

[MUON-1865] Rename BpkGraphicPromo image param to background#2743
Henrik Sym (henrik-sky) merged 3 commits into
mainfrom
muon-1865-bpkgraphicpromo_api_bkg

Conversation

@antonicg

@antonicg Antoni Castejón (antonicg) commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Renames BpkGraphicPromo's image: @Composable BoxScope.() -> Unit parameter to background. The parameter already accepted any composable, so it was never actually limited to images the way iOS's BPKGraphicPromo was prior to backpack-ios#2593 — this rename aligns naming with iOS's Background: View generic and makes it explicit that the slot supports BpkVideoPlayer (backpack-ios#2606 on iOS, BpkVideoPlayer from muon-1847-bpkvideo on Android).
  • Adds a new demo story (GraphicPromoStorySponsoredWithVideoBackground) showing a sponsored BpkGraphicPromo using BpkVideoPlayer as its background, mirroring iOS's example app use case from OGM-4200: Fix BpkCellItem vertical padding #2606.
  • Updates docs/compose/GraphicPromo/README.md with the renamed parameter and a new "Sponsored with a video background" section.

Breaking change

BpkGraphicPromo's image parameter is renamed to background. Kotlin doesn't support two overloads that differ only by parameter name with identical types, so there's no backward-compatible way to keep image working — existing callers need a one-line rename (image = { ... }background = { ... }).

Base branch

Stacked on top of muon-1847-bpkvideo (not yet merged) since it uses BpkVideoPlayer in the new demo story. Do not merge before muon-1847-bpkvideo.

Test plan

  • :backpack-compose:compileDebugKotlin, :app:compileOssDebugKotlin compile cleanly
  • :backpack-compose:compileDebugAndroidTestKotlin, :app:compileOssDebugUnitTestKotlin compile cleanly
  • Manually verify the new "Sponsored with video background" story in the demo app

🤖 Generated with Claude Code

@antonicg Antoni Castejón (antonicg) added the major A breaking API change label Jul 13, 2026
Base automatically changed from muon-1847-bpkvideo to main July 15, 2026 11:55
The image parameter already accepted any composable content, so it
was never limited to images the way iOS's BPKGraphicPromo was before
backpack-ios#2593. Renaming to background aligns naming with iOS and
makes it clear the slot can host BpkVideoPlayer, not just Image.

Adds a demo story showing a sponsored GraphicPromo with a video
background.

Breaking: BpkGraphicPromo's image parameter is renamed to background.
Replace the full duplicated example with a minimal snippet showing
background works with either Image or BpkVideoPlayer.
@antonicg
Antoni Castejón (antonicg) force-pushed the muon-1865-bpkgraphicpromo_api_bkg branch from 73bf034 to c3e73a9 Compare July 15, 2026 14:06
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

Generated by 🚫 Danger Kotlin against c3e73a9

@antonicg
Antoni Castejón (antonicg) marked this pull request as ready for review July 16, 2026 08:29
Copilot AI review requested due to automatic review settings July 16, 2026 08:29
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

Generated by 🚫 Danger Kotlin against c3e73a9

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but the docs screenshots weren't updated. If the changes are visual or it is a new component please regenerate the screenshots via ./gradlew recordScreenshots.

Generated by 🚫 Danger Kotlin against 9c685d1

@henrik-sky Henrik Sym (henrik-sky) 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.

Nice!

@henrik-sky
Henrik Sym (henrik-sky) merged commit b8a15c7 into main Jul 16, 2026
19 checks passed
@henrik-sky
Henrik Sym (henrik-sky) deleted the muon-1865-bpkgraphicpromo_api_bkg branch July 16, 2026 08:43

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.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Renames the BpkGraphicPromo slot parameter from image to background to better reflect that it supports arbitrary composables (including BpkVideoPlayer), and updates docs + demo usage accordingly.

Changes:

  • Renamed BpkGraphicPromo / internal impl parameter from image to background.
  • Added a demo story showcasing a sponsored graphic promo with a video background.
  • Updated Compose docs to reflect the rename and document video backgrounds.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/compose/GraphicPromo/README.md Updates API examples to use background and documents video background usage.
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/graphicpromotion/internal/BpkGraphicPromoImpl.kt Renames internal slot parameter and wires it through to existing layout branches.
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/graphicpromotion/BpkGraphicPromo.kt Renames the public API parameter and forwards it to the impl.
backpack-compose/src/androidTest/kotlin/net/skyscanner/backpack/compose/graphicpromotion/BpkGraphicPromoTest.kt Updates tests to use the renamed parameter.
app/src/main/java/net/skyscanner/backpack/demo/compose/GraphicPromoStory.kt Adds a new demo-only story using BpkVideoPlayer as the graphic promo background and updates the existing sample call site.

Comment on lines +109 to +110
"https://content.skyscnr.com/media/68afbd83-d09a-48e8-9821-90c117b8f842/593d0fe4-5459-4c43-beb9-49f9ce79d365.m3u8"

Comment on lines +148 to +152
painter = painterResource(id = R.drawable.skyland),
contentDescription = "Image",
contentScale = ContentScale.Fit,
)
},
Comment on lines +100 to +105
Image(
modifier = Modifier.matchParentSize(),
painter = painterResource(id = R.drawable.graphic_promo),
contentDescription = "Image",
contentScale = ContentScale.Crop,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major A breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants