Skip to content

fix(web): enable restore defaults after theme mix changes - #5928

Merged
maria-rcks merged 1 commit into
pingdotgg:mainfrom
Lucenx9:agent/fix-theme-mix-restore-defaults
Aug 10, 2026
Merged

fix(web): enable restore defaults after theme mix changes#5928
maria-rcks merged 1 commit into
pingdotgg:mainfrom
Lucenx9:agent/fix-theme-mix-restore-defaults

Conversation

@Lucenx9

@Lucenx9 Lucenx9 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Problem

Changing only the light or dark theme mix could leave the restore dirty-state memo stale because themeHalves was read but omitted from its dependency list. Restore defaults could therefore remain disabled and the restore action could return early.

Fix

Include themeHalves in the changedSettingLabels memo dependencies so theme-mix-only changes immediately update the restore state.

Verification

  • Reproduced the missing dependency with a targeted react-hooks/exhaustive-deps check; the themeHalves diagnostic disappears after the fix
  • node_modules/.bin/vp fmt --check apps/web/src/components/settings/SettingsPanels.tsx
  • node_modules/.bin/vp lint --report-unused-disable-directives apps/web/src/components/settings/SettingsPanels.tsx
  • node_modules/.bin/vp run --filter @t3tools/web typecheck
  • git diff --check upstream/main...HEAD

Screenshots are not included because this changes state invalidation only, with no layout or styling changes.

Model: GPT-5.6 Sol
Harness: Codex in T3 Code

Note

Fix 'Restore Defaults' detection to update when theme mix changes

Adds themeHalves to the useMemo dependency array in the useSettingsRestore hook in SettingsPanels.tsx, so changedSettingLabels recomputes immediately when the theme mix is modified. Previously, theme mix changes were not reflected in the restore defaults check or confirmation dialog.

Macroscope summarized b8dab78.


Note

Low Risk
Single React hook dependency fix in settings restore state; no auth, data, or API behavior changes.

Overview
Restore defaults now reacts when only the light/dark theme mix changes.

useSettingsRestore already treated a non-null themeHalves as dirty and listed Theme mix in changedSettingLabels, but the useMemo for that list omitted themeHalves from its dependency array. After a mix-only edit, the memo could stay stale so restore stayed disabled and restoreDefaults could no-op on an empty label list.

The fix adds themeHalves to that dependency array so mix-only changes immediately refresh restore UI and confirmation copy.

Reviewed by Cursor Bugbot for commit b8dab78. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 10, 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: 11b6ac8c-06cd-4a7f-b0c2-82d0e14c69d9

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 vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 10, 2026
@Lucenx9
Lucenx9 marked this pull request as ready for review August 10, 2026 01:20
@macroscopeapp

macroscopeapp Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved b8dab78

This is a straightforward bug fix adding a missing React useMemo dependency. The themeHalves variable was used in the computation but not listed as a dependency, preventing the "restore defaults" feature from detecting theme mix changes.

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

@maria-rcks
maria-rcks merged commit ef051bd into pingdotgg:main Aug 10, 2026
22 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 10, 2026
## What's Changed
* Move project settings to contextual project routes by @juliusmarminge in pingdotgg/t3code#5923
* Retain thread sidebar data when navigating to /settings so back navigation is instant by @juliusmarminge in pingdotgg/t3code#5930
* Automate production mobile EAS releases by @juliusmarminge in pingdotgg/t3code#5609
* Add settings and usage breadcrumbs by @juliusmarminge in pingdotgg/t3code#5929
* fix(web): correct model picker trigger padding by @Chrono-byte in pingdotgg/t3code#5935
* fix(web): show worktree icon in sidebar v2 by @tris203 in pingdotgg/t3code#5909
* fix(web): enable restore defaults after theme mix changes by @Lucenx9 in pingdotgg/t3code#5928
* fix(web): trait menu closes after you pick a level by @t3dotgg in pingdotgg/t3code#5879
* fix(web): align project name with headline by @carterwsmith in pingdotgg/t3code#5864
* fix(web): update pills use readable theme foregrounds by @chrisdeeming in pingdotgg/t3code#5938

## New Contributors
* @carterwsmith made their first contribution in pingdotgg/t3code#5864

**Full Changelog**: pingdotgg/t3code@v0.0.33-nightly.20260810.1054...v0.0.33-nightly.20260810.1055

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.33-nightly.20260810.1055
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 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.

2 participants