Skip to content

fix(web): render right-aligned Markdown correctly - #135

Merged
steipete merged 9 commits into
openclaw:mainfrom
jjjhenriksen:agent/fix-right-aligned-markdown
Aug 2, 2026
Merged

steipete merged 9 commits into
openclaw:mainfrom
jjjhenriksen:agent/fix-right-aligned-markdown

Conversation

@jjjhenriksen

@jjjhenriksen jjjhenriksen commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • keep unordered and ordered Markdown list markers beside their text when a message is right-aligned
  • preserve nested list hierarchy with an inline-end indent for nested lists
  • keep loose-list markers attached to the first paragraph instead of leaving standalone markers
  • mirror blockquote padding and its rule to the right side for right-aligned messages
  • add an end-to-end regression covering nested lists, loose-list paragraphs, and blockquote geometry
  • regenerate the checked-in embedded webassets

Why

Right-aligned messages applied text-align: right to the Markdown container but left native list and blockquote structure unchanged. Native outside list markers therefore stayed at the far left of the message while the list text moved right, as shown in the reported screenshot.

The fix uses inside list markers for the standard right-aligned layout, preserves nested list hierarchy, keeps loose-list markers attached to their first paragraph, and mirrors blockquote structure. Outlined message layout is excluded so its existing start-aligned Markdown behavior remains unchanged.

Browser proof

The proof run used a rebuilt local ClickClack server and generated right-aligned Markdown containing nested unordered and ordered lists, a loose list with multiple paragraphs, and a blockquote. Browser-observed geometry showed:

Right-aligned Markdown rendering

The screenshot above is attached directly to this PR description; the proof image is not part of the feature branch.

  • Markdown text alignment: right
  • outer list padding: 0px on both sides
  • nested list inline-end padding: 22px
  • list markers rendered beside their right-aligned text
  • loose-list first paragraph display: inline
  • blockquote rule: 3px on the right and 0px on the left
  • blockquote padding: 12px on the right and 0px on the left
  • no browser console errors or warnings

Validation

  • pnpm exec oxfmt --check apps/web/src/styles/messages.css tests/e2e/chat.spec.ts
  • pnpm exec oxlint apps/web/src tests/e2e/chat.spec.ts
  • pnpm typecheck
  • pnpm --filter @clickclack/web test
  • git diff --check

The focused standalone Playwright test could not launch because the local Chromium executable is not installed in the Playwright cache.

@jjjhenriksen
jjjhenriksen force-pushed the agent/fix-right-aligned-markdown branch from f79dfd4 to 4d833d9 Compare July 28, 2026 23:45
@jjjhenriksen jjjhenriksen changed the title Fix right-aligned Markdown rendering fix(web): render right-aligned Markdown correctly Jul 28, 2026
@jjjhenriksen
jjjhenriksen marked this pull request as ready for review July 28, 2026 23:46
@jjjhenriksen
jjjhenriksen marked this pull request as draft July 28, 2026 23:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d833d93aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/styles/messages.css Resolved
Comment thread apps/web/src/styles/messages.css Resolved
@jjjhenriksen
jjjhenriksen marked this pull request as ready for review July 29, 2026 02:58
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 2, 2026, 3:04 AM ET / 07:04 UTC.

ClawSweeper review

What this changes

The PR keeps Markdown list markers and blockquote rails beside text in non-outlined right-aligned web-chat messages, adds browser geometry coverage, and regenerates embedded web assets.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

This PR is still necessary: current main right-aligns the Markdown container but leaves native list padding and blockquote rails on the left. The branch supplies a focused visual repair with an end-to-end geometry regression and credible after-fix browser proof; it needs a maintainer to confirm the intentional compatibility change before merge.

