Repository navigation
fix: match inline code chips to the chat theme - #2307
paulcam206 merged 2 commits into
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 changesInline-code backgrounds now follow the displayed chat theme when it differs from the application theme. Example: The application uses Light mode while chat uses Dark mode and displays
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current theme mismatch with a focused change and no actionable findings; keep it open for landing once its draft status is resolved. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe native Markdown presentation layer takes rendered assistant text and applies theme-aware text highlighters while preserving Reactor's text, selection, and sanitization ownership. flowchart LR
A[Assistant Markdown] --> B[Safe timeline renderer]
B --> C[Mounted native text]
C --> D[Inline presentation]
E[Chat element theme] --> D
D --> F[Theme matched code chip]
Technical reviewBest possible solution: Land the existing theme-color lookup repair and its mounted regression while preserving foreground styling and the High Contrast bypass. Do we have a high-confidence way to reproduce the issue? Current main retains the application-brush lookup responsible for the mismatch; the supplied negative controls and inspected before/after images cover both opposite-theme pairings. Is this the best way to solve the issue? The patch is the smallest complete repair: reuse the existing theme-color resolver inside the current presentation owner and retain one native regression against an independent XAML resource. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0d74aee5f723. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat 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 HistoryReview history (1 earlier review cycle)
Reviewed November 18, 2026, 1:26 PM ET / 18:26 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What Problem This Solves
In Windows-default chat, an inline code chip can use the wrong background when chat and the app use opposite light and dark modes. This makes the code harder to read, especially when dark chat gets a light chip.
User Impact
User impact: Inline code in Windows-default chat uses the background for the theme the chat is actually displaying.
Why This Change Was Made
The chip now resolves the native Fluent color in the rendered chat element's theme instead of using an application-wide brush. It keeps the same Fluent token and still leaves styling to Windows in High Contrast.
Evidence
The new test mounts real assistant Markdown underneath a theme override and checks the fill of the exact inline-code range against a native XAML theme resource. Both app/chat pairings failed on
212fac114f6fd547fee43e81d1bfdae4b8b4845a; both pass with the fix.Actual Companion, not the test window. On an owned Windows 11 x64 desktop, Windows' app mode was Light and the isolated Companion profile requested Dark. The repository's loopback fixture (
chat-interactive,nested-tools) returned a synthetic reply with inline code6f37c2d82. UI Automation confirmed that exact text was on screen before capture. The dark chip is visible around it below. The foreground was not changed. No provider or host command ran.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: mounted assistant Markdown appearance in both opposite-theme pairings.Validation
./build.ps1: all five Debug win-x64 projects built.dotnet build .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-x64 --no-restore: passed; the transferred test and production assembly hashes matched on the guest.dotnet vstest OpenClaw.Tray.UITests.dll /TestCaseFilter:FullyQualifiedName~InlineCodeChip_FollowsTheChatThemeRatherThanTheApplicationTheme: red before (1 failed per pairing at the expected color assertion), green after (1 passed per pairing, 0 skipped).dotnet vstest OpenClaw.Tray.UITests.dll /TestCaseFilter:FullyQualifiedName~ReactorMarkdown: 8 passed, 0 failed or skipped../scripts/validate-docs.ps1: 74 files and the proof-pool documentation gate passed;git diff --check: clean.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 5,906 passed, 29 environment/opt-in skips, 0 failed on the final serial run.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 6,755 passed, 0 failed or skipped on the provisioned guest.Local ClawSweeper
review --local-rangecompleted on this head against212fac114f6fd547fee43e81d1bfdae4b8b4845a: no code findings, security cleared. Its offline report asked for candidate runtime and managed results, not a code revision. Independent P0–P3 review found no actionable defect. The two questions raised by the WinUI rubber-duck review were covered on the guest: the negative control failed in both app themes, and the screenshots show foreground is unchanged.Initial hosted UI job read the chip before the deferred restyle completed. The test now waits for the same independent color assertion, not just for
ActualThemeand an existing highlighter. No expected value or timeout changed. TheReactorMarkdownfilter then passed 8/8 in each of two fresh processes (OPENCLAW_UI_TEST_APP_THEME=LightandDark). The full build was repeated; Shared and Tray code/tests did not change. Current-head CI.Real Behavior Proof
0958f001e9f24288bf59986fcc1b0e24218e9295for the updated mounted regression. Full Companion capture uses the product build from70842ad3dd0ca7ceec9a4e82c6b722c9cf538ccf; only the test file changed between heads.Validationin a fresh test process withOPENCLAW_UI_TEST_APP_THEME=Light, and again withDark. The test mounts Markdown under the opposite element theme.#80F9F9F9corrected to#15FFFFFF. App Dark/chat Light:#15FFFFFFcorrected to#80F9F9F9. The adjacent Markdown test still clears and restores highlighters on the existing High Contrast test probe.Security Impact
Yes, explain the risk and mitigation:Compatibility and Migration
Review Conversations