fix(support/chat): differentiate customer vs support/bot bubbles#596
Merged
TaprootFreak merged 1 commit intoMay 28, 2026
Conversation
The previous `isFromSupport => author == null` check never matched — the API always sends a non-null author: `'Customer'` for the user, `'AutoResponder'` for the bot, and the agent name for support staff. As a result, every message was rendered as a user message (right-aligned, blue), making it impossible to tell who sent what. Detect the customer by comparing against the API's `CustomerAuthor` constant, then render anything else (agent name or `AutoResponder`) on the left in the existing neutral bubble, with a `Support` label above it.
TaprootFreak
approved these changes
May 28, 2026
Contributor
TaprootFreak
left a comment
There was a problem hiding this comment.
Approve. Bug-Diagnose stimmt (alter author == null-Check matchte nie, Backend liefert immer non-null), neue isFromCustomer-Logik ist defensiv korrekt. i18n alphabetisch, Styling konform, Tests decken Customer/Agent/Bot/null ab.
2e5559a
into
RealUnitCH:integration/realunit-registration
8 of 9 checks passed
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.
Summary
The support-chat bubble shipped with a broken sender check —
isFromSupport => author == null— that never matched, because thebackend always sends a non-null
authorstring:authorvalue (fromsupport-message.entity.ts)'Customer'(theCustomerAuthorconstant)'AutoResponder'supportClerkssetting (fallback'Support')As a result every message — including the auto-responder's "Hi Jana, …"
template — was rendered as a user message: right-aligned, in
realUnitBlue. The screenshot below the PR description shows the visualcollision.
Changes
support_message.dart: introducecustomerAuthorconstant (mirroring theAPI), expose
isFromCustomergetter, redefineisFromSupportas itsinverse. Anything that is not the literal
'Customer'string (agent name,AutoResponder, or a defensivenull) now counts as support.support_chat_message_bubble.dart: switch the bubble's alignment / colourbranch on
isFromCustomer. Render a smallSupportlabel above thebubble for non-customer messages so the user can tell agent/bot replies
apart from their own.
assets/languages/strings_{de,en}.arb: addsupportChatSupportLabel(alphabetically inserted between
supportChatandsupportCreateTicket).(
'Customer','Robin','AutoResponder') — the previous fixtures(
'alice','user-1',null) hid the bug.Test plan
flutter analyzeclean on touched filesflutter test test/screens/support test/packages/service/dfx/models/support— 73 tests passdart run tool/generate_localization.dartregenerateslib/generated/i18n.dart(gitignored)AutoResponder reply now lands on the left with the
SupportlabelSupportlabel)