generated from nhcarrigan/template
feat: add compact mode for minimal widget interface (#36)
Add a compact mode that shrinks the window to a small widget showing just the character sprite, recent messages, and a quick input box. Perfect for quick questions while working without the full UI. - Add CompactMode.svelte component with minimal widget interface - Add compact mode toggle in StatusBar (Ctrl+Shift+M shortcut) - Save/restore window size when toggling compact mode - Handle display scaling by converting physical to logical pixels - Add compact_mode to config (Rust + TypeScript) - Add required Tauri window permissions for resize operations
This commit is contained in:
@@ -21,6 +21,7 @@ export interface HikariConfig {
|
||||
font_size: number;
|
||||
streamer_mode: boolean;
|
||||
streamer_hide_paths: boolean;
|
||||
compact_mode: boolean;
|
||||
}
|
||||
|
||||
const defaultConfig: HikariConfig = {
|
||||
@@ -41,6 +42,7 @@ const defaultConfig: HikariConfig = {
|
||||
font_size: 14,
|
||||
streamer_mode: false,
|
||||
streamer_hide_paths: false,
|
||||
compact_mode: false,
|
||||
};
|
||||
|
||||
function createConfigStore() {
|
||||
@@ -155,6 +157,16 @@ function createConfigStore() {
|
||||
config.subscribe((c) => (currentConfig = c))();
|
||||
await updateConfig({ streamer_mode: !currentConfig.streamer_mode });
|
||||
},
|
||||
|
||||
toggleCompactMode: async () => {
|
||||
let currentConfig: HikariConfig = defaultConfig;
|
||||
config.subscribe((c) => (currentConfig = c))();
|
||||
await updateConfig({ compact_mode: !currentConfig.compact_mode });
|
||||
},
|
||||
|
||||
setCompactMode: async (enabled: boolean) => {
|
||||
await updateConfig({ compact_mode: enabled });
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -186,6 +198,7 @@ export const configStore = createConfigStore();
|
||||
export const isDarkTheme = derived(configStore.config, ($config) => $config.theme === "dark");
|
||||
|
||||
export const isStreamerMode = derived(configStore.config, ($config) => $config.streamer_mode);
|
||||
export const isCompactMode = derived(configStore.config, ($config) => $config.compact_mode);
|
||||
export const shouldHidePaths = derived(
|
||||
configStore.config,
|
||||
($config) => $config.streamer_mode && $config.streamer_hide_paths
|
||||
|
||||
Reference in New Issue
Block a user