Repository navigation
improve(chat): assistant Markdown follows the web chat's spacing, tones and code colors - #2101
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. |
…es and code colors Native assistant Markdown now uses the web chat's block rhythm (14px gap, 21px before later headings), softer prose with bright bold and headings, a 24px list indent with muted bullets, and web code cards with a language or "code" label and highlight.js-style syntax colors. Code and inline-code backgrounds keep the current theme brushes; compact thinking text keeps its existing spacing. Syntax colors come from a linear, regex-free classifier (ChatCodeSyntax) and are drawn as theme-resolved text highlighters over Reactor's single literal run, so selection survives re-renders and copy stays exact. Colors refresh on load, theme and contrast changes and are cleared before Reactor pools the control. High Contrast, unknown languages and oversized or token-dense blocks stay plain. Co-authored-by: Copilot App <[email protected]>
47542e4 to
0e924ba
Compare
|
Codex review: needs changes before merge. What this changesThis PR adjusts native assistant Markdown spacing, text tones, list indentation, code headers, and syntax coloring. Example: An assistant reply contains two paragraphs and a fenced TypeScript snippet: const count = 3;
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep open: this collaborator-authored PR provides useful chat polish absent from main, with two concrete documentation corrections remaining. Priority: P3 Before merge
Findings
Tests
Agent review detailsHow this fits togetherGateway conversation text enters the timeline's sanitizer and Reactor Markdown parser; presentation callbacks produce native WinUI text, lists, and selectable code cards. flowchart LR
A[Assistant message] --> B[Timeline sanitizer]
B --> C[Reactor Markdown parser]
C --> D[Chat presentation]
E[Bounded syntax classifier] --> D
F[Theme resources] --> D
D --> G[Native WinUI controls]
Technical reviewBest possible solution: Keep Reactor responsible for parsing and wrapping, retain bounded native presentation styling, and reconcile the canonical design and ownership records. Do we have a high-confidence way to reproduce the issue? The source comparison establishes the requested presentation difference, and the supplied screenshots show its mounted after-state; no build, test, or application execution was performed during this read-only review. Is this the best way to solve the issue? The change uses the existing timeline and presentation owners, preserves literal code and Reactor's wrapping Grid, and bounds syntax work; the new classifier and lifecycle state serve distinct coloring, selection, theme, and pooling requirements. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9d36f5c8bfa0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
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 Reviewed November 10, 2026, 10:57 AM ET / 15:57 UTC. |
Suspend native anchoring only while a confirmed bounded offset correction is in flight, then restore it for streaming and reader interaction. Preserve the existing navigation guards and extend resized-jump proof through later streaming. Measure completed-message ink by contrast rather than the old primary-color cutoff. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Reuse the existing deferred flyout-show owner when a bell click arrives during native closing. Wait for stable widget identity and geometry before checking Dashboard alignment, retaining the one-DIP assertion and negative controls for stable misalignment. Co-authored-by: Copilot App <[email protected]>
Use the same explicit layout synchronization as the adjacent list proof. Keep all cell-size, selection, text, formatting and literal-fence assertions unchanged, and perform optional screenshots only afterward so capture cannot supply the layout barrier. Co-authored-by: Copilot App <[email protected]>
PR cleanup reviewReviewed head: Source cleanup review at 7fd2340 against main e59374c: the Markdown/highlighter work is not superseded. Two documentation inconsistencies remain: DESIGN.md still describes 12px code corners/8px block gaps and the old brushes, and ARCHITECTURE.md:1130 still says no application-side ListItem override despite the new marker callback. More importantly, the current UI job 130062732244 crashed with LayoutCycleException after 421 passes while the changed ConversationFeedback test was active. That does not prove causation, but it is not yet an unrelated-flake case. Please resolve the failure and refresh current-head Release/high-contrast proof before landing. Action in this cleanup pass: leaving this PR open. No branch changes or runtime-proof waiver. The findings above come from source, discussion and recorded-CI review; Windows validation was not rerun in this pass. |
Keep a revalidated tail-row anchor during bounded offset correction and confirm follow moves against the current logical tail. Preserve staged native realization, reader cancellation, and the existing strict conversation proofs. Co-authored-by: Copilot App <[email protected]>
Keep the bounded, identity-checked native anchor needed by the resized-jump regression. Restore the existing streamed-follow path instead of giving every follow request initial-landing retries and completion-time rearming. Preserve the resized-jump, continued streaming, reader cancellation and anchoring restoration proofs. Co-authored-by: Copilot App <[email protected]>
main openclaw#2101 moved assistant Markdown to the web chat's 14-pixel block gap, with list, marker, divider and code-syntax hooks. A message that contains a disclosure still stacked its parts at the old 8-pixel gap, so the text around a disclosure and the blocks of its body sat tighter than the rest of the message. Disclosures now share MessageBlocks' rhythm, including the compact 8-pixel gap in thinking text. Markdown after a disclosure is rendered as its own block stack, so its first heading lost the 7-pixel lead-in a heading keeps after any other block. The renderer now learns whether a part leads its message or disclosure body, and only a leading part drops that lead-in. This PR deletes the source-text ReactorChatMarkdownContractTests, which openclaw#2101 extended. Its list, ordered-marker and thematic-break hook checks become mounted assertions in ReactorMarkdownWebParityProofTests; code syntax and highlighter cleanup were already covered there, and list wrapping by the disclosure proof. The list-layout ledger row now states that the ListItem hook only restyles and places the marker.
What Problem This Solves
Native assistant Markdown should follow the web chat's reading rhythm, text tones and code colors.
User Impact
User impact: replies have clearer spacing, softer prose, stronger headings, indented lists and syntax-colored code cards. Windows theme backgrounds, exact copying, selection and compact thinking text are preserved.
Why This Change Was Made
Markdown uses a 14px block gap, 21px heading lead-in and 24px list indent. A bounded, regex-free classifier applies theme-aware syntax colors without rebuilding literal code or losing selection. High Contrast, unknown languages and oversized blocks stay plain.
Follow-up fixes preserve the latest reply after resizing, retain an Inbox bell click during native flyout closing, and wait for Dashboard entrance animations before measuring alignment. Pixel proof uses a 4.5:1 contrast threshold; the existing pixel-retention and one-pixel geometry assertions remain. Latest main's fixture policy is retained unchanged.
The tail repair is limited to the existing bounded initial/jump offset correction. It keeps a revalidated native tail anchor during correction and restores normal anchoring afterward. The extra initial-confirmation mode for every streamed follow request and its completion-time rearming were removed. Normal streaming follows its existing path; the resized-jump and continued-streaming regression remains unchanged.
The existing table proof now explicitly performs native layout before checking cell bounds. Optional screenshots run afterward, so capture cannot supply a missing layout step. Table content, wrapping, selection, formatting and width assertions are unchanged.
Evidence
The three requested fixture reruns now pass: Inbox reopening and aging, Settings pane persistence, and Dashboard alignment in Light/Dark. Four companion readiness/layout checks also pass, including negative controls that still reject stable misalignment.
These are the original feature captures, not new screenshots of the cleanup. Independent review of the reduced CI repairs found no significant issues. CI for the reduced candidate.
The reduced candidate passed all 26 focused native regressions. A broader same-host comparison selected 200 candidate cases and 198 baseline cases: the candidate had no new failures, and all 43 shared failures had identical normalized error messages. These local DPI-sensitive failures remain failures, not passing proof; hosted x64 CI is a separate required gate.
Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: native Markdown, resize/jump/streaming, Inbox flyout and Dashboard layout.Validation
Windows ARM64, isolated profiles. The following runs used the source committed as
c5d4bd369aacee2f4a2082f37a798dd574874293. Candidate file hashes were recorded before and after the local closeout; the short-path UI proof checkout was checked against that manifest..\build.ps1: passed.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 5,615 passed, 0 failed, 28 opt-in skips.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 6,154 passed, 0 failed, 0 skipped.git diff --check: passed.ffc16328150 passed, 44 failed, 4 skipped. No new candidate failures; all 43 shared failures have identical normalized errors. The candidate adds two Markdown cases; the baseline also failed the unchanged claw-motion case.c5d4bd36, including CI Gate, hosted UI/accessibility, Mock Gateway, Shared/Tray/CLI lanes, WSL E2E and MSIX checks. Both hostedConversationFeedbackwidths passed. CodeQL: passed.offset=167,maximum=1679,viewport=586) exactly matches earlier main failures in jobs129771483447and129712168275. The other failure was a WebView2 relay timeout in unchanged Dashboard code. After verifying baseline evidence and passing focused local cases, failed jobs were retried once. No test was skipped or assertion weakened to obtain the green result.The older fixture and capture runs below are retained as historical evidence, not relabeled as fresh execution on this candidate.
Exact reduced-candidate native commands
Focused regressions, with all three profile roots isolated:
Result: 26 passed. The two conversation cases preserve reader cancellation, the 14px spacing, resized jumps, restored bottom anchoring and subsequent streaming.
Broader comparison, run on both the reduced production variant and baseline:
Results and limits are listed above. No failing assertion was removed, widened or hidden to obtain a pass.
Exact follow-up test command
Latest capture-disabled Markdown check:
Result: 14 passed. A separate
--no-build --no-restore --filter 'FullyQualifiedName~ReactorMarkdownTableProofTests'run withOPENCLAW_VISUAL_TEST=1also passed, 1/1.Earlier Inbox/Dashboard follow-up:
OPENCLAW_RUN_GATEWAY_FIXTURE_UI=1andOPENCLAW_RUN_KEYBOARD_PROOF=1were process-scoped;OPENCLAW_GATEWAY_FIXTURE_APPselected the current Debug ARM64 executable, with isolated profile/artifact directories and owned-window capture.Result: 7 passed, 0 failed, 0 skipped.
Real Behavior Proof
c5d4bd36; historical table capture7fd23401and Inbox/Dashboard proofaae55754.Passed: 26, Failed: 0, Skipped: 0. Historical app/capture commands and results remain above.Yes/No/N/A): Yes for the retained historical images; no new screenshot is claimed for this control-flow reduction.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain the risk and mitigation: N/A. Markdown remains inert.Compatibility and Migration
Yes/No): YesYes/No): NoYes/No): NoReview Conversations