-
Notifications
You must be signed in to change notification settings - Fork 35
PAN-4610: price range component #2569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PAN-4610: price range component #2569
Conversation
There was a problem hiding this 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
BpkPriceRangecomposable component with two configuration types:Default(with labeled segments and marker) andCollapsed(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) {}) { |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
}
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt
Outdated
Show resolved
Hide resolved
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt
Outdated
Show resolved
Hide resolved
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt
Outdated
Show resolved
Hide resolved
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt
Outdated
Show resolved
Hide resolved
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt
Outdated
Show resolved
Hide resolved
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt
Outdated
Show resolved
Hide resolved
Generated by 🚫 Danger Kotlin against 918cb93 |
Generated by 🚫 Danger Kotlin against 4bf3f6f |
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt
Outdated
Show resolved
Hide resolved
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt
Outdated
Show resolved
Hide resolved
backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/BpkPriceRange.kt
Outdated
Show resolved
Hide resolved
Generated by 🚫 Danger Kotlin against 6a9384c |
Generated by 🚫 Danger Kotlin against 5292f6e |
There was a problem hiding this 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.dpshould 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.dpshould be replaced with a token from the BpkSpacing system to maintain consistency with the design system. Hardcoded dimension values violate the token usage principle.
/**
...ose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/internal/BpkPriceRangeImpl.kt
Show resolved
Hide resolved
...ose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/internal/BpkPriceRangeImpl.kt
Show resolved
Hide resolved
...ose/src/main/kotlin/net/skyscanner/backpack/compose/pricerange/internal/BpkPriceRangeImpl.kt
Show resolved
Hide resolved
Generated by 🚫 Danger Kotlin against 55c13f3 |
https://skyscanner.atlassian.net/browse/PAN-4610
Preview
Remember to include the following changes:
README.mdIf you are curious about how we review, please read through the code review guidelines