Repository navigation
Add secondary CTA support to productDetail product cards - #171
Merged
Merged
Conversation
Mirrors the iOS implementation: entity_info.secondary renders as an outlined CTA next to the existing filled primary CTA, via a shared validated/ordered CTA-list builder. A lone CTA keeps its intrinsic width; two or more share the row equally. Adds the 4 matching --product-card-secondary-cta-button-* theme tokens end to end (models, layout, colors, CSS mapper, styles) plus style-guide docs, demo seed data, and unit/instrumented test coverage. Also removes a pre-existing rule that hid the whole CTA row whenever a subtitle (entity_info.productDescription) was present -- real backends populate that field on every card, which silently hid CTAs entirely. Visibility now depends only on a valid action (text + url), matching iOS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
CI's instrumented tests caught a real regression: the secondary CTA button's inner Box had fillMaxWidth(), which greedily claims the full incoming width constraint regardless of the outer wrapContentWidth() modifier meant to keep a lone CTA at its intrinsic size. weight(1f) already forces an exact width for the 2-CTA case, so the fillMaxWidth was unnecessary there and actively wrong for the 1-CTA case. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
BNanda99
marked this pull request as ready for review
September 20, 2026 07:47
Contributor
|
Can you add product requirement JIRA for this. |
Member
Author
|
prudrabhat
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds secondary CTA support to the
productDetailproduct card style (ExtendedProductCard). Product cards can now render both a primary (filled) and secondary (outlined) call-to-action side by side, sourced fromentity_info.primary/entity_info.secondary.ProductDetailCtalist (productDetailCtas()) as the single source of truth for which CTAs render, in what order (primary before secondary), and with what (trimmed) text/url. An action is included only when both its text and url are non-blank after trimming.--product-card-secondary-cta-button-background-color--product-card-secondary-cta-button-text-color--product-card-secondary-cta-button-border-color--product-card-secondary-cta-button-border-widthentity_info.productDescription) was present, on the assumption there wasn't room for both at the card's fixed height. Real backend responses populate a subtitle on every card, which silently hid all CTAs. CTA visibility now depends only on having a valid action. The card's content already scrolls internally past its max height, so this doesn't introduce clipping.The
actionButtoncard style (ProductCard/ProductActionButtons) already supported both CTAs before this change and was intentionally left untouched.Related Issue
Motivation and Context
Product cards were limited to a single CTA, but the backend can supply both a primary action (e.g. "Buy now") and a secondary action (e.g. "Learn more" / "Get directions").
How Has This Been Tested?
./gradlew :concierge:testPhoneDebugUnitTest), including new coverage for:ExtendedProductCardLogicTest— theproductDetailCtas()builder: primary-only, both-valid (ordering), secondary-only when primary invalid, dropped when text/url null/blank/whitespace, trimming, empty list.CSSKeyMapperTest— the 4 new CSS variable mappings, malformed-value fallback, key coverage.androidTest) UI tests added/updated inExtendedProductCardTestcovering: both CTAs render in order, secondary-only when primary is invalid, secondary dropped on blank url, whitespace trimming on tap, click isolation (secondary tap doesn't fire card click), no-full-width regression for a lone CTA, equal width-sharing for two CTAs, and CTA visibility with a subtitle present (regression test for the bug fix above). These compile clean but could not be run on-device in this environment (no emulator/adbavailable) — recommend running on a device before merging.ProductCardDemoScreen, updated with primary-only, primary+secondary, dropped-secondary (blank url), subtitle+both-CTAs, and no-CTA sample cards.Screenshots (if appropriate):
Types of changes
Checklist: