[SR-473] Rename promo sticker component and add docs#334
[SR-473] Rename promo sticker component and add docs#334
Conversation
There was a problem hiding this comment.
Pull request overview
Renames the Android UI component previously called SourceBadge to PromoSticker to align with the design system naming, and updates associated documentation, previews, and snapshot tests.
Changes:
- Introduces
PromoSticker(new package/name) and updates previews/tests to use it. - Adds PromoSticker documentation and refreshes existing docs (Buttons dark mode previews, Pager docs restructuring).
- Updates sample app navigation/preview wiring and snapshot outputs.
Reviewed changes
Copilot reviewed 9 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| android/source/src/main/kotlin/com/gu/source/components/promosticker/PromoSticker.kt | Renames/relocates the component and its enums under promosticker. |
| android/source/src/main/kotlin/com/gu/source/components/promosticker/README.md | Adds component docs and usage examples for PromoSticker. |
| android/source/src/test/kotlin/com/gu/source/components/badge/PromoStickerTest.kt | Updates Paparazzi snapshot test to render PromoSticker previews. |
| android/source/src/test/snapshots/images/com.gu.source.components.badge_PromoStickerTest_badge[NOTNIGHT].png | Adds/updates snapshot output for PromoSticker (light). |
| android/source/src/test/snapshots/images/com.gu.source.components.badge_PromoStickerTest_badge[NIGHT].png | Adds/updates snapshot output for PromoSticker (dark). |
| android/source/src/test/snapshots/images/com.gu.source.components.badge_PromoStickerTest_longBadge[NOTNIGHT].png | Adds/updates long-text snapshot output for PromoSticker (light). |
| android/source/src/test/snapshots/images/com.gu.source.components.badge_PromoStickerTest_longBadge[NIGHT].png | Adds/updates long-text snapshot output for PromoSticker (dark). |
| android/source/src/main/kotlin/com/gu/source/components/buttons/README.md | Updates Buttons docs table to show light/dark previews. |
| android/source/src/main/kotlin/com/gu/source/components/pager/README.md | Reorders/expands pager docs and adds a PagerProgressBar section. |
| android/sample/src/main/kotlin/com/gu/source/previews/PromoStickerPreview.kt | Updates the sample preview to use PromoSticker APIs. |
| android/sample/src/main/kotlin/com/gu/source/MainActivity.kt | Updates sample sheet navigation and labels to point at PromoSticker. |
| android/source/detekt-baseline.xml | Adjusts baseline entries to reflect new PromoSticker enums. |
| android/README.md | Adds Promo stickers section and updates pager list formatting. |
Comments suppressed due to low confidence (5)
android/source/src/main/kotlin/com/gu/source/components/promosticker/PromoSticker.kt:127
- The KDoc param descriptions still talk about "badge" and there’s a dangling
[TextOverflow.Ellipsis].line after removing the overflow params. Please either document the fixed behavior (maxLines=1, ellipsis) in prose or reintroduce the params so the KDoc is accurate.
android/source/src/main/kotlin/com/gu/source/components/promosticker/PromoSticker.kt:132 - Renaming/removing the public
SourceBadgeAPI in favor ofPromoStickeris a breaking change for any downstream consumers. Consider keeping deprecated wrappers/aliases (delegating toPromoSticker) for at least one release to provide a migration path.
android/source/src/main/kotlin/com/gu/source/components/promosticker/PromoSticker.kt:121 - KDoc still describes this as a "badge" and links to the Supporter Revenue Toolkit design spec, which doesn’t match the new PromoSticker naming/docs. Please update the summary text and link to the correct PromoSticker spec (e.g., the Apps library Figma used elsewhere in this PR).
android/source/src/main/kotlin/com/gu/source/components/pager/README.md:56 - Minor grammar issue: "It provides a options" should be "It provides options" (or "It provides an option").
`PagerProgressIndicator` is a lower level component used to signify progress in a pager. It provides
a options for customising appearance of the indicators. See the [full API Docs here][1].
android/source/src/test/kotlin/com/gu/source/components/badge/PromoStickerTest.kt:5
- This test is still in the
components/badgefolder and uses thecom.gu.source.components.badgepackage, but it now snapshotsPromoSticker. Consider moving/renaming the test tocomponents/promostickerand updating the package so snapshot paths stay aligned with the component name.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
android/source/src/main/kotlin/com/gu/source/components/promosticker/README.md
Outdated
Show resolved
Hide resolved
android/source/src/main/kotlin/com/gu/source/components/pager/README.md
Outdated
Show resolved
Hide resolved
android/source/src/main/kotlin/com/gu/source/components/pager/README.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 17 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
android/source/src/main/kotlin/com/gu/source/components/promosticker/PromoSticker.kt:126
- The documentation comment is incomplete. Line 126 contains orphaned text "[TextOverflow.Ellipsis]." that appears to be leftover from a previous version of the documentation when maxLines and textOverflow parameters existed. This line should be removed since these parameters no longer exist.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
SourceBadgetoPromoStickerto match the nomenclature used by the design system (see linked Figma).PromoStickerButtonto add dark mode previewsFigma: Figma
Ticket: Trello
Checklist