mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
feat(mini-player): user-bindable keyboard shortcut to toggle mini player
Adds an 'open-mini-player' entry to the in-app keybindings (Settings → Shortcuts), default unbound. Pressing the chord from the main window opens the mini and minimises main; pressing it from the mini hides the mini and restores main — both paths invoke open_mini_player which already handles the toggle. The mini window has its own keydown listener (same pattern as Space / arrows for play/skip) that reads the binding from useKeybindingsStore. Binding changes in main propagate to an open mini through the existing storage-event sync (now also covers psysonic_keybindings) so the user doesn't need to restart the mini after rebinding. Localized in all 8 supported locales. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -812,6 +812,9 @@ function TauriEventBridge() {
|
||||
win.isFullscreen().then(fs => win.setFullscreen(!fs));
|
||||
break;
|
||||
}
|
||||
case 'open-mini-player':
|
||||
invoke('open_mini_player').catch(() => {});
|
||||
break;
|
||||
}
|
||||
};
|
||||
window.addEventListener('keydown', onKey);
|
||||
@@ -983,6 +986,7 @@ export default function App() {
|
||||
if (!e.key) return;
|
||||
if (e.key === 'psysonic_theme') useThemeStore.persist.rehydrate();
|
||||
else if (e.key === 'psysonic_font') useFontStore.persist.rehydrate();
|
||||
else if (e.key === 'psysonic_keybindings') useKeybindingsStore.persist.rehydrate();
|
||||
else if (e.key === 'psysonic_language' && e.newValue) {
|
||||
import('./i18n').then(m => m.default.changeLanguage(e.newValue!));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user