Skip to content

feat(web): add modular theme library - #5226

Open
StiensWout wants to merge 33 commits into
pingdotgg:mainfrom
StiensWout:t3code/modular-theme-system
Open

feat(web): add modular theme library#5226
StiensWout wants to merge 33 commits into
pingdotgg:mainfrom
StiensWout:t3code/modular-theme-system

Conversation

@StiensWout

@StiensWout StiensWout commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

T3 Code now has a token-based theme foundation for the web client and desktop app.

  • Adds six built-in themes: Default, T3 Chat, T3 Grove, T3 Ocean, T3 Ember, and T3 Iris.
  • Gives the five maintainer color themes light and dark palettes, with an Auto option for dual-mode themes.
  • Keeps appearance mode global and persistent; selecting a theme card does not unexpectedly change the current mode.
  • Adds a theme library for creating, editing, renaming, deleting, importing, and exporting personal themes.
  • Supports guided editing for common roles and an advanced color picker with JSON upload and paste.
  • Applies semantic tokens to the composer send button, placeholders, secondary labels, muted icons, terminals, diffs, file previews, errors, warnings, updates, workspace toolbars, and splash screens.
  • Workspace Git actions, project actions, editor actions, and panel controls now follow the selected theme's toolbar palette.
  • Keeps the original artwork banner.

Closes #418

Screenshots

Maintainer theme cards

Default T3 Chat T3 Grove T3 Ocean T3 Ember T3 Iris
Default theme card T3 Chat theme card T3 Grove theme card T3 Ocean theme card T3 Ember theme card T3 Iris theme card
Light + dark + Auto Light + dark + Auto Light + dark + Auto Light + dark + Auto Light + dark + Auto Light + dark + Auto

Theme library

Light mode Dark mode
Theme library in light mode Theme library in dark mode

Dark workspace controls

T3 Chat T3 Grove
T3 Chat dark workspace controls T3 Grove dark workspace controls

Personal themes

Three temporary personal themes were used for the library evidence; they are not committed as built-in themes.

Theme library with personal themes

Workspace examples

Theme Mode Screenshot
T3 Chat Light T3 Chat light workspace
T3 Chat Dark T3 Chat dark workspace

Core component coverage

Component Screenshot
Workspace home Classic light workspace home
Guided theme editor Guided theme editor
Advanced color picker Advanced color picker
JSON import and paste JSON import and paste
Delete confirmation Delete confirmation

Built with GPT-5.6-Luna in T3 Code.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d89b4add-46be-4c9b-b236-a4d28538eddf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Aug 2, 2026
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/hooks/useTheme.ts
Comment thread apps/web/src/themePalette.ts Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
@StiensWout
StiensWout force-pushed the t3code/modular-theme-system branch from e0f79e4 to 607dd6b Compare August 2, 2026 11:52
Comment thread apps/web/src/hooks/useTheme.ts Outdated
Comment thread apps/web/src/hooks/useTheme.ts Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/themePalette.ts
Comment thread apps/web/src/themePalette.ts Outdated
Comment thread apps/web/src/index.css Outdated
@StiensWout
StiensWout marked this pull request as ready for review August 2, 2026 12:27
Comment thread apps/web/index.html
Comment thread apps/web/index.html Outdated
Comment thread apps/web/index.html
@macroscopeapp

macroscopeapp Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

You can customize Macroscope's approvability policy. Learn more.

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/themePalette.ts
Comment thread apps/web/src/themePalette.ts
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/index.html Outdated
Comment thread apps/web/index.html
Comment thread apps/web/index.html Outdated
Comment thread apps/web/src/components/settings/ThemeSettings.tsx
Comment thread apps/web/src/components/settings/ThemeSettings.tsx Outdated
Comment thread apps/web/index.html Outdated
@13zebras

13zebras commented Aug 4, 2026

Copy link
Copy Markdown

I did not have time to go through this PR thoroughly. But the general direction taken is exactly what I had in mind when I started #418. From what I see, it should be easy to create a custom theme based on the tokens created.

Adds semantic theme roles, persisted light and dark variants, personal theme import and creation, contrast-safe surfaces, and themed message actions. Includes the T3 Chat palette, follow-system behavior, splash handling, and the theme library UI.
StiensWout and others added 17 commits August 4, 2026 10:12
Full review pass over the modular theme system:

- Rewrite the index.html boot script to mirror runtime resolution exactly:
  clamp built-in themes to their available modes (T3 Chat is light-only),
  treat unrecognized preferences as the system default, follow the OS in
  the storage-failure fallback, and honor corrupted follow-system values
  the same way the runtime does. Add a boot/runtime parity test that
  evaluates the inline script against resolveThemeAppearance.
- Keep the color picker's hue when a grey/white/black echo round-trips,
  open hand-tuned themes in advanced mode so guided regeneration cannot
  silently discard their palettes, and regenerate every saved appearance
  when toggling Advanced off.
- Cache the useTheme snapshot instead of reading localStorage on every
  consumer render, and share one storage/matchMedia listener pair.
- Restore hover and emphasis states lost in the token migration
  (message action hover, provider update pill, sidebar read/unread,
  plan-mode toggle) and fix message-foreground tokens used on
  background surfaces.
- Extract the theme library/editor into ThemeSettings.tsx, memoize the
  color rows, reuse the Alert component and shared isThemeColor, drop
  the dead StageBackdropButtonArt and themePreferenceForSystem, and make
  stored-theme parsing tolerant of unknown roles from other builds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- The boot script no longer follows the OS for a `:system`-suffixed
  preference when follow-system is explicitly off, matching the runtime;
  covered by two new parity cases.
- setTheme/setFollowSystem report write success, so the follow-system
  toggle leaves the theme preference untouched when its write fails, and
  removing the active theme keeps it installed when the selection cannot
  be moved off it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The document ships light-media, dark-media, and plain theme-color metas;
the browser reads whichever matches the OS, so mutating only the first
element left themed chrome colors unapplied on a dark OS. Both the boot
script and syncBrowserChromeTheme now write the resolved color to every
matching meta.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Swap the light palette to t3.chat's actual tokens — #a84370 primary,
surface family — for the deeper pink accents of the product. The boot
splash and managed-editor fallbacks follow, and a contrast guard test
keeps the key pairings readable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@StiensWout
StiensWout force-pushed the t3code/modular-theme-system branch from f52a34c to 2cf3d56 Compare August 4, 2026 08:18
Comment thread apps/web/src/components/settings/ThemeSettings.tsx Outdated
Comment thread apps/web/index.html
Comment thread apps/web/src/components/settings/ThemeSettings.tsx Outdated
Comment thread apps/web/index.html
Comment thread apps/web/src/components/settings/ThemeSettings.tsx
Comment thread apps/web/src/components/settings/ThemeSettings.tsx
Comment thread apps/web/src/components/settings/ThemeSettings.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Themes and UI cusomization

2 participants