Priority: P2
Reviewed head: ceaa22ddc0df0ac80d385ed1a18ba1aa238157cb
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, proof-backed rendering repair with a scoped compatibility decision and one release-process cleanup before merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The PR body provides an after-fix screenshot from a rebuilt local server and reports browser-observed list, paragraph, and blockquote geometry; the evidence directly shows the visual behavior under review.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR body provides an after-fix screenshot from a rebuilt local server and reports browser-observed list, paragraph, and blockquote geometry; the evidence directly shows the visual behavior under review.
Evidence reviewed 5 items Current-main gap: Current main applies text-align: right to the message content and Markdown container, while the base Markdown rules still use left padding for lists and a left blockquote rail; it does not contain the PR's right-side list or quote overrides.
Focused implementation and regression: The PR adds non-outlined, right-alignment-scoped list and blockquote overrides and a browser test that checks nested-list padding, loose-list marker attachment, and mirrored blockquote geometry.
Proof and review continuity: The PR body includes an after-fix screenshot from a rebuilt local server plus observed computed geometry, and the supplied prior review cycles found no unresolved correctness findings on the earlier CSS head.
Findings 1 actionable finding [P3] Remove the release-owned changelog entry
Security None None.

How this fits together

The web chat stores separate alignment preferences for the local user and other participants, then applies them as document attributes that control message-bubble CSS. Markdown is rendered inside those bubbles, so list and blockquote layout must follow the selected message side without changing outlined-message behavior.

flowchart LR
  A[Alignment preferences] --> B[Document alignment attributes]
  B --> C[Message bubble layout]
  C --> D[Markdown renderer]
  D --> E[List and blockquote CSS]
  E --> F[Right-aligned chat message]
  G[Browser geometry regression] --> E
Loading

Decision needed

Question Recommendation
Should non-outlined right-aligned messages intentionally render Markdown list markers inside the text flow and place blockquote rails on the right for both self and other messages? Accept the mirrored Markdown layout: Approve the scoped visual change, then remove the release-owned changelog line before merging.

Why: The implementation fixes the observable left-side mismatch, but it deliberately changes the presentation of existing right-aligned content; only maintainers can confirm that this is the intended compatibility contract.

Before merge

  • Remove the release-owned changelog entry (P3) - Normal pull requests should not edit CHANGELOG.md; release owners should add release notes through their own process, so remove this line from the branch before merge.
  • Resolve merge risk (P1) - Existing users of non-outlined right-aligned messages will see list markers move into the text flow and blockquote rails move from the left to the right; green checks cannot establish whether that visual compatibility change is the intended product contract.
  • Resolve merge risk (P1) - The branch also edits release-owned CHANGELOG.md; that line should not be landed through a normal PR.
  • Complete next step (P2) - A maintainer must confirm the intentional rendering compatibility change; the only mechanical cleanup is removing the release-owned changelog line.

Findings

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:6
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 10 files; 222 additions, 14 deletions The functional CSS and browser regression are accompanied by six regenerated embedded-webasset paths, so review should verify that the build output matches the accepted source change.
Visual regression coverage 1 end-to-end geometry test The test covers nested unordered and ordered lists, loose-list paragraphs, and blockquote side geometry under right alignment.

Mantis proof suggestion

A short before-and-after web-chat transcript or screenshot sequence would provide independent visual confirmation of the compatibility decision for right-aligned Markdown. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis web UI chat proof: verify and capture nested lists, loose-list paragraphs, and a blockquote in a right-aligned message, confirming markers and the quote rail stay on the message side.

Merge-risk options

Maintainer options:

  1. Confirm and accept the visual contract (recommended)
    If right-aligned messages are meant to mirror Markdown structure to the message side, retain the scoped CSS and merge after removing the release-owned changelog edit.
  2. Pause the rendering change
    If native outside markers or left quote rails are intentional compatibility behavior, do not merge this CSS path and document the preferred rendering contract first.

Technical review

Best possible solution:

Confirm the non-outlined right-aligned Markdown contract, remove the release-owned changelog entry, and merge the CSS, browser regression, and matching generated web assets if the new visual behavior is accepted.

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

Yes. Current main applies right text alignment while its base Markdown list padding and blockquote border remain left-sided; the PR's browser regression gives a concrete current-main check for that geometry.

Is this the best way to solve the issue?

Yes, conditionally. The scoped non-outlined CSS plus a browser geometry regression is the narrowest maintainable repair, provided maintainers approve the intentional visual compatibility change and remove the unrelated release-owned changelog edit.

