From 47aeabf5d44d7483101d30d289cb4c56761e3faa Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Mon, 2 Mar 2026 08:42:22 +0800 Subject: feat: improve toast and logo --- packages/ui/src/main.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/ui') diff --git a/packages/ui/src/main.tsx b/packages/ui/src/main.tsx index a3157bd..c5cbfc8 100644 --- a/packages/ui/src/main.tsx +++ b/packages/ui/src/main.tsx @@ -33,6 +33,6 @@ const root = createRoot(document.getElementById("root") as HTMLElement); root.render( - + , ); -- cgit v1.2.3-70-g09d2 From 9e40b5b7bea60e6802a4b448ef315b14fba4de7f Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Mon, 2 Mar 2026 10:26:21 +0800 Subject: feat(ui): java config --- .changes/settings-java.md | 6 ++ .changes/version-select.md | 6 ++ packages/ui/src/components/bottom-bar.tsx | 19 ++---- packages/ui/src/components/ui/radio-group.tsx | 36 +++++++++++ packages/ui/src/models/java.ts | 25 ++++++++ packages/ui/src/pages/settings.tsx | 90 ++++++++++++++++++++++++++- packages/ui/vite.config.ts | 2 +- 7 files changed, 167 insertions(+), 17 deletions(-) create mode 100644 .changes/settings-java.md create mode 100644 .changes/version-select.md create mode 100644 packages/ui/src/components/ui/radio-group.tsx create mode 100644 packages/ui/src/models/java.ts (limited to 'packages/ui') diff --git a/.changes/settings-java.md b/.changes/settings-java.md new file mode 100644 index 0000000..7f13302 --- /dev/null +++ b/.changes/settings-java.md @@ -0,0 +1,6 @@ +--- +"@dropout/ui": "patch:feat" +dropout: "patch:feat" +--- + +Support detect and select java path. diff --git a/.changes/version-select.md b/.changes/version-select.md new file mode 100644 index 0000000..0f6ce83 --- /dev/null +++ b/.changes/version-select.md @@ -0,0 +1,6 @@ +--- +"@dropout/ui": "patch:fix" +dropout: "patch:fix" +--- + +Auto select game version if version is unique. diff --git a/packages/ui/src/components/bottom-bar.tsx b/packages/ui/src/components/bottom-bar.tsx index 5489675..0710c3a 100644 --- a/packages/ui/src/components/bottom-bar.tsx +++ b/packages/ui/src/components/bottom-bar.tsx @@ -6,7 +6,6 @@ import { listInstalledVersions, startGame } from "@/client"; import { cn } from "@/lib/utils"; import { useAuthStore } from "@/models/auth"; import { useInstanceStore } from "@/models/instance"; -import { useGameStore } from "@/stores/game-store"; import { LoginModal } from "./login-modal"; import { Button } from "./ui/button"; import { @@ -26,7 +25,6 @@ interface InstalledVersion { export function BottomBar() { const authStore = useAuthStore(); - const gameStore = useGameStore(); const instancesStore = useInstanceStore(); const [isLaunched, setIsLaunched] = useState(false); @@ -51,24 +49,18 @@ export function BottomBar() { const versions = await listInstalledVersions( instancesStore.activeInstance.id, ); - - const installed = versions || []; - setInstalledVersions(installed); + setInstalledVersions(versions); // If no version is selected but we have installed versions, select the first one - if (!gameStore.selectedVersion && installed.length > 0) { - gameStore.setSelectedVersion(installed[0].id); + if (!selectedVersion && versions.length > 0) { + setSelectedVersion(versions[0].id); } } catch (error) { console.error("Failed to load installed versions:", error); } finally { setIsLoadingVersions(false); } - }, [ - instancesStore.activeInstance, - gameStore.selectedVersion, - gameStore.setSelectedVersion, - ]); + }, [instancesStore.activeInstance, selectedVersion]); useEffect(() => { loadInstalledVersions(); @@ -225,6 +217,7 @@ export function BottomBar() { { + settings.merge({ + javaPath: e.target.value, + }); + }} + onBlur={() => { + settings.save(); + }} + /> + +
+ Java Installations + {javaStore.installations ? ( + { + settings.merge({ + javaPath: value, + }); + settings.save(); + }} + > + {javaStore.installations?.map((installation) => ( + + + + + {installation.vendor} ({installation.version}) + + + {installation.path} + + + + + + ))} + + ) : ( +
+ +
+ )} +
+ + diff --git a/packages/ui/vite.config.ts b/packages/ui/vite.config.ts index 27ce1ff..8c90267 100644 --- a/packages/ui/vite.config.ts +++ b/packages/ui/vite.config.ts @@ -1,6 +1,6 @@ +import path from "node:path"; import tailwindcss from "@tailwindcss/vite"; import react from "@vitejs/plugin-react"; -import path from "path"; import { defineConfig } from "vite"; // https://vite.dev/config/ -- cgit v1.2.3-70-g09d2 From 0ac743f6d126d047352e6b247ea1ee513361d240 Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Mon, 2 Mar 2026 11:01:12 +0800 Subject: feat(ui): improve sidebar avatar --- .changes/sidebar-avatar.md | 6 ++++++ packages/ui/src/components/sidebar.tsx | 27 ++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .changes/sidebar-avatar.md (limited to 'packages/ui') diff --git a/.changes/sidebar-avatar.md b/.changes/sidebar-avatar.md new file mode 100644 index 0000000..a6042fd --- /dev/null +++ b/.changes/sidebar-avatar.md @@ -0,0 +1,6 @@ +--- +"@dropout/ui": "patch:feat" +dropout: "patch:feat" +--- + +Improve sidebar avatar on large and small screens. diff --git a/packages/ui/src/components/sidebar.tsx b/packages/ui/src/components/sidebar.tsx index 0147b0a..54a2f33 100644 --- a/packages/ui/src/components/sidebar.tsx +++ b/packages/ui/src/components/sidebar.tsx @@ -49,12 +49,33 @@ function NavItem({ Icon, label, to }: NavItemProps) { export function Sidebar() { const authStore = useAuthStore(); + const renderUserAvatar = () => { + return ( +
+
+ +
+
+ +
+

+ {authStore.account?.username} +

+

+ {authStore.account?.type === "microsoft" ? "Online" : "Offline"} +

+
+
+
+ ); + }; + return (