Skip to content

fix(desktop): darken light-mode code comment color for legibility#36234

Merged
OutThisLife merged 1 commit into
mainfrom
bb/fix-bash-comment-contrast
Jun 1, 2026
Merged

fix(desktop): darken light-mode code comment color for legibility#36234
OutThisLife merged 1 commit into
mainfrom
bb/fix-bash-comment-contrast

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

  • Bash/shell code blocks rendered nearly invisible in the desktop chat: Shiki's github-light-default theme colors comment tokens #6e7781, only ~4.2:1 contrast against the code card background (fails WCAG AA, worse at the 11px code font size).
  • Shell makes this especially bad — a single # turns the rest of the line into one long comment span, so almost the whole snippet renders in that weak gray.
  • Fix: remap light-mode comments to GitHub's darker muted gray #57606a (~6.4:1) via per-theme Shiki colorReplacements in apps/desktop/src/components/chat/shiki-highlighter.tsx. Dark mode (#8b949e, ~6.1:1) already reads fine and is left untouched.

This uses Shiki's native colorReplacements (remap at tokenization) rather than fighting the inline light-dark() colors with CSS !important. #57606a is an existing GitHub palette gray, so highlighting stays visually coherent.

Test plan

  • npm run type-check passes
  • No new lint errors
  • Visually confirm bash/shell comments are legible in light mode
  • Confirm dark mode highlighting is unchanged

Shiki's github-light-default colors comments #6e7781 (~4.2:1 on the code
card background), which is borderline unreadable at the 11px code font
size — and worst for shell snippets, where a single `#` turns the rest
of the line into one long comment span. Remap light-mode comments to
GitHub's darker muted gray (#57606a, ~6.4:1) via per-theme
colorReplacements. Dark mode (~6.1:1) reads fine and is left untouched.
@OutThisLife OutThisLife merged commit 0bc616e into main Jun 1, 2026
17 of 19 checks passed
@OutThisLife OutThisLife deleted the bb/fix-bash-comment-contrast branch June 1, 2026 04:22
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: bb/fix-bash-comment-contrast vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9570 on HEAD, 9570 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4959 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have labels Jun 1, 2026
JoeKowal pushed a commit to JoeKowal/hermes-agent that referenced this pull request Jun 4, 2026
…usResearch#36234)

Shiki's github-light-default colors comments #6e7781 (~4.2:1 on the code
card background), which is borderline unreadable at the 11px code font
size — and worst for shell snippets, where a single `#` turns the rest
of the line into one long comment span. Remap light-mode comments to
GitHub's darker muted gray (#57606a, ~6.4:1) via per-theme
colorReplacements. Dark mode (~6.1:1) reads fine and is left untouched.
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
…6234)

Shiki's github-light-default colors comments #6e7781 (~4.2:1 on the code
card background), which is borderline unreadable at the 11px code font
size — and worst for shell snippets, where a single `#` turns the rest
of the line into one long comment span. Remap light-mode comments to
GitHub's darker muted gray (#57606a, ~6.4:1) via per-theme
colorReplacements. Dark mode (~6.1:1) reads fine and is left untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants