Skip to content

Commit cf07643

Browse files
authored
Merge pull request #210 from josej-ea/feature/theme-message-typography
Add message typography and inline link styling theme keys
2 parents 1b39817 + 5af0515 commit cf07643

20 files changed

Lines changed: 1141 additions & 102 deletions

File tree

‎Documentation/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Documentation for integrating and customizing the Adobe Experience Platform Bran
77
- [Implementation Guide](implementation-guide.md) - Learn how to integrate Brand Concierge into your Android app
88
- [Data handoff](implementation-guide.md#data-handoff) - Send application data to Brand Concierge without a chat message
99
- [Style Guide](style-guide.md) - Complete reference for theming and customization options
10+
- [Release notes](release-notes.md) - Changes and compatibility considerations

‎Documentation/release-notes.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Release notes
2+
3+
## Unreleased
4+
5+
### Message typography
6+
7+
Added optional message body size/weight and inline link weight/underline theme
8+
overrides. Defaults preserve existing behavior. Invalid CSS sizes and weights
9+
are ignored with a warning, including programmatic typography supplied to
10+
`ConciergeTheme`. Link overrides also apply in lists and blockquotes;
11+
Markdown-bold links retain at least bold weight. Explicit body line height is
12+
preserved through response paragraph rendering; omitted line height retains
13+
existing response spacing. When `--message-font-size` is set without an explicit
14+
line height, inherited `sp` message bubble line heights scale proportionally;
15+
inherited `em` line heights remain unchanged because they already scale with font
16+
size. Pixel line heights (for example `"24px"` or `"24PX"`) are absolute
17+
scaled sizes rather than multipliers, and the `px` suffix is case-insensitive.
18+
Body paragraph line height no longer
19+
overrides headings or fenced code, including nested blocks.
20+
Response paragraphs and list items also supply their resolved body font size to
21+
Compose so explicit line heights scale consistently at accessibility font sizes.
22+
23+
**Binary compatibility:** Adding parameters to the public `ConciergeTypography`
24+
Kotlin data class, including `lineHeightPx` for absolute line height, changes its
25+
constructor and generated `copy` signatures.
26+
Default parameter values preserve ordinary source calls that omit the new
27+
parameters, but do not preserve binary compatibility. Applications and libraries
28+
compiled against the previous class must be recompiled when upgrading.

‎Documentation/style-guide.md‎

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,44 @@ Visual styling using CSS-like variable names. All properties in the `theme` obje
754754
| CSS Variable | Kotlin Property | Type | Default | Description |
755755
|--------------|-----------------|------|---------|-------------|
756756
| `--font-family` | `typography.fontFamily` | `String` | `null` (system font) | Font family name |
757-
| `--line-height-body` | `typography.lineHeight` | `Double` | `1.0` | Line height multiplier |
757+
| `--line-height-body` | `typography.lineHeight` / `typography.lineHeightPx` | `Double` | `null` (existing layout defaults) | Unitless multiplier (`"1.5"`) or absolute Android scaled size (`"24px"` maps to 24sp); the `px` suffix is case-insensitive |
758+
| `--message-font-size` | `typography.fontSize` | `Double` | `null` (Material default) | Message body text size (px); positive and finite when converted to Compose's float size |
759+
| `--message-font-weight` | `typography.fontWeight` | `Int` | `null` (Material default) | Message body text weight (`1`–`1000`, `normal`, `bold`, `lighter`, `bolder`) |
760+
| `--message-concierge-link-font-weight` | `typography.linkFontWeight` | `Int?` | `null` (inherits body weight) | Inline hyperlink text weight in concierge messages; same valid range/names as body weight |
761+
| `--message-concierge-link-underline` | `typography.linkUnderline` | `Boolean` | `true` | Whether inline hyperlinks are underlined (WCAG 1.4.1) |
762+
763+
Body size and weight apply to user and concierge message bodies, and to the privacy
764+
notice that shares the body style. Link overrides apply to inline concierge response
765+
links, including links inside lists and blockquotes, not Sources rows or other UI
766+
links. Markdown headings and code retain their existing specialized styling.
767+
CSS theme values must be
768+
strings (for example `"--message-concierge-link-underline": "false"`).
769+
Malformed or out-of-range sizes and weights are ignored with a warning; existing
770+
values/defaults are preserved. Markdown-bold links remain at least weight `700`,
771+
even when the configured link weight is lower. Italic links retain italics.
772+
Programmatic `ConciergeTypography` values receive the same size/weight validation
773+
when supplied to `ConciergeTheme`; invalid values fall back to the text style
774+
defaults. An explicit `--line-height-body` is retained as paragraph styling in
775+
concierge responses, including list items. Omitting it preserves existing response
776+
line spacing. For message bubble styles, setting only `--message-font-size` scales
777+
the inherited `sp` line height proportionally to avoid cramped lines. Inherited
778+
`em` line heights stay unchanged because they already scale with font size. For example,
779+
`"24px"` remains 24sp when the body font size changes, whereas `"1.5"` scales with
780+
that font size. Headings and fenced code blocks retain their existing paragraph
781+
spacing, including when nested in a list or blockquote.
782+
Inline code remains part of its surrounding body paragraph.
783+
Response text and list items use the resolved body font size as their base font
784+
size so Compose's accessibility font scaling resolves paragraph line height
785+
consistently with Material text. Body line height remains paragraph-scoped and is
786+
not reapplied globally to headings or fenced code.
787+
Programmatic themes can set `lineHeightPx` for an absolute size or `lineHeight`
788+
for a multiplier; if both are set, `lineHeightPx` takes precedence. Invalid line
789+
heights are ignored with a warning.
790+
791+
Underlining helps distinguish links but does not replace text/background contrast.
792+
Check the actual message background: WCAG AA requires at least 4.5:1 for normal
793+
text, or 3:1 for large text. Heavier weight alone does not improve the contrast
794+
ratio; the lower threshold applies only when text meets WCAG's large-text criteria.
758795

759796
### Colors - Primary
760797

@@ -1558,7 +1595,11 @@ This section documents which properties are fully implemented, partially impleme
15581595
| CSS Variable | Status | Notes | Used In |
15591596
|--------------|--------|-------|---------|
15601597
| `--font-family` | ⚠️ | Parsed but not implemented | - |
1561-
| `--line-height-body` | ✅ | Body text line height | All text components via `ConciergeStyles.withThemeTypography` |
1598+
| `--line-height-body` | ✅ | Explicit message body line height | `ConciergeStyles.withThemeTypography`; response paragraph styling via `MarkdownParser` |
1599+
| `--message-font-size` | ✅ | Message body text size | `ConciergeStyles.withThemeTypography` |
1600+
| `--message-font-weight` | ✅ | Message body text weight | `ConciergeStyles.withThemeTypography` |
1601+
| `--message-concierge-link-font-weight` | ✅ | Inline link text weight | `MarkdownRenderer` link renderers |
1602+
| `--message-concierge-link-underline` | ✅ | Inline link underline | `MarkdownRenderer` link renderers |
15621603
| `--input-font-size` | ✅ | Input field text size | `ChatTextField` |
15631604
| `--citations-desktop-button-font-size` | ✅ | Citation pill text size | `CircularCitation` |
15641605
| `--disclaimer-font-size` | ✅ | Disclaimer text size | `ConciergeDisclaimer` (DisclaimerStyle) |

0 commit comments

Comments
 (0)