Skip to content

Fix mixed theme state after sign-in route transition#14040

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/bug-triage-and-resolution-bb3d
Draft

Fix mixed theme state after sign-in route transition#14040
cursor[bot] wants to merge 1 commit intomainfrom
cursor/bug-triage-and-resolution-bb3d

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor bot commented Apr 2, 2026

Summary

  • Fixes intermittent mixed color theme state after sign-in where UI could render with conflicting light/dark tokens until refresh.
  • Hardens Harmony ThemeProvider document theme synchronization for nested providers.

Root Cause

  • Both the global app shell and sign-on flow mount Harmony theme providers.
  • Each provider mutates html[data-theme]; during auth route transitions/unmount timing, the document theme could be left in a stale state.

Changes

  • Updated packages/harmony/src/foundations/theme/ThemeProvider.tsx to track mounted provider instances and always apply the active top-most provider theme to html[data-theme] on mount/update/unmount.
  • Ensures unmounting an inner provider restores the parent provider theme deterministically.

Validation

  • Attempted targeted typecheck with npm run -w @audius/harmony typecheck.
  • In this automation environment, dependencies are not installed (tsc: not found), so full local validation could not be completed here.
Open in Web View Automation 

Co-authored-by: Ray Jacobson <raymondjacobson@users.noreply.github.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 2, 2026

⚠️ No Changeset found

Latest commit: e3c7969

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14040.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant