Skip to content

Conversation

@jacobhuang0121
Copy link
Contributor

@jacobhuang0121 Jacob Huang (jacobhuang0121) commented Jan 21, 2026

https://skyscanner.atlassian.net/browse/PAN-4610

Preview

Light Dark
image image

Remember to include the following changes:

  • Component README.md
  • Tests

If you are curious about how we review, please read through the code review guidelines

Copilot AI review requested due to automatic review settings January 21, 2026 10:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new PriceRange component to the Backpack Android Compose library. The component provides a visual representation of price ranges with configurable markers and segments, supporting both default (expanded) and collapsed variations.

Changes:

  • Added a new BpkPriceRange composable component with two configuration types: Default (with labeled segments and marker) and Collapsed (compact version with circular marker)
  • Created supporting data classes for configuration, markers, and segments
  • Added comprehensive documentation with usage examples

Reviewed changes

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

Show a summary per file
File Description
docs/compose/PriceRange/README.md Documentation with installation instructions and usage examples for Default, Collapsed, and fixed-width variants
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt Core implementation of the PriceRange component with configuration classes, rendering logic, and helper functions
app/src/test/java/net/skyscanner/backpack/compose/pricerange/BpkPriceRangeTest.kt Snapshot test for the component
app/src/main/java/net/skyscanner/backpack/demo/compose/PriceRangeStory.kt Demo story showcasing Default and Collapsed variants with various marker positions
app/src/main/java/net/skyscanner/backpack/demo/components/PriceRangeComponent.kt Component marker annotation for demo organization

) {
val contentModifier = if (cardWidth != null) modifier.width(cardWidth) else modifier

Box(modifier = contentModifier.semantics(mergeDescendants = true) {}) {
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The semantics block is empty and provides no accessibility information. For a price range component, you should include content description that announces the price range information, marker position, and segment labels to screen readers. Consider adding appropriate semantics properties like contentDescription or stateDescription.

Copilot generated this review using guidance from repository custom instructions.
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed, please add a contentDescription: String?, parameter and then use the following to give a better Talkback experience

clearAndSetSemantics {
        if (contentDescription != null) {
            this.contentDescription = contentDescription
        }

@jacobhuang0121 Jacob Huang (jacobhuang0121) added the minor A new & backwards compatible feature/component label Jan 21, 2026
@skyscanner-backpack-bot
Copy link
Contributor

Fails
🚫 These new files do not include the license heading: app/src/main/java/net/skyscanner/backpack/demo/compose/PriceRangeStory.kt
Warnings
⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 918cb93

@jacobhuang0121 Jacob Huang (jacobhuang0121) changed the title PAN-4610: Contribute backpack price range component PAN-4610: price range component Jan 21, 2026
@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 4bf3f6f

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 6a9384c

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 5292f6e

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comments suppressed due to low confidence (2)

backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/internal/BpkPriceRangeImpl.kt:1

  • The hardcoded value 36.dp should be replaced with a token from the BpkSpacing or BpkBorderRadius system to maintain consistency with the design system. Hardcoded dimension values violate the token usage principle.
/**

backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/internal/BpkPriceRangeImpl.kt:1

  • The hardcoded value 12.dp should be replaced with a token from the BpkSpacing system to maintain consistency with the design system. Hardcoded dimension values violate the token usage principle.
/**

@skyscanner-backpack-bot
Copy link
Contributor

Warnings
⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 55c13f3

@henrik-sky Henrik Sym (henrik-sky) merged commit a974c9e into main Jan 22, 2026
16 checks passed
@henrik-sky Henrik Sym (henrik-sky) deleted the panda/PAN-4610_Contribute_backpack_price_range_component branch January 22, 2026 10:35
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