Repository navigation
[MAR-2699] Render CSS box-shadow for input bar and product cards - #212
Merged
Merged
Conversation
Consume the --input-box-shadow theme token, which was parsed but never rendered, and move --multimodal-card-box-shadow onto the same implementation. - Add ConciergeBoxShadow (offset, blur, spread, color) and a Modifier.conciergeBoxShadow that draws the shadow itself on API 28+ (BlurMaskFilter + clipOutPath) so offset, spread and low-alpha colors match the web. Modifier.shadow scaled the color's alpha down by the system shadow alpha, which made subtle shadows invisible. - Below API 28, fall back to Modifier.shadow elevation. Offset, spread and color are ignored there. - Cache the shadow path and paint in a Modifier.Node so typing in the input bar doesn't rebuild them on every recomposition. - Replace ExtendedProductCardStyle.shadowElevation/shadowColor with boxShadow and apply it to the input panel and product cards. - Add shadows to the debug Product Card Demo theme. - Add unit and instrumented tests, and update the style guide Shadows section and support status.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
cdhoffmann
requested changes
Nov 10, 2026
cdhoffmann
left a comment
There was a problem hiding this comment.
--multimodal-card-box-shadow is only applied to productDetail cards. The default actionButton ProductCard still uses a hardcoded 1dp elevation (ConciergeStyles.productCardStyle), while iOS applies the token to both card styles (ChatMessageView.actionButtonCarouselCard / actionButtonProductCard).
Can ProductCard use the new modifier too?
Card(
modifier = modifier.conciergeBoxShadow(ConciergeBoxShadow.fromTokens(layout?.multimodalCardBoxShadow), style.shape),
elevation = CardDefaults.cardElevation(defaultElevation = 0.dp),
...
)
Contributor
Author
|
good callout, i'll get it applied there as well |
Contributor
Author
Address review feedback: --multimodal-card-box-shadow was only applied to productDetail cards (ExtendedProductCard) while the default actionButton ProductCard kept a hardcoded 1dp elevation. iOS applies the token to both card styles, so ProductCard now uses the same conciergeBoxShadow modifier. - Add boxShadow to ConciergeStyles.ProductCardStyle, resolved from the multimodalCardBoxShadow token via ConciergeBoxShadow.fromTokens. - Apply conciergeBoxShadow in ProductCard; keep the 1dp elevation only as a fallback when no shadow token is configured (no change to default appearance). - Add parity instrumented tests: shadow renders beyond the card bounds when the token is set, and no custom shadow when it is not. - Add Robolectric SDK-gated unit tests and an instrumented recomposition test covering the below-API-28 elevation fallback and the draw-node update path flagged by Codecov. - Update the style guide to note the card shadow applies to both the actionButton ProductCard and the productDetail ExtendedProductCard.
cdhoffmann
approved these changes
Nov 10, 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 Android rendering for CSS
box-shadowtheme tokens.--input-box-shadownow draws on the chat input bar, and--multimodal-card-box-shadowuses the same implementation for product cards.ConciergeBoxShadow(ui/theme/ConciergeBoxShadow.kt): a typed model (offset, blur, spread, color) created withfromTokensfrom the mapCSSValueConverter.parseBoxShadowalready produces. Unset tokens,noneand fully transparent colors givenull, meaning no shadow.Modifier.conciergeBoxShadow(shadow, shape):Paint+BlurMaskFilter, inflated by spread, translated by offset, and withclipOutPathso it never shows through a translucent background (like CSS). The CSS blur is converted to the Skia mask filter radius so blur matches the web.Modifier.shadowwith the blur radius as elevation. Offset, spread and color are ignored there, since custom shadow colors need API 28+.Modifier.Nodethat caches the paths and paint and rebuilds them only when size, layout direction or density change, so typing in the input bar doesn't rebuild them.InputPanelStyle.boxShadow(defaults tonull) is applied to theChatInputPanelsurface.ExtendedProductCardStyle.shadowElevation/shadowColorare replaced byboxShadow, applied before the card clip so the shadow isn't cut off.0 1px 4px 0 #00000026for cards,0 2px 8px 0 #00000026for the input bar).Documentation/style-guide.mdShadows section, Key Differences and support status rows updated for both tokens.Related Issue
MAR-2699
Motivation and Context
--input-box-shadowwas parsed intocssLayout.inputBoxShadowbut never used, so themes that set it had no input bar shadow on Android. The product card shadow usedModifier.shadow, which only uses the blur radius (as elevation) and color. Android also multiplies the color's alpha by the system's low shadow alpha, so subtle web-style shadows such as#00000026were nearly invisible. Drawing the shadow directly keeps offset, spread and alpha close to the web.Behavior change to note: on API 28+, existing themes that set
--multimodal-card-box-shadowwill now show a more visible card shadow that matches their CSS. Below API 28 the shadow is the default grey elevation shadow, which can look heavier than the CSS value.How Has This Been Tested?
./gradlew :concierge:testPhoneDebugUnitTest: passed. This includes the newConciergeBoxShadowTest, which covers token parsing, null/none/transparent handling, negative blur, and the blur radius conversion../gradlew :concierge:connectedPhoneDebugAndroidTestwithChatInputPanelTest,ExtendedProductCardTest,ProductCarouselTestandConciergeStylesTeston an API 31 emulator: 123/123 passed. The new pixel tests check that the shadow renders, that a vertical offset puts the shadow below and not above, thatnonegives no shadow, and that the style getters map both tokens.make lint: passed.Screenshots (if appropriate):
Product Card Demo, API 27 (elevation fallback) vs API 31 (CSS box-shadow draw):

Input bar:

Product card edge:

Types of changes
Checklist: