fix: sync Quick Prompt popup theme with main app

The popup window has its own document and never received the
data-theme attribute. Pass the current theme setting from the main
process via the show event, resolve 'system' to effective dark/light,
and apply to document.documentElement.dataset.theme so all CSS
variables match the main app's appearance.

- Add getCurrentTheme() to AryxAppService
- Pass theme in toggleQuickPromptWindow / showQuickPromptWindow
- Update onShow listener signature to receive theme string
- Apply theme to documentElement on each popup activation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-04-13 12:36:35 +02:00
co-authored by Copilot
parent d3fb0a64c5
commit b02a90a15f
6 changed files with 18 additions and 8 deletions
@@ -46,7 +46,13 @@ export function QuickPromptApp() {
// Subscribe to show/hide events from main process
useEffect(() => {
const offShow = api.onShow(() => {
const offShow = api.onShow((theme: string) => {
// Apply theme to document root so CSS variables match the main app
const effective = theme === 'system'
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
: theme;
document.documentElement.dataset.theme = effective;
setVisible(true);
resetState();
});