Skip to content

fix(android): render chat content through Markdown - #88899

Merged
steipete merged 2 commits into
openclaw:mainfrom
Pluviobyte:fix/android-chat-markdown-width
Jul 3, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
Pluviobyte:fix/android-chat-markdown-width

Conversation

@Pluviobyte

@Pluviobyte Pluviobyte commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Closes #88014.

Android's active chat screen bypassed ChatMarkdown unless a small text heuristic recognized Markdown syntax. Bare URLs, leading lists or quotes, and underscore emphasis could therefore appear as raw text even though the shared renderer supports them.

Why This Change Was Made

  • Route every active chat message through the existing ChatMarkdown owner, matching the sibling chat surface.
  • Remove the incomplete syntax detector instead of extending a second Markdown parser.
  • Expose the existing CommonMark parse step for focused block-routing tests.
  • Drop the original width edits because current main and v2026.6.11 already contain the wider bubble layout.

User Impact

Links, lists, quotes, emphasis, code, and plain text now take one consistent rendering path. Existing safe-link and bounded data-image restrictions remain unchanged.

Evidence

  • Focused Android Markdown unit tests, ktlint, Play debug assembly, and native-i18n inventory check passed.
  • Full exact-head CI passed, including Android Play/third-party tests and build.
  • Android 16 emulator against a real isolated OpenClaw Gateway reproduced raw bare links and leading list markers on current main; this head rendered a clickable link and bullet list in the same persisted state.
  • Before/after screenshots and live setup details: fix(android): render chat content through Markdown #88899 (comment)
  • Fresh Codex autoreview: clean, no actionable findings.

Proof gap: no physical Android device; emulator used.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 1, 2026
@clawsweeper

clawsweeper Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 12:27 AM ET / 04:27 UTC.

Summary
The branch removes ChatScreen’s Markdown heuristic, routes active Android chat text through ChatMarkdown, adds Markdown parser regression coverage, and syncs native i18n line metadata.

PR surface: Other +17. Total +17 across 4 files.

Reproducibility: yes. Source inspection on current main shows active ChatScreen still bypasses ChatMarkdown for text outside the heuristic, and the inspected before/after emulator screenshots show URL/list Markdown behavior changing after the fix.

Review metrics: 1 noteworthy metric.

  • Linked issue coverage: 2 symptoms: 1 fixed here, 1 already mostly handled on main. The linked issue combines raw Markdown and narrow bubbles, while this current branch only needs to carry the Markdown fix.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #88014
Summary: This PR is the focused candidate fix for the Markdown rendering half of the linked Android chat readability issue; current main already appears to cover the width half, and the broader spacing PR is not a safe replacement target.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • Update the PR title/body so they describe the current Markdown-only diff plus native i18n inventory sync.
  • [P2] Wait for required current-head CI jobs to finish before merge.

Risk before merge

  • [P1] The PR title and body still advertise bubble-width and layout-test changes that are no longer in the current diff; merge and release context should be narrowed to the Markdown-only code change plus i18n inventory sync.
  • [P1] Several required CI jobs were still running for current head at review time, so maintainers should wait for the current-head gates before landing.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused Android Markdown fix after aligning the PR title/body with the current diff and letting current-head CI finish; keep broader chat spacing work separate.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair lane is appropriate; the code patch is narrow and the remaining action is maintainer review, PR metadata cleanup, and current-head CI follow-through.

Security
Cleared: No concrete security or supply-chain concern was found; the diff is limited to Android UI Markdown routing, tests, and native i18n line metadata.

Review details

Best possible solution:

Land the focused Android Markdown fix after aligning the PR title/body with the current diff and letting current-head CI finish; keep broader chat spacing work separate.

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

Yes. Source inspection on current main shows active ChatScreen still bypasses ChatMarkdown for text outside the heuristic, and the inspected before/after emulator screenshots show URL/list Markdown behavior changing after the fix.

Is this the best way to solve the issue?

Yes for the code path. Reusing the existing ChatMarkdown renderer matches the sibling ChatMessageViews invariant and removes the duplicate heuristic; the PR metadata should be narrowed because width is no longer part of the branch.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This PR targets a normal-priority Android chat readability bug with limited blast radius and a clear linked issue.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Sufficient screenshot proof shows before/after Android emulator behavior with a real Gateway setup: bare URLs and leading lists render as Markdown after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient screenshot proof shows before/after Android emulator behavior with a real Gateway setup: bare URLs and leading lists render as Markdown after the fix.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Sufficient screenshot proof shows before/after Android emulator behavior with a real Gateway setup: bare URLs and leading lists render as Markdown after the fix.
Evidence reviewed

PR surface:

Other +17. Total +17 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 4 49 32 +17
Total 4 49 32 +17

What I checked:

Likely related people:

  • obviyus: Recent path history shows repeated work in ChatScreen, ChatMarkdown, and ChatMessageViews, including Markdown safety and chat content filtering near this surface. (role: recent Android chat area contributor; confidence: high; commits: 4712931e71ee, d86ed21f3d6c, 4f8740029a0d; files: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMarkdown.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMessageViews.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt)
  • Tosko4: Recent history includes offline chat, live chat context usage, and companion shell work in the same active Android chat surface. (role: recent Android ChatScreen contributor; confidence: high; commits: f2abf57d32ad, 826ea2bf8513, 9159b3bf8e47; files: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt)
  • neeravmakwana: Path history shows the Android chat link-tappability change in ChatMarkdown, adjacent to this PR's link/autolink behavior. (role: adjacent Android Markdown contributor; confidence: medium; commits: 07d2043081e3; files: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMarkdown.kt)
  • joshavant: Recent path history includes work on sent-message history in the same active ChatScreen flow. (role: recent Android chat flow contributor; confidence: medium; commits: 485446af8c95; files: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt)
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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jun 1, 2026
@byungskers

