Single source of truth for the dark/light theme flip: the data-theme
attribute on documentElement and its theme localStorage key.
ThemeToggle and the command palette's toggle-theme action both need to
flip the theme; if each kept its own copy of "is it dark" state, one could
flip the DOM/localStorage while the other's cached copy went stale (the
same class of bug usePortNames guards against for port-name visibility).
Centralizing the flip here, plus a change event mounted components can
listen for, keeps every caller in sync without lifting the state into App.
Single source of truth for the dark/light theme flip: the
data-themeattribute ondocumentElementand itsthemelocalStorage key.ThemeToggle and the command palette's
toggle-themeaction both need to flip the theme; if each kept its own copy of "is it dark" state, one could flip the DOM/localStorage while the other's cached copy went stale (the same class of bugusePortNamesguards against for port-name visibility). Centralizing the flip here, plus a change event mounted components can listen for, keeps every caller in sync without lifting the state into App.