Skip to content

Fix user chat bubble text rendering - #883

Merged
shanselman merged 1 commit into
mainfrom
fix-chat-user-bubble-rendering
Jun 28, 2026
Merged

Fix user chat bubble text rendering#883
shanselman merged 1 commit into
mainfrom
fix-chat-user-bubble-rendering

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

Fixes #880

Summary

  • Reset reused WinUI TextBlock visual state before applying selection-safe user prompt inlines.
  • Cache the normal chat text FontFamily per dispatcher so user bubbles do not inherit stale glyph/trimming state from reused controls.
  • Add a contract test covering the user-bubble reset before ApplyPlainSelectableInlines(...).

Validation

  • ./build.ps1 — passed
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore — passed: 2629 passed / 31 skipped
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore — passed: 1433 passed
  • python .agents/skills/autoreview/scripts/autoreview --mode commit --commit HEAD — clean: no accepted/actionable findings
  • Rubber-duck review — no blocking findings

Real behavior proof

  • Rebuilt local Debug WinUI app from this branch and reopened the Chat view.
  • Developer-provided current-head screenshot in the Copilot session shows the previously broken prompt now rendering as yes file another bug in the user bubble instead of a single glyph/dot.
  • Computer-use UIA proof was blocked: the background engine listed the WinUI window but could not resolve it with get_window_state; manual screenshot proof was used instead.

Reset reused WinUI TextBlock visual state before applying selection-safe user prompt inlines so chat bubbles render the full typed prompt instead of stale single-glyph output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed June 28, 2026, 4:08 AM ET / 08:08 UTC.

Summary
The PR resets reused WinUI user-bubble TextBlock visual state, adds a dispatcher-cached chat text font, and adds a source contract test.

Reproducibility: Do we have a high-confidence way to reproduce the issue? No: the linked issue gives the exact prompt and before screenshot, and source inspection matches the display-path failure, but this read-only review did not run the Windows tray UI.

Review metrics: 1 noteworthy metric.

  • Diff size: 2 files changed, 54 additions, 0 deletions. The patch is narrowly scoped to one WinUI chat renderer and one Tray.Tests contract test.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #880
Summary: This PR is the open candidate fix for the linked native chat user-bubble rendering issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Attach a redacted current-head Windows tray screenshot or recording showing the exact user prompt rendering correctly in the chat bubble.
  • Put the proof link or media in the PR body under Real behavior proof so a fresh ClawSweeper review can inspect it.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body claims a current-head screenshot exists in a Copilot session, but no inspectable after-fix screenshot, recording, log, or artifact is attached to the PR. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A short visual proof would directly verify the native chat bubble text rendering that this PR changes. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify the native Chat view renders the full user bubble text `yes file another bug` after reopening Chat.

Risk before merge

  • [P1] The PR body describes after-fix UI proof but does not attach a viewable artifact, so maintainers cannot independently verify the current-head visual behavior yet.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused rendering fix after a viewable current-head Windows tray screenshot or recording shows the exact user prompt rendering normally and required validation is green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Contributor or maintainer action is needed to add inspectable current-head UI proof; there is no narrow code repair for automation from this review.

Security
Cleared: The diff only changes WinUI rendering code and a source-text test; it does not alter secrets, dependencies, CI, downloaded artifacts, or other security-sensitive execution paths.

Review details

Best possible solution:

Land the focused rendering fix after a viewable current-head Windows tray screenshot or recording shows the exact user prompt rendering normally and required validation is green.

Do we have a high-confidence way to reproduce the issue?

Do we have a high-confidence way to reproduce the issue? No: the linked issue gives the exact prompt and before screenshot, and source inspection matches the display-path failure, but this read-only review did not run the Windows tray UI.

Is this the best way to solve the issue?

Is this the best way to solve the issue? Yes, based on source review: resetting reused TextBlock visual state before applying selectable inlines is a narrow fix for the reported user-bubble rendering path; the remaining blocker is proof, not a different code direction.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d08a3e749973.

Label changes

Label changes:

  • add P2: This is a normal priority user-visible chat rendering bug with limited blast radius and no evidence of data loss, security impact, or crash.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body claims a current-head screenshot exists in a Copilot session, but no inspectable after-fix screenshot, recording, log, or artifact is attached to the PR. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a normal priority user-visible chat rendering bug with limited blast radius and no evidence of data loss, security impact, or crash.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body claims a current-head screenshot exists in a Copilot session, but no inspectable after-fix screenshot, recording, log, or artifact is attached to the PR. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

What I checked:

  • Focused UI reset in PR head: PR head adds a cached normal chat FontFamily and resets FontFamily, TextTrimming, MaxLines, LineHeight, CharacterSpacing, Width, MinWidth, and MaxWidth before applying user-bubble inlines. (src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs:1140, 5b9fbb1be2e2)
  • Regression coverage added: PR head adds a Tray.Tests source contract asserting the reset state appears before ApplyPlainSelectableInlines for user prompt text. (tests/OpenClaw.Tray.Tests/ChatUserBubbleTextContractTests.cs:8, 5b9fbb1be2e2)
  • Not already implemented on main or latest release: Current main and v0.6.3 contain the user-bubble ApplyPlainSelectableInlines path but not the new ChatTextFontFamilySource or reset assignments, so this PR still carries the fix. (src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs:1144, d08a3e749973)
  • Linked bug context: The linked issue reports a native chat user prompt rendering as collapsed glyphs while copy still returns the original text, matching a display-path rather than storage-path bug.
  • Proof gap: The PR body describes a screenshot from a Copilot session, but the PR body and comments do not include a viewable after-fix screenshot, recording, log, or artifact for this review to inspect. (5b9fbb1be2e2)
  • Feature history: Git blame and log tie the current user-bubble and FontFamily path to the recent native chat icon fallback and inline exec approval work, which are the best routing signals for this area. (src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs:1113, 58e363d993f2)

Likely related people:

  • shanselman: Prior merged native chat icon fallback work was merged by shanselman and included shanselman-authored follow-up commits touching the same FontFamily/rendering family, in addition to the linked bug report. (role: recent area contributor and merger of adjacent rendering work; confidence: medium; commits: 733f9c291908, bc97b817584e, 58e363d993f2; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs, tests/OpenClaw.Tray.Tests/FluentIconCatalogTests.cs)
  • Régis Brid: The most recent main commit touching OpenClawChatTimeline.cs before this PR added inline exec approval flow and changed the native chat timeline surface. (role: recent area contributor; confidence: medium; commits: 4e7982bafb86; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatRoot.cs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels Jun 28, 2026
@shanselman
shanselman merged commit 87dc3dc into main Jun 28, 2026
21 checks passed
@shanselman
shanselman deleted the fix-chat-user-bubble-rendering branch June 28, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible chat rendering issue

1 participant