Copy link
Copy Markdown

I like the simplification here, especially removing the heuristic markdown detector. I'd still be more comfortable with one focused regression test for a plain-text message path, since the behavioral change is bigger than the width tweak: all chat text now goes through ChatMarkdown. A small test proving plain text still renders without odd formatting/autolink regressions would make the intent much clearer.

@Pluviobyte
Pluviobyte marked this pull request as ready for review June 1, 2026 04:15
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 1, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 1, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 1, 2026
@Pluviobyte

Copy link
Copy Markdown
Contributor Author

Pushed c98a6d1c with a focused regression test for the plain-text active chat bubble path.

What changed:

  • extracted the ChatScreen bubble content/text route into small internal helpers so the test can cover the same path used by active chat bubbles
  • moved the plain-text literal rendering assertion from the generic Markdown test into ChatScreenLayoutTest
  • the test asserts plain text remains literal after the ChatBubble path feeds it through the Markdown inline renderer: no spans and no link annotations

Validation:

  • git diff --check -> passed
  • Android Gradle test could not run locally because this machine has no Java/JDK (Unable to locate a Java Runtime)

I also checked the current checks-windows-node-test failure log; it appears to be a Windows runner checkout/fetch issue (fatal: fetch-pack: invalid index-pack output, then timeout), not an Android test failure.

@Pluviobyte

Copy link
Copy Markdown
Contributor Author

Follow-up on the latest check state after c98a6d1c: the Android-specific checks now pass, including android-test-play, android-test-third-party, and android-build-play.

The remaining failure I see is build-artifacts, failing in pnpm ui:i18n:check with raw-copy baseline drift in ui/src/ui/app-render.ts for strings such as Workshop view, Board view, and Today view. That file is not touched by this Android chat-bubble PR.

I tried to rerun the failed workflow from my side, but GitHub denied it with Must have admin rights to Repository. Please rerun or handle the UI i18n baseline separately if branch protection still requires this job.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Jun 10, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 10, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jun 10, 2026
@steipete steipete self-assigned this Jul 3, 2026
@steipete
steipete force-pushed the fix/android-chat-markdown-width branch from fd9eab1 to 8a54fcd Compare July 3, 2026 03:22
@openclaw-barnacle openclaw-barnacle Bot removed the app: web-ui App: web-ui label Jul 3, 2026
@steipete

steipete commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Rewritten head: emulator + real Gateway proof

The contributor branch is now rebased at exact head 954df8a0ca132b2bfe0b80b0a35592e419feb176. The stale width changes and unrelated UI/dead-code files are gone; the remaining production change routes all chat text through ChatMarkdown, with focused parser coverage for leading lists/quotes and underscore emphasis. The fourth changed file is the mechanically synced native-i18n line inventory required by CI.

Before — current main

Bare URLs are plain white text and the leading - list marker is rendered literally.

Android chat before: plain URL and raw list marker

After — exact PR head

The URL is styled/clickable and the same leading list is rendered as a bullet.

Android chat after: styled URL and rendered bullet list

Both APKs used the same Android 16 emulator state and the same isolated, real OpenClaw Gateway. Validation:

ANDROID_HOME="$HOME/Library/Android/sdk" ./gradlew :app:testPlayDebugUnitTest --tests ai.openclaw.app.ui.chat.ChatMarkdownTest :app:ktlintCheck :app:assemblePlayDebug

pnpm native:i18n:check

Fresh Codex autoreview: clean, no actionable findings. Known gap: emulator only; no physical Android device was available.

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 3, 2026
@steipete
steipete force-pushed the fix/android-chat-markdown-width branch from 954df8a to b529b07 Compare July 3, 2026 04:02
@steipete
steipete force-pushed the fix/android-chat-markdown-width branch from b529b07 to 74914e2 Compare July 3, 2026 04:22
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 3, 2026
@steipete steipete changed the title fix(android): widen chat bubbles and render markdown consistently fix(android): render chat content through Markdown Jul 3, 2026
@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Land-ready on exact head 74914e2b8b9982c6a79bee583d071c3efff05f35.

Maintainer rewrite complete:

  • one canonical ChatMarkdown route; incomplete raw-text heuristic removed
  • focused coverage for bare URLs, leading lists/quotes, and underscore emphasis
  • stale width and unrelated files removed; generated native-i18n inventory refreshed

Validation:

  • ANDROID_HOME="$HOME/Library/Android/sdk" ./gradlew :app:testPlayDebugUnitTest --tests ai.openclaw.app.ui.chat.ChatMarkdownTest :app:ktlintCheck :app:assemblePlayDebug
  • node --import tsx scripts/native-app-i18n.ts check
  • fresh Codex autoreview: clean, no actionable findings
  • exact-head CI run 28638244755: all required Android, lint, type, build, QA, and test checks green
  • Android 16 emulator + real isolated Gateway: current-main before and exact-head after screenshots for bare link and leading list behavior: fix(android): render chat content through Markdown #88899 (comment)

Known proof gap: no physical Android device; emulator used.

@steipete
steipete merged commit df350e6 into openclaw:main Jul 3, 2026
89 checks passed
@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 3, 2026
* fix(android): render all chat text as Markdown

Co-authored-by: Pluviobyte <[email protected]>

* chore(android): sync native i18n inventory

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Pluviobyte <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S stale Marked as stale due to inactivity status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: Markdown not rendered and chat messages too narrow

3 participants