Skip to content

Query entry tweaks#96

Merged
rymorale merged 6 commits intoadobe:devfrom
rymorale:query-entry-tweaks
Apr 8, 2026
Merged

Query entry tweaks#96
rymorale merged 6 commits intoadobe:devfrom
rymorale:query-entry-tweaks

Conversation

@rymorale
Copy link
Copy Markdown
Contributor

@rymorale rymorale commented Apr 8, 2026

Description

Adds a configurable user message bubble style to the chat UI. By default, all message bubble corners remain fully rounded (existing behavior, no breaking change). Setting behavior.chat.userMessageBubbleStyle to "balloon" in the theme JSON applies a speech bubble appearance where the bottom-right corner is squared off (0dp radius).

Related Issue

Motivation and Context

How Has This Been Tested?

  • New unit tests added to ConciergeThemeTokensTest covering ConciergeChatBehavior defaults, custom values, and integration with ConciergeThemeBehavior
  • New unit tests added to ThemeParserTest covering parsing of the behavior.chat block from JSON, including the absent case
  • New instrumented tests added to ConciergeStylesTest covering:
    • Default style (all corners rounded)
    • "balloon" style (square bottom-right corner)
    • Case insensitivity ("BALLOON" resolves correctly)
    • Unknown values fall back to default
    • Bot message shape remains fully rounded regardless of userMessageBubbleStyle
  • Manually verified on device using the themeDemo.json test theme with "userMessageBubbleStyle": "balloon"

Screenshots (if appropriate):

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Changes

ConciergeThemeTokens.kt

  • Added ConciergeChatBehavior data class with messageAlignment, messageWidth, and userMessageBubbleStyle fields
  • Added chat: ConciergeChatBehavior? to ConciergeThemeBehavior

ThemeParser.kt

  • Parses behavior.chat block from theme JSON into ConciergeChatBehavior

ConciergeStyles.kt

  • Added userMessageShape: Shape to MessageBubbleStyle
  • messageBubbleStyle getter resolves userMessageShape from behavior.chat.userMessageBubbleStyle; "balloon" produces a RoundedCornerShape with bottomEnd = 0.dp, all other values fall back to the default fully-rounded shape

ChatMessageItem.kt

  • User message Card now uses style.userMessageShape; bot messages continue using style.shape

Documentation/style-guide.md

  • Documented behavior.chat.userMessageBubbleStyle in the Chat section and Implementation Status table

Theme JSON

{
  "behavior": {
    "chat": {
      "userMessageBubbleStyle": "balloon"
    }
  }
}

rymorale added 2 commits April 7, 2026 16:24
Add support for a new behavior.chat.userMessageBubbleStyle option to control user message bubble shape. Updates ConciergeStyles to build a userMessageShape (adds support for a new "balloon" style which has a square bottom-end corner) and exposes it via MessageBubbleStyle. Tests, docs (style-guide), and the demo theme JSON were updated to cover and demonstrate the new option.
Add tests for message bubble shapes

Add unit tests for ConciergeStyles.messageBubbleStyle to verify corner shapes under various theme settings. Introduces tests for default fully rounded bubbles, 'balloon' style (bottom-end corner squared), case-insensitive handling of the style token, fallback to default for unknown values, and that bot messages always use the default rounded shape. Ensures correct behavior of theme-driven bubble styling and fallbacks.
@rymorale rymorale requested a review from timkimadobe April 8, 2026 01:59
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...eting/mobile/concierge/ui/theme/ConciergeStyles.kt 83.33% 0 Missing and 2 partials ⚠️
...marketing/mobile/concierge/ui/theme/ThemeParser.kt 75.00% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

data class ConciergeChatBehavior(
val messageAlignment: String? = null,
val messageWidth: String? = null,
val userMessageBubbleStyle: String? = null
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be worthwhile for the bubble style to use an enum similar to ProductCardStyle and CarouselStyle?:

enum class UserMessageBubbleStyle(val value: String) {
    DEFAULT("default"),
    BALLOON("balloon");
    companion object {
        fun fromString(value: String): UserMessageBubbleStyle =
            values().firstOrNull { it.value.equals(value, ignoreCase = true) } ?: DEFAULT
    }
}

bottomStart = 12.dp,
bottomEnd = 0.dp
)
else -> defaultShape
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could this default to 12, but use the value from messageBorderRadius if it is provided?

Copy link
Copy Markdown
Contributor

@timkimadobe timkimadobe left a comment

Choose a reason for hiding this comment

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

Just some small wording suggestions, looks great thanks Ryan!

| `--input-button-border-radius` | ⚠️ | Parsed but not used in composables | - |
| `--input-box-shadow` | ⚠️ | Parsed but shadows not rendered | - |
| `--message-border-radius` | ⚠️ | Parsed but not used in composables | - |
| `--message-border-radius` | | Corner radius for all message bubbles; applies to both user and bot bubbles | `ChatMessageItem` |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: "agent bubbles"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that is a better name 😄

bottomEnd = 0.dp
)
assertEquals(expected, style!!.userMessageShape)
// Bot message shape is always fully rounded regardless of userMessageBubbleStyle
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: "Agent message"?

Replace occurrences of 'bot' with 'agent' for message bubble wording to improve terminology consistency.
@rymorale rymorale merged commit 412f890 into adobe:dev Apr 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants