From 6c6cd5052a157b658f50e04ca7c350a00c2dbd60 Mon Sep 17 00:00:00 2001
From: HsiangNianian <i@jyunko.cn>
Date: Fri, 16 Jan 2026 14:17:17 +0800
Subject: feat: add assistant view and configuration editor components

Introduced a new AssistantView component for enhanced interaction with the AI assistant, allowing users to send messages and receive responses. Implemented a ConfigEditorModal for editing configuration files with JSON validation and history management. Updated the App component to integrate these new features, improving user experience and functionality in managing AI settings.
---
 ui/src/App.svelte | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

(limited to 'ui/src/App.svelte')

diff --git a/ui/src/App.svelte b/ui/src/App.svelte
index 760a15f..2b78892 100644
--- a/ui/src/App.svelte
+++ b/ui/src/App.svelte
@@ -10,6 +10,7 @@
   import LoginModal from "./components/LoginModal.svelte";
   import ParticleBackground from "./components/ParticleBackground.svelte";
   import SettingsView from "./components/SettingsView.svelte";
+  import AssistantView from "./components/AssistantView.svelte";
   import Sidebar from "./components/Sidebar.svelte";
   import StatusToast from "./components/StatusToast.svelte";
   import VersionsView from "./components/VersionsView.svelte";
@@ -18,6 +19,7 @@
   import { gameState } from "./stores/game.svelte";
   import { settingsState } from "./stores/settings.svelte";
   import { uiState } from "./stores/ui.svelte";
+  import { logsState } from "./stores/logs.svelte";
   import { convertFileSrc } from "@tauri-apps/api/core";
 
   let mouseX = $state(0);
@@ -29,24 +31,19 @@
   }
 
   onMount(async () => {
+    // ENFORCE DARK MODE: Always add 'dark' class and attribute
+    document.documentElement.classList.add('dark');
+    document.documentElement.setAttribute('data-theme', 'dark');
+    document.documentElement.classList.remove('light');
+    
     authState.checkAccount();
     await settingsState.loadSettings();
+    logsState.init();
     await settingsState.detectJava();
     gameState.loadVersions();
     getVersion().then((v) => (uiState.appVersion = v));
     window.addEventListener("mousemove", handleMouseMove);
   });
-  
-  $effect(() => {
-    // ENFORCE DARK MODE: Always add 'dark' class and attribute
-    // This combined with the @variant dark in app.css ensures dark mode is always active
-    // regardless of system preference settings.
-    document.documentElement.classList.add('dark');
-    document.documentElement.setAttribute('data-theme', 'dark');
-    
-    // Ensure 'light' class is never present
-    document.documentElement.classList.remove('light');
-  });
 
   onDestroy(() => {
     if (typeof window !== 'undefined')
@@ -120,6 +117,8 @@
                <VersionsView />
              {:else if uiState.currentView === "settings"}
                <SettingsView />
+             {:else if uiState.currentView === "guide"}
+               <AssistantView />
              {/if}
           </div>
           
-- 
cgit v1.2.3-70-g09d2

