Skip to content

Fix the appearance theme toggle making other open project windows…#250

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jun 24, 2026
Merged

Fix the appearance theme toggle making other open project windows…#250
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

Fix the appearance theme toggle making other open project windows flicker between light and dark before settling. With more than one project open, switching Light / Dark / System would strobe every other window. The cause was an app-layer feedback loop: when a window observed another window's theme change, it re-applied its own briefly-stale saved theme and wrote that stale value back to the shared theme storage, which re-triggered every window until all windows caught up. Theme changes now propagate across windows cleanly, with no cross-window flicker. (A companion change separately reduces redundant macOS window-chrome translucency work on the same switch.)

… (#2042)

With multiple projects open, switching Light/Dark/System made every other
window rapidly flip between light and dark before settling. ConfigProvider's
effect that mirrors the config theme into next-themes listed setTheme in its
deps. next-themes' setTheme identity churns on every theme-state change and
writes the shared localStorage, and all OK windows share one localStorage. So
on a non-primary window a cross-window storage event (from another window's
optimistic flip) churned setTheme, re-fired the effect, re-applied the
briefly-stale config value, and wrote it back to the shared localStorage,
re-broadcasting to every window in a feedback loop until all configs converged.

Extract the bridge into useApplyConfigTheme, depending on [themeValue] only, so
a cross-window flip is honored and never reverted. Adds a jsdom regression test
that reproduces the storm: red with setTheme in deps, green without.

GitOrigin-RevId: b938db4b077fa4fee73685a0c3a2e79d8f8dc38b

@inkeep-internal-ci inkeep-internal-ci Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28121753401). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.

@inkeep-oss-sync inkeep-oss-sync Bot merged commit 588fbee into main Jun 24, 2026
@inkeep-oss-sync inkeep-oss-sync Bot deleted the copybara/sync branch June 24, 2026 18:49
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