Skip to content

feat(chat): add theme-aware Markdown colors - #4262

Closed
nicolasmendonca wants to merge 1 commit into
devswha:mainfrom
nicolasmendonca:feat/chat-markdown-colors-upstream
Closed

nicolasmendonca wants to merge 1 commit into
devswha:mainfrom
nicolasmendonca:feat/chat-markdown-colors-upstream

Conversation

@nicolasmendonca

Copy link
Copy Markdown

Summary

Theme-aware colors for assistant chat Markdown using existing theme tokens. Only ChatView.css and a changelog fragment; no preview scripts, Markdown examples or screenshot assets. Prose remains neutral; parser, palettes and fenced-code highlighting are unchanged.

Validation

Build, typecheck, freshness and workflow checks passed; 150 targeted tests and 25 real-client visual variants passed. Independent diff review passed. Full check fast failed in unit tests in this environment; one cache failure was reproduced on clean upstream, but remaining failures are not all baseline-classified. Native/integration lanes were not run.

Demo

Representative screenshots (same CSS rules; assets outside this diff): nicolasmendonca#1 (comment)

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Visual Improvements
    • Chat replies now use theme-aware colors for headings, details, emphasis, inline code, list markers, blockquotes, and table headers, while keeping regular text neutral and preserving existing formatting.

Agent replies now use theme-aware colors for selected Markdown elements. Prose remains neutral, and existing formatting is preserved.

Changes: Agent Reply Markdown Colors

Layer / File(s) Summary
Theme-aware Markdown styling
src/components/ChatView.css, changelog.d/chat-markdown-colors.md
Agent replies use theme-role colors for headings, strong and emphasis text, inline code, list markers, blockquote rails, and table headers. Nested strong or emphasis text inherits the enclosing color. The changelog describes the styling.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Feature

Suggested reviewers: devswha, cheol-95

Merge Risk: Minimal · up to b40a7

This change adds theme-aware colors to selected Markdown elements in agent replies, leaving prose neutral. It is a low-risk, easily reversible styling change and is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(chat): add theme-aware Markdown colors" names the main change: theme-aware colors for Markdown in assistant chat replies, which matches the ChatView.css and changelog changes. It is co…
Description check Passed The description covers the change scope (ChatView.css and a changelog fragment), the exclusions, and a detailed validation section with passed and failed checks. It also links demo screenshots. It doe…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(chat): add theme-aware Markdown colors" names the main change: theme-aware colors for Markdown in assistant chat replies, which matches the ChatView.css and changelog changes. It is concise, specific, and follows conventional commit style.

Full details: Description check

Explanation

The description covers the change scope (ChatView.css and a changelog fragment), the exclusions, and a detailed validation section with passed and failed checks. It also links demo screenshots. It does not use the template's exact headings (Change, Validation). It describes the problem and behavior only briefly, and it does not link an issue for the feature, which the template asks for. The validation section is mostly complete, with the unresolved unit-test failures stated openly.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: devswha/ovis
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 1e9cc13
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc5b78eb-b5f6-418d-bfd3-0112c7c73abe
Commits

Reviewing files that changed from the base of the PR and between 1e9cc13 and b40a7a8.

Files selected for processing: 2

  • changelog.d/chat-markdown-colors.md
  • src/components/ChatView.css

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@nicolasmendonca

Copy link
Copy Markdown
Author

This is a feature that I really wanted and implemented in my own fork of this repo. Colors in the markdown chat renderer really help me set visual cues and make it a bit easier to read long responses or plans from my agents.

Just sharing it here in case you have the same opinion. Perhaps it could be a setting in the UI that can enable markdown colors or not.

Some screenshots for demo:

Codex — dark

Codex dark: colored Markdown headings, emphasis, inline commands and list markers

Catppuccin — dark

Catppuccin dark: the same Markdown specimen using its theme colors

Codex — light

Codex light: the same Markdown specimen on the light theme

devswha added a commit that referenced this pull request Nov 26, 2026
## Change

Add a theme-like **Chat Markdown** preset picker under **Settings →
Appearance** (right below the Theme card strip) so assistant Markdown
replies can use theme-aware typography and color presets instead of a
single monochrome style or a binary toggle.

Four presets are selectable from a miniature-preview card strip
(`role="radiogroup"`, arrow/Home/End navigation, reset button),
defaulting to **`Editorial`**:

