fix(ui): search results, navigation and window controls on headers
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Search queries no longer cache empty results while auth is restoring, the search header gets a working navigation drawer, and library/search headers include the custom window controls on Windows/Linux. Idle remote-session polling is reduced.
This commit is contained in:
1 parent
3cfa52ffc9
commit
23cdfb010d
4 files changed
+54
-23
No files matched your search
@@ -26,8 +26,11 @@ import {
|
||||
} from "@mui/material";
|
||||
import { createFileRoute, Outlet, useNavigate } from "@tanstack/react-router";
|
||||
import { useShallow } from "zustand/shallow";
|
||||
import { NavigationDrawer } from "@/components/appBar/navigationDrawer";
|
||||
import BackButton from "@/components/buttons/backButton";
|
||||
import { UserAvatarMenu } from "@/components/userAvatarMenu";
|
||||
import WindowControls from "@/components/windowControls";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import useDebounce from "@/utils/hooks/useDebounce";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import useSearchStore from "@/utils/store/search";
|
||||
@@ -50,7 +53,7 @@ const CATEGORIES = [
|
||||
];
|
||||
|
||||
function SearchPage() {
|
||||
const api = Route.useRouteContext().api;
|
||||
const api = useApiInContext((state) => state.api);
|
||||
const navigate = useNavigate();
|
||||
const { query } = Route.useSearch();
|
||||
const [setBackdrop] = useBackdropStore(useShallow((s) => [s.setBackdrop]));
|
||||
@@ -184,22 +187,24 @@ function SearchAppBar({
|
||||
const toggleSearchDialog = useSearchStore(
|
||||
useShallow((s) => s.toggleSearchDialog),
|
||||
);
|
||||
const [showDrawer, setShowDrawer] = useState(false);
|
||||
|
||||
return (
|
||||
<AppBar
|
||||
className={
|
||||
scrollTrigger
|
||||
? "appBar search-header scrolling flex flex-row"
|
||||
: "appBar search-header flex flex-row"
|
||||
}
|
||||
style={appBarStyling}
|
||||
elevation={0}
|
||||
color="transparent"
|
||||
>
|
||||
<div className="flex flex-row" style={{ gap: "0.6em" }}>
|
||||
<IconButton disabled>
|
||||
<div className="material-symbols-rounded">menu</div>
|
||||
</IconButton>
|
||||
<>
|
||||
<AppBar
|
||||
className={
|
||||
scrollTrigger
|
||||
? "appBar search-header scrolling flex flex-row"
|
||||
: "appBar search-header flex flex-row"
|
||||
}
|
||||
style={appBarStyling}
|
||||
elevation={0}
|
||||
color="transparent"
|
||||
>
|
||||
<div className="flex flex-row" style={{ gap: "0.6em" }}>
|
||||
<IconButton onClick={() => setShowDrawer(true)}>
|
||||
<div className="material-symbols-rounded">menu</div>
|
||||
</IconButton>
|
||||
<BackButton />
|
||||
<IconButton onClick={handleNavigateToHome}>
|
||||
<div
|
||||
@@ -352,8 +357,14 @@ function SearchAppBar({
|
||||
<div className="material-symbols-rounded">favorite</div>
|
||||
</IconButton>
|
||||
<UserAvatarMenu />
|
||||
<WindowControls />
|
||||
</div>
|
||||
</AppBar>
|
||||
</AppBar>
|
||||
<NavigationDrawer
|
||||
open={showDrawer}
|
||||
onClose={() => setShowDrawer(false)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -437,7 +448,14 @@ function CategorySection({ category, query, api, user, onResult }: any) {
|
||||
const limit = 20;
|
||||
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: ["search", "category", category.value, query],
|
||||
queryKey: [
|
||||
"search",
|
||||
"category",
|
||||
category.value,
|
||||
query,
|
||||
user?.Id,
|
||||
api?.basePath,
|
||||
],
|
||||
queryFn: async () => {
|
||||
if (!api || !user?.Id) return { items: [], total: 0 };
|
||||
|
||||
@@ -472,7 +490,7 @@ function CategorySection({ category, query, api, user, onResult }: any) {
|
||||
});
|
||||
return { items: res.data.Items, total: res.data.TotalRecordCount };
|
||||
},
|
||||
enabled: !!query,
|
||||
enabled: Boolean(api && user?.Id && query),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user