Full review comments:

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:6
    Normal pull requests should not edit CHANGELOG.md; release owners should add release notes through their own process, so remove this line from the branch before merge.
    Confidence: 0.99

Overall correctness: patch is correct
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a user-visible Markdown rendering defect with bounded impact on users who select right-aligned message layouts.
  • merge-risk: 🚨 compatibility: Merging intentionally changes the presentation of existing non-outlined right-aligned lists and blockquotes for saved user alignment preferences.
  • 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): The PR body provides an after-fix screenshot from a rebuilt local server and reports browser-observed list, paragraph, and blockquote geometry; the evidence directly shows the visual behavior under review.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides an after-fix screenshot from a rebuilt local server and reports browser-observed list, paragraph, and blockquote geometry; the evidence directly shows the visual behavior under review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body provides an after-fix screenshot from a rebuilt local server and reports browser-observed list, paragraph, and blockquote geometry; the evidence directly shows the visual behavior under review.

Evidence

What I checked:

  • Current-main gap: Current main applies text-align: right to the message content and Markdown container, while the base Markdown rules still use left padding for lists and a left blockquote rail; it does not contain the PR's right-side list or quote overrides. (apps/web/src/styles/messages.css:868, d6ab40057386)
  • Focused implementation and regression: The PR adds non-outlined, right-alignment-scoped list and blockquote overrides and a browser test that checks nested-list padding, loose-list marker attachment, and mirrored blockquote geometry. (apps/web/src/styles/messages.css:879, ceaa22ddc0df)
  • Proof and review continuity: The PR body includes an after-fix screenshot from a rebuilt local server plus observed computed geometry, and the supplied prior review cycles found no unresolved correctness findings on the earlier CSS head. (tests/e2e/chat.spec.ts:1120, ceaa22ddc0df)
  • Main and release status: The PR head is not present on current main; the supplied latest release is v0.2.1 at 244dda650fcb3eedd100b1614c1945be1de13f5a, which predates this open PR. This remains unshipped work rather than an implemented-on-main cleanup. (apps/web/src/styles/messages.css:879, ceaa22ddc0df)
  • Relevant recent history: Recent locally available main history identifies Shakker as the contributor of the message-action overlay and its viewport regression coverage, which is the adjacent test surface changed by the PR's tolerance update. The partial clone could not retrieve older blame objects because network name resolution was unavailable, so ownership of the original alignment CSS remains low-confidence. (tests/e2e/message-reactions.spec.ts:558, 111c6128bd87)

Likely related people:

  • Peter Steinberger: Recent local main history includes substantial web-facing feature and release-credit work, and this PR's later integration/test commits were authored under this name; the available local history is insufficient to attribute the original alignment CSS conclusively. (role: recent web-area contributor; confidence: medium; commits: e455d43809a0, 8f90e48cb0f9, 67be0a4355c2; files: apps/web/src/styles/messages.css, tests/e2e/chat.spec.ts)
  • Shakker: Locally available history credits this contributor with the message-action overlay behavior and the viewport test later adjusted on this branch. (role: adjacent test-surface contributor; confidence: high; commits: ae7acaf26c8d, 111c6128bd87; files: tests/e2e/message-reactions.spec.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Remove the CHANGELOG.md entry because release notes are release-owned.
  • Obtain maintainer confirmation that the mirrored list-marker and blockquote-rail behavior is the intended right-aligned layout.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (29 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-01T14:52:33.292Z sha 59c197a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T17:33:21.763Z sha 59c197a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T20:14:46.869Z sha 59c197a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T22:37:42.033Z sha 59c197a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T23:47:49.628Z sha 59c197a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T05:08:27.796Z sha 59c197a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T06:29:29.682Z sha 8f90e48 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T06:37:49.604Z sha 67be0a4 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 29, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 31, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 1, 2026
@steipete
steipete merged commit b829398 into openclaw:main Aug 2, 2026
16 checks passed
@jjjhenriksen
jjjhenriksen deleted the agent/fix-right-aligned-markdown branch September 27, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants