From 02520ca62ac5e508e8748b2445171be64f459b6c Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Sun, 18 Jan 2026 13:34:52 +0800 Subject: fix(ci): improve pre-commit fmt hook configuration - Add pass_filenames: false to fmt hook - Add -- separator for cargo fmt args - Manually format code with cargo fmt --- ui/src/components/SettingsView.svelte | 121 ++++++++++++++++++++++++++++++++++ ui/src/stores/settings.svelte.ts | 9 +++ ui/src/types/index.ts | 13 ++++ 3 files changed, 143 insertions(+) (limited to 'ui/src') diff --git a/ui/src/components/SettingsView.svelte b/ui/src/components/SettingsView.svelte index 4de18b3..0e89e25 100644 --- a/ui/src/components/SettingsView.svelte +++ b/ui/src/components/SettingsView.svelte @@ -123,6 +123,15 @@ settingsState.settings.custom_background_path = undefined; settingsState.saveSettings(); } + + async function runMigrationToSharedCaches() { + try { + await (await import("@tauri-apps/api/core")).invoke("migrate_shared_caches"); + settingsState.loadSettings(); + } catch (e) { + console.error("Migration failed:", e); + } + }
@@ -398,6 +407,118 @@
+ +
+

Storage & Version Caches

+
+
+
+

Use Shared Caches

+

Store versions/libraries/assets in a global cache shared by all instances.

+
+ +
+ +
+
+

Keep Legacy Per-Instance Storage

+

Do not migrate existing instance caches; keep current layout.

+
+ +
+ +
+
+

Run Migration

+

Hard-link or copy existing per-instance caches into the shared cache.

+
+ +
+
+
+ + +
+

Feature Flags (Launcher Arguments)

+
+
+
+

Demo User

+

Enable demo-related arguments when rules require them.

+
+ +
+ +
+
+

Quick Play

+

Enable quick play singleplayer/multiplayer arguments.

+
+ +
+ + {#if settingsState.settings.feature_flags.quick_play_enabled} +
+
+ + +
+
+
+

Prefer Singleplayer

+

If enabled, use singleplayer quick play path.

+
+ +
+
+ + +
+
+ {/if} +
+
+

diff --git a/ui/src/stores/settings.svelte.ts b/ui/src/stores/settings.svelte.ts index 8a90736..5d20050 100644 --- a/ui/src/stores/settings.svelte.ts +++ b/ui/src/stores/settings.svelte.ts @@ -42,6 +42,15 @@ export class SettingsState { tts_enabled: false, tts_provider: "disabled", }, + use_shared_caches: false, + keep_legacy_per_instance_storage: true, + feature_flags: { + demo_user: false, + quick_play_enabled: false, + quick_play_path: undefined, + quick_play_singleplayer: true, + quick_play_multiplayer_server: undefined, + }, }); // Convert background path to proper asset URL diff --git a/ui/src/types/index.ts b/ui/src/types/index.ts index a5b336e..858ee43 100644 --- a/ui/src/types/index.ts +++ b/ui/src/types/index.ts @@ -68,6 +68,19 @@ export interface LauncherConfig { log_upload_service: "paste.rs" | "pastebin.com"; pastebin_api_key?: string; assistant: AssistantConfig; + // Storage management + use_shared_caches: boolean; + keep_legacy_per_instance_storage: boolean; + // Feature-gated argument flags + feature_flags: FeatureFlags; +} + +export interface FeatureFlags { + demo_user: boolean; + quick_play_enabled: boolean; + quick_play_path?: string; + quick_play_singleplayer: boolean; + quick_play_multiplayer_server?: string; } export interface JavaInstallation { -- cgit v1.2.3-70-g09d2