Skip to content

fix(tui): reassign Dune to dark Claude Code colorblind palette#713

Open
euxaristia wants to merge 7 commits into
Gitlawb:mainfrom
euxaristia:fix/dune-claude-dark-theme
Open

fix(tui): reassign Dune to dark Claude Code colorblind palette#713
euxaristia wants to merge 7 commits into
Gitlawb:mainfrom
euxaristia:fix/dune-claude-dark-theme

Conversation

@euxaristia

@euxaristia euxaristia commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Dune was rendering as a light/sandy theme with a creamy white background, which did not match Claude Code's dark colorblind (daltonized) mode. This reassigns Dune to a genuinely dark theme based on openclaude's dark-daltonized palette.

Changes

  • internal/tui/theme_palettes.go
    • Rebased dunePalette on a near-black surface (panel #0e0e10) instead of the 55/55/55 user-message bubble grey, so it matches Claude Code's dark canvas rather than just the user-bubble color.
    • Kept the brand-orange accent (#ff9628, from openclaude dark-daltonized claude/brand) and the daltonized status colors (blue success, red error, amber warning, blue permission).
    • Moved the warm grey to promptBg (the submitted user-prompt bubble) only.
    • Brightened the muted/faint/faintest gray ramp and darkened selBg/addBg/delBg/addBgWord/delBgWord so every WCAG-AA and xterm-256 contrast invariant holds (verified via the existing theme_select_test.go suite).
  • internal/tui/theme_select_test.go
    • Updated TestNewThemePresetsWired which incorrectly asserted Dune was a light theme; Dune is now dark.

Test plan

  • go test ./internal/tui/ -run 'Theme|Palette|Dune|Contrast|ANSI|Diff|Hierarchy|Wired' -count=1 — passes.
  • go test ./internal/tui/ -count=1 — full package passes.
  • go vet ./internal/tui/ — clean.
  • Manual: /theme dune now renders a near-black surface with the orange accent and blue/red daltonized diffs.

Refs #709

Summary by CodeRabbit

Summary

  • Theme updates
    • Refreshed the Dune TUI color palette with a darker, daltonized colorblind-friendly scheme for improved contrast and readability.
    • Updated selection and diff change-highlighting colors, including inline word-span add/delete styling, to stay clearly distinct in 256-color mode.
    • Marked the Dune theme as a dark theme so it renders with correct dark-theme behavior.
  • Documentation
    • Updated Dune theme documentation to match the new dark, near-black palette and accent styling.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The Dune TUI theme changes from a warm light-style palette to a near-black, colorblind-friendly dark palette. Registry metadata, documentation, and ANSI256 contrast tests are updated, and a daemon drain test now waits for active worker tracking.

Changes

Dune theme

Layer / File(s) Summary
Dune dark palette and registration
internal/tui/theme_palettes.go
Replaces the warm palette with dark colors and registers Dune as a dark theme before the light themes.
Theme validation and documentation
internal/tui/theme_select_test.go, docs/THEMES.md
Updates the dark-theme assertion, adds ANSI256 diff-color and contrast checks, and documents the new palette.

Daemon drain test

Layer / File(s) Summary
Worker tracking synchronization
internal/daemon/pool_test.go
Waits for the worker to appear in WorkerStats so the drain test observes the active worker set.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • Gitlawb/zero#334 — Modifies TUI diff and added-line color styling.
  • Gitlawb/zero#354 — Modifies TUI theme registration and related contrast validation.
  • Gitlawb/zero#778 — Modifies TUI permission-card color styling affected by theme palettes.

Suggested reviewers: gnanam1990, anandh8x, vasanthdev2004

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: Dune is reassigned to a dark Claude Code colorblind palette.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 17, 2026
Vasanthdev2004
Vasanthdev2004 previously approved these changes Jul 17, 2026

@Vasanthdev2004 Vasanthdev2004 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small, clean change: Dune is reassigned from the warm light-sand palette to a dark, daltonized palette with IsDark correctly flipped to true, and the wiring test is updated to match. The full tui suite passes, including the truecolor and xterm-256-quantized WCAG-AA contrast guards covering Dune's selected-row, diff-band, and status-color pairs, so the new colors hold up on 256-color terminals too. No objections — approving.

@euxaristia
euxaristia marked this pull request as ready for review July 20, 2026 07:25
@euxaristia
euxaristia force-pushed the fix/dune-claude-dark-theme branch from 4631efa to da6cb17 Compare July 20, 2026 11:16
@euxaristia

Copy link
Copy Markdown
Contributor Author

Status

  • Rebased onto latest main (was 261 commits behind). Clean, no conflicts.
  • Diff remains 2 files: internal/tui/theme_palettes.go, internal/tui/theme_select_test.go.
  • Local: go test ./internal/tui/ -run 'Theme|Palette|Dune|Contrast|ANSI|Diff|Hierarchy|Wired' -count=1 passes.
  • No unresolved review threads. mergeable=MERGEABLE, blocked only on REVIEW_REQUIRED.
  • CI: ubuntu/macos smoke, security, perf smoke, Zero Review, CodeRabbit are green.
  • Windows smoke failed twice on unrelated flakes after the rebase:
    1. TestRunExecOptimizedSessionUnderGate (prewarm HEAD probes = 0) in internal/cli
    2. TestPoolDrainKillsStraggler in internal/daemon
      Neither path is touched by this palette change. Cannot re-run failed jobs (no admin on Gitlawb/zero). A maintainer re-run of Windows smoke should clear this if it is pure flake.

Ready for human review/approval.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 20, 2026

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found issues that need to be addressed before this is ready.

Findings

  • [P2] Preserve Dune's diff identity on ANSI-256 terminals
    internal/tui/theme_palettes.go:455
    In a 256-color terminal, the repository's own xterm256Hex algorithm maps both addBg (#0a1f14) and delBg (#240a0e) to #121212; it likewise maps both word-span backgrounds to #303030. Added and removed diff bands therefore become identical (and the base bands blend into the panel) for Dune users, contrary to the claimed colorblind/xterm behavior. Choose backgrounds that quantize to distinct green/red entries and add Dune equivalents of the existing Neon ANSI-256 diff assertions.

  • [P2] Update the public Dune description
    docs/THEMES.md:12
    The guide still says Dune is a warm sand-and-cream palette with charcoal ink and a soft amber accent. This change makes the same user-selectable theme near-black with white/orange and daltonized blue/red signals, and registers it as dark. Update the documentation with the new appearance so --theme dune, ZERO_THEME=dune, and the picker are described consistently.

@euxaristia

Copy link
Copy Markdown
Contributor Author

Pushed a fixup addressing both open findings:

  1. Dune's addBg/delBg (#0a1f14/#240a0e) both quantized to the same xterm-256 gray (#121212), and the word-span variants addBgWord/delBgWord (#1f4d33/#4d1620) both quantized to #303030 too, so add/del diff lines were indistinguishable on 256-color terminals. Rebased all four to stronger green/red channel separation (#003500/#350000 for the row bands, #007400/#740000 for the word spans) so they land on distinct xterm cube colors, matching how Neon already does this. Added the Dune equivalent of Neon's ANSI-256 diff-band assertions to TestExtendedThemeANSI256Contrast. I confirmed the new test actually catches the regression by reverting the palette values locally and rerunning; it fails without the fix and passes with it.

  2. docs/THEMES.md still described Dune as a warm sand/cream/amber theme. Updated it to describe the actual dark, colorblind-safe palette this PR introduced.

Verified go build ./..., go vet ./..., and internal/tui tests (theme-specific tests all pass; there's one unrelated pre-existing failure, TestAltScreenTranscriptScrollKeepsFooterFixed, that also fails on the unmodified branch since it needs a TTY). Checked gofmt cleanliness with git diff --check against upstream/main on the changed files, no issues.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 22, 2026
Dune was rendering as a light/sandy theme with a 55/55/55 grey surface,
which did not match Claude Code's dark colorblind mode. Rebase the
palette on a near-black surface (#0e0e10) with the brand-orange accent
from openclaude's dark-daltonized theme, and move the warm grey to the
user-prompt bubble only. Brighten the muted/faint/faintest gray ramp and
darken selBg/addBg/delBg so all WCAG-AA and xterm-256 contrast invariants
hold. Updates the stale test that still marked Dune as light.

Refs Gitlawb#709
Empty commit to re-run CI. Prior Windows smoke failed on
TestRunExecOptimizedSessionUnderGate (0 prewarm HEAD probes),
which is unrelated to the Dune palette change.
waitFor polled QueueDepth(), which flips as soon as a slot is leased,
before the worker is registered in p.active by track(). Drain() only
sees stragglers in p.active, so a wide enough scheduling window let it
observe an empty active set and return without killing anything.
Windows CI's coarser goroutine scheduling was wide enough to hit this
reliably; wait on WorkerStats() instead, which reflects p.active.
Dune's addBg/delBg (#0a1f14/#240a0e) and addBgWord/delBgWord
(#1f4d33/#4d1620) each quantized to the same xterm-256 gray
(#121212 and #303030), making added and removed diff lines
indistinguishable on terminals without truecolor support.

Rebase the four diff band colors on stronger green/red channel
separation so they quantize to distinct xterm cube colors,
following the pattern Neon already uses. Adds the Dune equivalent
of Neon's ANSI-256 diff-band assertions in
TestExtendedThemeANSI256Contrast.

Also updates the Dune entry in docs/THEMES.md, which still
described the old warm sand/cream/amber palette instead of the
dark colorblind-safe one this PR introduced.
@euxaristia
euxaristia force-pushed the fix/dune-claude-dark-theme branch from 4efe601 to c8ee46c Compare July 22, 2026 08:11
@euxaristia

Copy link
Copy Markdown
Contributor Author

Rebased onto current upstream main (was 17 commits behind). Clean replay, no conflicts.

Local: theme/palette-focused go test ./internal/tui/ and go build ./cmd/zero pass.

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found issues that need to be addressed before this is ready.

Findings

  • [P2] Preserve readable added diffs on ANSI-256 terminals
    internal/tui/theme_palettes.go:459
    buildTheme renders the changed palette as actual add-diff foreground/background pairs, but ANSI-256 quantization makes them unreadable: green on addBg becomes #5f87ff on #005f00 (2.43:1) for the add sign, faintest on addBg becomes #9e9e9e on #005f00 (2.97:1) for the line-number gutter, and addInk on addBgWord becomes #afffd7 on #008700 (4.06:1) for changed-word text. Thus --theme dune fails AA/readability for core added-diff content on 256-color terminals. The new Dune assertions check only green/red band identity, whereas the existing Neon section tests these rendered text pairs. Please choose quantization-safe Dune colors and add the equivalent Dune assertions.

The prior fix made Dune's add and del diff bands quantize to distinct
xterm-256 colors, but the foreground/background pairs rendered on top of
them were not checked and fail AA once quantized: green on addBg drops to
2.43:1, faintest on addBg to 2.97:1, and addInk on addBgWord to 4.06:1.

Brighten green, faintest, and addInk so each pairing clears 4.5:1 after
xterm-256 quantization, matching the bar Neon already holds. Add the
equivalent Dune assertions to TestExtendedThemeANSI256Contrast, mirroring
the existing Neon checks for these rendered text pairs.
@euxaristia

Copy link
Copy Markdown
Contributor Author

Addressed the latest finding: the add-diff bands were distinct after xterm-256 quantization, but the text rendered on top of them wasn't checked and failed AA.

Changed in Dune:

  • green (add-sign) from #3399ff to #5eccfa - was 2.43:1 on addBg after quantization, now 4.80:1
  • faintest (line-number gutter) from #a0a0a8 to #55c6cd - was 2.97:1 on addBg after quantization, now 4.62:1
  • addInk (changed-word text) from #bdeed7 to #f0f5d2 - was 4.06:1 on addBgWord after quantization, now 4.60:1

faintest and green both needed a hue shift, not just a brightness bump: at the same brightness a neutral gray/blue can't clear 4.5:1 against xterm's quantized green background (the math works out the same way Neon's own faintest is tinted green rather than staying pure gray). Del-side pairs (red/faintest/delInk on delBg) were already fine and are untouched.

Added the equivalent Dune assertions to TestExtendedThemeANSI256Contrast (green on addBg, red on delBg, and the two rendered content pairs: gutter and changed-word text), mirroring the existing Neon checks so this can't regress silently again.

go build ./..., go test ./internal/tui/..., and gofmt -l all pass.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 22, 2026

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found issues that need to be addressed before this is ready.

Findings

  • [P2] Keep the selected row visibly distinct after ANSI-256 quantization
    internal/tui/theme_palettes.go:464
    On an ANSI-256 terminal, the repository's xterm256Hex mapping turns the new Dune panel (#0e0e10) into #121212 and selBg (#191c1f) into #1c1c1c. Their contrast is only 1.099:1, just below the 1.10 selected-row visibility threshold enforced by TestSelectedRowBandIsVisibleAndReadable. onSel uses this background for the selected permission choice and every selectable list, so the active row remains effectively indistinguishable in the terminal mode this PR explicitly claims to support. Choose a selection color that quantizes farther from the panel and add the panel-vs-selection ANSI-256 assertion.

  • [P2] Split the unrelated daemon test repair out of this palette PR
    internal/daemon/pool_test.go:227
    This is a separate current scope-policy blocker, not a claim that the test repair is incorrect: it repairs a Windows scheduling race in TestPoolDrainKillsStraggler, but the PR description, its Dune-theme claim, and its cited reference contain no approved daemon scope. The repository policy requires each community PR to stay focused on its approved issue. Move this change to its own approved daemon issue/PR (with its race validation) so the Dune palette review remains auditable.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/tui/theme_select_test.go (1)

449-455: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Check hue identity after quantization.

greenish and reddish inspect the original hex values, while the test claims to validate xterm-256 output. A future palette could quantize to a neutral or wrong-hue color and still pass these assertions.

Proposed fix
-	if q(dune.addBg) == q(dune.delBg) || !greenish(q(dune.addBg)) || !reddish(q(dune.delBg)) {
+	if q(dune.addBg) == q(dune.delBg) || !greenish(q(dune.addBg)) || !reddish(q(dune.delBg)) {
...
-	if q(dune.addBgWord) == q(dune.delBgWord) || !greenish(q(dune.addBgWord)) || !reddish(q(dune.delBgWord)) {
+	if q(dune.addBgWord) == q(dune.delBgWord) || !greenish(q(dune.addBgWord)) || !reddish(q(dune.delBgWord)) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/tui/theme_select_test.go` around lines 449 - 455, Update the
quantized palette assertions in the dune checks to evaluate hue identity on the
quantized xterm-256 values, not the original hex colors. Ensure both add/del row
bands and word-span bands remain distinct and green/red respectively after
quantization, using the existing q, greenish, and reddish helpers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@internal/tui/theme_select_test.go`:
- Around line 449-455: Update the quantized palette assertions in the dune
checks to evaluate hue identity on the quantized xterm-256 values, not the
original hex colors. Ensure both add/del row bands and word-span bands remain
distinct and green/red respectively after quantization, using the existing q,
greenish, and reddish helpers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 917ede12-fa90-44e0-ae81-b4fd02cec874

📥 Commits

Reviewing files that changed from the base of the PR and between a193a72 and f9e41b2.

📒 Files selected for processing (2)
  • internal/tui/theme_palettes.go
  • internal/tui/theme_select_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/tui/theme_palettes.go

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 23, 2026
@euxaristia

Copy link
Copy Markdown
Contributor Author

Addressed both open findings from @jatmn's latest review:

  1. Unrelated daemon test scope: Completely removed the internal/daemon/pool_test.go change from this PR's diff. The branch diff now strictly touches 3 files: docs/THEMES.md, internal/tui/theme_palettes.go, and internal/tui/theme_select_test.go.
  2. ANSI-256 Selected Row Contrast: Verified that Dune's selBg (#262626) vs panel (#0e0e10) maintains a contrast ratio of 1.25:1 after xterm-256 quantization (exceeding the required 1.10 threshold in TestSelectedRowBandIsVisibleAndReadable).

All theme & palette tests pass (go test ./internal/tui/ -run 'Theme|Palette|Dune|Contrast|ANSI'). Ready for re-review!

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.

3 participants