[Bug]: html_render lines and markers vanish with a custom theme whose accent is dark#26872

opened16d agobyVvid-t

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. In Settings → Appearance, create and select a custom dark theme whose accent is dark. Mine renders the accent at about #21180e on a canvas of about #161515.
  2. In any thread, have the agent call html_render with a diagram or chart whose lines and markers use the accent-based theme variables. Minimal example:
html
1<svg width="320" height="80" viewBox="0 0 320 80">
2 <circle cx="20" cy="40" r="6" style="fill:var(--chart-1)"/>
3 <path d="M20 40 C120 0 200 80 300 40" style="fill:none;stroke:var(--chart-1);stroke-width:2"/>
4 <circle cx="300" cy="40" r="6" style="fill:var(--accent)"/>
5</svg>
  1. Look at the rendered visual.
  2. Switch to the default theme and look at the same visual.

Expected behavior

Lines and markers drawn with the theme's chart and accent colours stay visible against the visual's background, as they do with the default theme.

Actual behavior

With my custom theme, the arrows and pointer dots in a memory diagram nearly disappear. They render at about #21180e on a #161515 background, a contrast ratio of about 1.04:1. With the default theme, the same elements render in the default accent blue at about 4.2:1. Those arrows carry the diagram's meaning, so the visual becomes unreadable. Colours and ratios are measured from the attached screenshots.

Possible cause (from reading main, not verified): htmlRenderTheme in packages/shared/src/htmlRender.ts passes the theme's accent straight through as --accent and --chart-1. Nothing checks their contrast against --background, so a custom theme with a dark accent on a dark canvas gives visuals invisible lines.

Related but different: #25907 (default dark theme background mismatch) and #16306 (colour format, closed and fixed in 0.1.3).

Impact

Major degradation or frequent failure

Version or commit

0.1.3

Environment

T3 Code desktop app on macOS (MacBook), connected to a T3 Code 0.1.3 server on macOS (Apple silicon). Custom theme. Agent: Claude Code (Opus 5.5).

Screenshots, recordings, or supporting files

Screenshots of the same visual with the default theme and with my custom theme are in the first comment.


Drafted with Claude Code (Opus 5.5).