- **Editorial** (`editorial`, default) — restrained Claude/Linear-style
hierarchy: neutral strong headings with a hairline divider under `h2`,
subtle single-accent tints on list markers, blockquote rail/wash, and
non-file inline code pills, plus an elevated table header.
- **Tinted** (`tinted`) — soft two-tone theme tint across headings,
blockquotes, and inline code.
- **Colorful** (`colorful`) — syntax-colored Markdown roles driven by
the active theme's `--syntax-*` tokens (building on the direction
proposed in #4262).
- **Plain** (`plain`) — preserves the original monochrome Markdown
rendering unchanged.

### Key details
- **Scoped to assistant replies only** (`.chat-turn-agent .markdown`):
user bubbles, file previews, fenced code syntax highlighting, and
clickable file/link chips (`.markdown-file`, `.markdown-code-link`, `a >
code`) keep their existing affordances and hover/focus states.
- **Zero-FOUC boot & safe storage**: persisted under its own
`ovis:markdown-style` key (read in `src/theme-bootstrap.ts` before React
mounts, synced across tabs via `StorageEvent`, and never clobbered by
older tabs rewriting `ovis:settings`).
- **Cross-device sync**: added `"markdownStyle"` to
`SHARED_SETTING_KEYS` in `shared/preferences.ts`.
- **Theme token & contrast safety**: 100% existing CSS tokens and
`color-mix()` (no color literals or `!important`), with automated WCAG
AA (`>= 4.5:1`) contrast tests covering all 25 built-in dark and light
themes across `editorial`, `tinted`, and `colorful`
(`src/lib/themes.contrast.test.ts`).
- **i18n, docs & changelog**: added Korean, Japanese, and Simplified
Chinese settings translations, documented `markdownStyle` in
`DESIGN.md`, and added `changelog.d/chat-markdown-styles.md`.

### Screenshots (real Ovis demo, 1280px dark & light)

#### Settings → Appearance → Chat Markdown
| Dark | Light |
| --- | --- |
| ![Settings
Dark](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/settings-1280-dark.png)
| ![Settings
Light](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/settings-1280-light.png)
|

#### Editorial (default)
| Dark | Light |
| --- | --- |
| ![Editorial
Dark](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/chat-editorial-1280-dark.png)
| ![Editorial
Light](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/chat-editorial-1280-light.png)
|

#### Tinted
| Dark | Light |
| --- | --- |
| ![Tinted
Dark](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/chat-tinted-1280-dark.png)
| ![Tinted
Light](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/chat-tinted-1280-light.png)
|

#### Colorful
| Dark | Light |
| --- | --- |
| ![Colorful
Dark](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/chat-colorful-1280-dark.png)
| ![Colorful
Light](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/chat-colorful-1280-light.png)
|

#### Plain (before / monochrome baseline)
| Dark | Light |
| --- | --- |
| ![Plain
Dark](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/chat-plain-1280-dark.png)
| ![Plain
Light](https://raw.githubusercontent.com/devswha/ovis/12991874306a9aa71dc4187495cfa14e4f5577d1/chat-plain-1280-light.png)
|

## Validation

- `bun run check fast`: **pass** (`workflow syntax`, `generate:types
--check`, `generate:themes --check`, `typecheck`, `build`, and `unit`:
28,771 pass, 0 fail, 259 skip across 1,349 files).
- Includes new WCAG AA (`>= 4.5:1`) contrast assertions across all 25
built-in themes × all styled presets in
`src/lib/themes.contrast.test.ts`, storage/scope/legacy-tab survival
tests in `src/lib/settings.test.ts`, and cold-boot parity in
`src/lib/themeBoot.test.ts`.
- Built demo browser verification (`1280px` dark & light): verified
default `data-markdown-style="editorial"`, live switching across all 4
cards, `localStorage["ovis:markdown-style"]` persistence across reload,
and clickable file chip preservation.
- Skipped locally: `bun run test:integration` / `bun run test:ui`
(covered by CI).
@devswha

devswha commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thank you for proposing and building this, @nicolasmendonca! We really liked the idea of theme-aware Markdown styling in Chat, and after reviewing it we expanded the direction into a 4-preset picker under Settings → Appearance → Chat Markdown (Editorial, Tinted, Colorful, and Plain) in #4821 — including a Colorful preset directly inspired by your syntax-token styling here, with clickable file-chip preservation and WCAG AA contrast coverage across all built-in themes.

Closing #4262 in favor of #4821 (with credit there). Thanks again for sparking this!

@devswha devswha closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants