Skip to content

feat(ui): one light and one dark theme, modelled on Pendant - #14

Merged
andrebrait merged 3 commits into
mainfrom
ui-two-themes
Nov 25, 2026
Merged

andrebrait merged 3 commits into
mainfrom
ui-two-themes

Conversation

@andrebrait

@andrebrait andrebrait commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

tau ships one light and one dark theme, modelled on Pendant, plus System (the default), which picks one by the operating system. The colours were sampled from Pendant's public screenshots; the CSS is tau's own.

  • Light: warm paper surfaces (chat #F8F5EF, sidebar #F1F0EA) with a muted blue accent (#3A5C8C).
  • Dark: charcoal (chat #1A1C1E, sidebar #232526) with a lifted blue (#8EA8DA).
  • Frame: on desktop, the frame behind the panel cards is a shade lighter than the cards, as in Pendant.
  • Send: a round button filled in the text colour.
  • Contrast: every text pair is WCAG AA; the ratios are in app/globals.css. The light status colours (git letters, chart series) were darkened to hold AA on selected rows.
  • Retired themes: Midnight and the eleven other themes are gone. A stored choice of one of them reads as Light or Dark, whichever side it was on. The inline pre-paint script agrees with the hook, and a test runs the script against the hook for every stored value.
  • Theme menu and command palette: both list the same localized Light, Dark and System.
  • Toggle theme: in the palette, it now flips what is on screen (from System it stores an explicit Light or Dark).
  • Fonts: the fonts only the retired themes used (Geist, JetBrains Mono, Source Serif, Noto Serif SC) are no longer shipped.

Screenshots

Before (main, light and dark):

before light
before dark

After (light, dark, phone light, phone dark):

after light
after dark
after phone light
after phone dark

Headless Chromium against a throwaway home with sample sessions; the fonts are the container's fallbacks.

Test plan

  • tsc --noEmit, eslint (0 errors), full test suite (4265 pass, 0 fail) at 3b55e067e; hooks/useTheme.test.mjs and tsc again at the head.
  • bun scripts/build-client.ts, plus the screenshots above at 1600×1000 and 390×844.

Review

Review round 1 (full): adversarial

Scope: 087061f6b..ff075a970 (whole change). Tool: adversarial-review.

# Severity Location Finding Verdict
1 Medium app/index.html No test checks the pre-paint script against the hook: an OS-only script, or one missing midnight, still passed. Fixed in 3b55e06 (test runs the script in vm for every stored value × OS; red for both mutations)
2 Medium hooks/useTheme.ts nextThemePreference Toggle theme went dark → system, which on a dark OS changes nothing. Fixed in 3b55e06 (toggle flips the shown theme)
3 Low app/index.html Plain-object lookups: a stored constructor painted light, the hook resolved dark. Fixed in 3b55e06 (own-property lookups; covered by the test of 1)
4 Low CHANGELOG.md "the other eleven themes" should be nine. Fixed in 3b55e06
5 Low components/CommandPalette.tsx Palette theme names are hard-coded English; the switcher's are localized. Fixed in 3b55e06 (palette lists the switcher's options)
6 Low .settings-toggle, providers badge White on the dark accent is 2.40:1 (predates this PR). Fixed: badge on --accent-strong (5.99:1) in 3b55e06; toggle knob in the page colour (7:1) in 6b591ba
7 Nit components/MessageView.tsx var(--accent, #EC5BAB) keeps Midnight's pink as a fallback. Fixed in 3b55e06
8 Nit --font-mono Still names 'JetBrains Mono'. Rejected: a local font name in the fallback stack, not a shipped file

Not checked: a real browser's first frame and view-transition wipe; screen readers.

Review round 1 (full): code review

Scope: 087061f6b..ff075a970 (whole change). Tool: code-review-and-quality.

# Severity Location Finding Verdict
1 Medium hooks/useTheme.ts Toggle theme no-op on a dark OS. Same as adversarial 2: fixed in 3b55e06
2 Low app/index.html Inherited keys count as hits. Same as adversarial 3: fixed in 3b55e06
3 Low app/index.html, hooks/useTheme.ts Two copies of the retired lists, no test. Same as adversarial 1: fixed in 3b55e06; the test builds its ids from the exported sets in 6b591ba
4 Low hooks/useTheme.ts applyDomTheme A window opened before the change keeps html.midnight. Fixed in 3b55e06
5 Low components/MessageView.tsx Midnight pink fallbacks. Same as adversarial 7
6 Low light --status-* Success 4.01:1 and warning 4.39:1 on --bg-selected (predates this PR). Fixed in 3b55e06: all four status colours ≥4.6:1 there
7 Low components/CommandPalette.tsx Unlocalized names. Same as adversarial 5. (The palette already had a System entry.)

Not checked: a browser run.

Review round 1 (full): simplification

Scope: 087061f6b..ff075a970 (whole change). Tool: code-simplification.

# Severity Location Finding Verdict
1 Medium app/globals.css dark block Its shadows are overridden by the later html.dark rule; --on-accent/--overlay-backdrop repeat :root. Fixed in 3b55e06 (removed)
2 Medium useTheme.ts, index.html .dark, theme-* and data-theme mark one bit. Rejected: three cheap markers, and the selectors and tests that read them predate this PR; collapsing them is churn with no user gain
3 Medium useTheme.ts theme table One-item LIGHT_THEMES/DARK_THEMES and an unused ThemeDefinition.mode. Fixed in 3b55e06 (THEME_PANEL; the palette maps the switcher's options)
4 Low isDarkTheme Now theme === "dark". Rejected: kept as the named predicate its callers read
5 Low useTheme.ts effects Two effects re-apply the DOM theme (predates this PR). Rejected: outside this change; covered by its test
6 Low useTheme.ts comment "any other as Dark" is wrong (unknown values fall to System). Fixed in 3b55e06
7 Low globals.css frame var(--bg-frame, var(--bg-panel)) fallback can no longer trigger. Fixed in 3b55e06
8 Low MessageView.tsx Midnight fallbacks. Same as adversarial 7
9 Low i18n appShell.switchToSystemTheme/systemTheme unused (predates this PR). Rejected: outside this change

Not checked: behaviour; this pass reads only.

Review round 2 (light): code review

Scope: ff075a970..3b55e067e (the round 1 fixes). Tool: code-review-and-quality.

# Severity Location Finding Verdict
1 Low .settings-toggle On --accent-strong the dark on-track is 2.57:1 against the panel, so on and off differ mainly by knob position. Fixed in 6b591ba (track back on --accent, knob in the page colour: 7:1)
2 Nit hooks/useTheme.test.mjs The parity test lists the retired ids by hand. Fixed in 6b591ba (built from the exported sets)
3 Nit components/MessageView.tsx Status-token fallbacks (#7CA8FF …) remain. Rejected: harmless, outside this change

Round 2 reviewed head 3b55e067e; 6b591baf6 fixes only its Low findings and nits. Rounds used: 1 of 3 after the first full review. No next round is due.

Summary by CodeRabbit

  • New Features

    • Simplified theme choices to Light, Dark, and System. System follows the device’s appearance setting.
    • Updated the interface with a warm light palette and a charcoal dark palette.
  • Bug Fixes

    • Previously saved theme choices that are no longer available now resolve to Light or Dark based on their prior appearance.
    • Updated the app’s default browser and chart background colors to match the refreshed palette.

Light (warm paper) and Dark (charcoal) with a muted blue accent replace the
fourteen themes; System stays the default. A stored retired theme reads as
Light or Dark by its side. Send is a round button in the text colour, the
desktop frame is a shade lighter than the cards, and the fonts only the
retired themes used are no longer shipped.
Toggle theme flips what is shown; the pre-paint script ignores inherited keys and
a test runs it against the hook for every stored value; the command palette lists
the switcher's localized Light/Dark/System; status colours, the settings toggle and
the providers badge hold contrast; dead dark-block tokens and Midnight fallbacks go.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change reduces theme preferences to Light, Dark, and System, and maps retired stored preferences to Light or Dark. It updates theme palettes, font assets, selection controls, default colors, tests, and documentation.

Changes: Theme Consolidation

Layer / File(s) Summary
Preference resolution and browser startup
hooks/useTheme.ts, app/index.html, hooks/useTheme.test.mjs
The hook resolves preferences to Light or Dark and maps retired preferences by their prior light or dark category. The startup script applies generic theme classes. Tests cover preference resolution and compare startup-script behavior with the hook.
Theme palettes, fonts, and color consumers
app/globals.css, app/fonts/*, app/api/manifest/route.ts, components/ChatInput.tsx, components/MessageView.tsx, lib/manifest-route.test.mjs, lib/table-chart.ts, tests/package-files.test.mjs
The stylesheet updates the Light and Dark palettes and removes several font faces. Theme-related components and default colors are updated, and the package test lowers its minimum matching font-license count.
Theme selection controls and documentation
components/ThemeSwitcher.tsx, components/CommandPalette.tsx, AGENTS.md, CHANGELOG.md
The theme switcher and command palette offer Light, Dark, and System options. The documentation describes the reduced theme set and stored-preference mapping.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant ThemeSwitcher
  participant useTheme
  participant BrowserDOM
  User->>ThemeSwitcher: Selects a theme preference
  ThemeSwitcher->>useTheme: setTheme(value)
  useTheme->>BrowserDOM: Applies theme class and color metadata
Loading

Possibly related PRs

  • ompweb-dev/tau#13: Changes the theme preference contract, system preference handling, and theme CSS that this pull request also updates.

Suggested reviewers: kahme247

Merge Risk: Minimal · up to 6b591 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Security architecture risk: Minimal · up to 6b591

Existing theme choices keep their light or dark appearance without being rewritten during upgrade. The install manifest changes only its default colors. The reviewed changes do not introduce a material security or rollback risk.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected preference transition is scoped to browser appearance and install metadata. The adjacent chat send control, message tool icons, and SVG chart changes alter colors, not submission predicates, tool authority, or SVG escaping.

Trust Boundaries and Controls

  • observed — The manifest’s existing caller-controlled color input is restricted to six hexadecimal characters and is used only for two JSON color fields. The request does not select packaged icon filenames, and the PR does not change the private revalidation policy or the route’s stated reliance on the existing API proxy guard.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat(ui): one light and one dark theme, modelled on Pendant" matches the main change. The PR replaces the multi-theme set with one Light theme and one Dark theme, colors modeled on Pendant,…
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(ui): one light and one dark theme, modelled on Pendant" matches the main change. The PR replaces the multi-theme set with one Light theme and one Dark theme, colors modeled on Pendant, and System as the default. The title is specific and single-sentence. It does not cover the removed fonts, the manifest color change, or the desktop styling, which is expected for a short title.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c4324086-1333-467d-8cff-27b1e2258aa6
Commits

Reviewing files that changed from the base of the PR and between 087061f and 6b591ba.

Files ignored due to path filters: 4

  • app/fonts/NotoSerifSC-Subset.woff2 is excluded by !**/*.woff2
  • app/fonts/geist-latin-wght-normal.woff2 is excluded by !**/*.woff2
  • app/fonts/jetbrains-mono-latin-wght-normal.woff2 is excluded by !**/*.woff2
  • app/fonts/source-serif-4-latin-wght-normal.woff2 is excluded by !**/*.woff2
Files selected for processing: 19

  • AGENTS.md
  • CHANGELOG.md
  • app/api/manifest/route.ts
  • app/fonts/Geist-OFL.txt
  • app/fonts/JetBrainsMono-OFL.txt
  • app/fonts/NotoSerifSC-LICENSE.txt
  • app/fonts/NotoSerifSC-README.md
  • app/fonts/SourceSerif4-OFL.txt
  • app/globals.css
  • app/index.html
  • components/ChatInput.tsx
  • components/CommandPalette.tsx
  • components/MessageView.tsx
  • components/ThemeSwitcher.tsx
  • hooks/useTheme.test.mjs
  • hooks/useTheme.ts
  • lib/manifest-route.test.mjs
  • lib/table-chart.ts
  • tests/package-files.test.mjs
Files with no reviewable changes: 5

  • app/fonts/Geist-OFL.txt
  • app/fonts/JetBrainsMono-OFL.txt
  • app/fonts/NotoSerifSC-LICENSE.txt
  • app/fonts/NotoSerifSC-README.md
  • app/fonts/SourceSerif4-OFL.txt

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

@andrebrait
andrebrait merged commit 4acf00b into main Nov 25, 2026
5 checks passed
@andrebrait
andrebrait deleted the ui-two-themes branch November 25, 2026 09:02
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.

1 participant