diff --git a/rust/gui-client/src-frontend/components/App.tsx b/rust/gui-client/src-frontend/components/App.tsx index db2ff51dc..a941eb0c2 100644 --- a/rust/gui-client/src-frontend/components/App.tsx +++ b/rust/gui-client/src-frontend/components/App.tsx @@ -17,7 +17,7 @@ import { SidebarItems, } from "flowbite-react"; import React, { useEffect, useState } from "react"; -import { NavLink, Route, Routes } from "react-router"; +import { Route, Routes, useNavigate, useLocation } from "react-router"; import { AdvancedSettingsViewModel } from "../generated/AdvancedSettingsViewModel"; import { FileCount } from "../generated/FileCount"; import { SessionViewModel } from "../generated/SessionViewModel"; @@ -37,6 +37,19 @@ export default function App() { let [advancedSettings, setAdvancedSettings] = useState(null); + const location = useLocation(); + const navigate = useNavigate(); + + // Custom navigation handler for SidebarItems to avoid full page reloads + const handleClick = (event: React.MouseEvent) => { + event.preventDefault(); + const target = event.currentTarget; + const href = target.getAttribute("href"); + if (href) { + navigate(href); + } + }; + useEffect(() => { const sessionChanged = listen("session_changed", (e) => { let session = e.payload; @@ -79,7 +92,7 @@ export default function App() { advancedSettingsChangedUnlisten.then((unlistenFn) => unlistenFn()); logsRecountedUnlisten.then((unlistenFn) => unlistenFn()); }; - }, []); + }, [location, handleClick]); const isDev = import.meta.env.DEV; @@ -91,65 +104,59 @@ export default function App() { > - - {({ isActive }) => ( - - Overview - - )} - + + Overview + - - {({ isActive }) => ( - - General - - )} - - - {({ isActive }) => ( - - Advanced - - )} - + + General + + + Advanced + - - {({ isActive }) => ( - - Diagnostics - - )} - - - {({ isActive }) => ( - - About - - )} - + + Diagnostics + + + About + {isDev && ( - - {({ isActive }) => ( - - Color Palette - - )} - + + Color Palette + )} diff --git a/rust/gui-client/src-frontend/main.tsx b/rust/gui-client/src-frontend/main.tsx index e00722bd3..b818bec57 100644 --- a/rust/gui-client/src-frontend/main.tsx +++ b/rust/gui-client/src-frontend/main.tsx @@ -8,8 +8,12 @@ import * as Sentry from "@sentry/react"; const customTheme = createTheme({ sidebar: { root: { inner: "rounded-none bg-white" }, + collapse: { + button: "cursor-pointer", + }, }, button: { + base: "cursor-pointer", color: { default: "bg-accent-450 hover:bg-accent-700 text-white", alternative: diff --git a/website/src/components/Changelog/GUI.tsx b/website/src/components/Changelog/GUI.tsx index b1dee97de..794416753 100644 --- a/website/src/components/Changelog/GUI.tsx +++ b/website/src/components/Changelog/GUI.tsx @@ -11,6 +11,9 @@ export default function GUI({ os }: { os: OS }) { {/* When you cut a release, remove any solved issues from the "known issues" lists over in `client-apps`. This must not be done when the issue's PR merges. */} + + Fixes minor visual inconsistencies in the main app window. + Fixes an issue where log directives applied via MDM would not be applied on startup.