mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
cef2db92cb
A second webview window (label "mini") with a compact player: album art, title, artist, prev/play/next, progress bar, pin-on-top toggle, expand back to main, close. Main minimizes on open and restores when the mini is hidden or closed. Spacebar toggles, arrow keys skip tracks. Cross-window sync: main window subscribes to playerStore and pushes `mini:sync` via emitTo on track / play-state change. Audio progress already broadcasts to all windows via `audio:progress`. Control actions (prev/next/toggle) come back via `mini:control`; main-window restore goes through a direct Rust command because WebKitGTK pauses JS in a minimized webview. Tiling-WM detection reused from existing `is_tiling_wm()` — always-on-top is skipped on Hyprland/Sway/i3 since it's ignored there anyway. Early alpha: no queue expand, no lyrics, no EQ, no drag-snap. Scope kept deliberately tight for v1; follow-ups planned. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
23 lines
661 B
TypeScript
23 lines
661 B
TypeScript
import { StrictMode } from 'react';
|
|
import ReactDOM from 'react-dom/client';
|
|
import { getCurrentWindow } from '@tauri-apps/api/window';
|
|
import App from './App';
|
|
import './i18n';
|
|
import './styles/theme.css';
|
|
import './styles/layout.css';
|
|
import './styles/components.css';
|
|
|
|
// Expose the Tauri window label synchronously so App() can pick its root
|
|
// component (main app vs mini player) on first render without flicker.
|
|
try {
|
|
(window as any).__PSY_WINDOW_LABEL__ = getCurrentWindow().label;
|
|
} catch {
|
|
(window as any).__PSY_WINDOW_LABEL__ = 'main';
|
|
}
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
<StrictMode>
|
|
<App />
|
|
</StrictMode>
|
|
);
|