Repository navigation
fix(ui): preserve code formatting in human messages - #186779
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR restores shared code formatting and horizontal scrolling in human messages while keeping folded previews non-scrollable. Example: A human sends a fenced JavaScript block with an indented return statement and a long function call at a 390px viewport.
Review scores
ProductKind: Preference · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a current rendering problem, resolves the previous spacing finding, and has no remaining actionable findings; normal CI gates are still pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherControl UI renders saved human-message Markdown as static pre and code elements; shared chat CSS controls their presentation, while the existing message disclosure controls long-message previews. flowchart LR
A[Human message Markdown] --> B[Chat message presentation]
B --> C[Shared Markdown renderer]
C --> D[Static code elements]
D --> E[Shared chat code styles]
E --> F[Message disclosure preview]
Technical reviewBest possible solution: Use the existing shared code styles and disclosure owner, preserving nested message spacing through --chat-block-gap. Do we have a high-confidence way to reproduce the issue? Current-main CSS directly explains the reported rendering, and the supplied before screenshots show it; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch is the smallest complete repair: remove the conflicting human-code overrides, preserve the existing static renderer, and prevent folded code from becoming a hidden keyboard scroll target. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e6d93baabf7a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -16, Tests +10. Total -6 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 30, 2026, 12:18 AM ET / 04:18 UTC (Revision 2). |
a699ff7 to
11449c1
Compare
|
Updated the stack with the scoped CI repairs and current main. The PR body contains the refreshed validation and, where applicable, the nested-code spacing comparison. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Closes #186778
What Problem This Solves
Fixes code fences and indented code rendering as prose inside human chat messages.
User Impact
Code blocks retain their lines and indentation, use a monospaced font and a distinct surface, and scroll horizontally without widening the message or chat. Existing bubble styling and inline code are preserved.
Why This Change Was Made
Remove the human-message overrides that undo the shared code styles, while retaining static rendering without assistant toolbars. Folded messages remain previews: expanding with Show more enables code scrolling and keyboard access, so hidden code cannot steal focus or shift the folded content.
Evidence
The captures below use the actual OpenClaw UI and a test conversation. Desktop images are cropped from viewport frames; the sample text is unchanged.
Follow-up validation
Nested human code now uses the existing chat block-spacing token, preserving the surrounding 14px rhythm independently of the restored 12px mobile code font. The existing spacing regression fails with the former
1emmargin and passes with the token.The stack incorporates main
8dad19d8b7b, including the already-landed idle-render, typography sampling, and provider-notice fixes. The combined tree passed 24 focused presentation/contrast/browser tests, 39 code/table/disclosure/attachment E2E cases, stylesheet lint, targeted lint, formatting, and the UI typecheck. The scoped repair also passed independent review.The mobile comparison below uses the same mocked-Gateway conversation and integrated source tree; only the nested-code margin differs.