feat: add new adv. search page

This commit is contained in:
--remove-section committed 2026-01-21 20:43:20 +05:30
1 parent 32f5b3b3cf
commit cb83b05c7a
12 files changed
+886 -1211

No files matched your search

+28 -4
View File
@@ -20,6 +20,7 @@ import { getLibraryQueryOptions } from "@/utils/queries/library";
// import removed: header reads name/count from Zustand slice
import { useLibraryStateStore } from "@/utils/store/libraryState";
import "./libraryHeader.scss";
import useSearchStore from "@/utils/store/search";
import BackButton from "../buttons/backButton";
import { FiltersDialogTrigger } from "../filtersDialog";
import { UserAvatarMenu } from "../userAvatarMenu";
@@ -231,9 +232,8 @@ export const LibraryHeader = () => {
const libraryName = libraryNameFromStore ?? currentLibrary.data.Name;
const totalCount = itemsTotalCount;
const handleNavigateToSearch = useCallback(
() => navigate({ to: "/search", search: { query: "" } }),
[navigate],
const toggleSearchDialog = useSearchStore(
useShallow((s) => s.toggleSearchDialog),
);
const handleNavigateToHome = useCallback(
() => navigate({ to: "/home" }),
@@ -292,7 +292,19 @@ export const LibraryHeader = () => {
size="small"
value={String(normalizedViewType)}
onChange={handleChangeViewType}
SelectProps={{
MenuProps: {
PaperProps: {
className: "glass-menu-paper",
},
},
}}
>
<MenuItem disabled value="">
<Typography variant="overline" color="textSecondary">
View
</Typography>
</MenuItem>
{compatibleViews.map((v) => (
<MenuItem key={String(v.value)} value={String(v.value)}>
{v.title}
@@ -318,7 +330,19 @@ export const LibraryHeader = () => {
value={normalizedSortBy}
onChange={handleChangeSortBy}
disabled={disableSortOption}
SelectProps={{
MenuProps: {
PaperProps: {
className: "glass-menu-paper",
},
},
}}
>
<MenuItem disabled value="">
<Typography variant="overline" color="textSecondary">
Sort By
</Typography>
</MenuItem>
{SORT_BY_OPTIONS.map((option) => {
const isCompatible =
option.compatibleViewTypes?.includes(currentViewType as any) ||
@@ -349,7 +373,7 @@ export const LibraryHeader = () => {
<FiltersDialogTrigger />
</div>
<div className="flex flex-row" style={{ gap: "0.6em" }}>
<IconButton onClick={handleNavigateToSearch}>
<IconButton onClick={toggleSearchDialog}>
<div className="material-symbols-rounded">search</div>
</IconButton>
<IconButton onClick={handleNavigateToFavorite}>
+55 -27
View File
@@ -1,34 +1,62 @@
.library-header {
display: flex;
align-items: center;
justify-content: space-between;
inset: 1em 1em auto 1em !important;
border-radius: 9999px;
margin: 0 auto;
width: fit-content;
position: sticky;
display: flex;
align-items: center;
justify-content: space-between;
inset: 1em 2em auto 2em !important;
border-radius: 9999px;
margin: 0 auto;
width: fit-content;
position: sticky;
width: calc(100vw - 4em) !important;
z-index: 10;
z-index: 10;
padding: 0.25em !important;
transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
&::after {
content: "";
position: absolute;
backdrop-filter: blur(40px);
inset: -0.35em;
pointer-events: none;
border-radius: inherit;
box-shadow: 0 0 25px rgb(0 0 0 / 0.45);
background: rgb(0 0 0 / 0.4);
opacity: 0;
z-index: -1;
transition: opacity $transition-time-fast;
}
&.scrolling {
content: "";
position: absolute;
inset: -0.35em;
pointer-events: none;
border-radius: inherit;
// Glass styling matching Search Dialog
background-color: rgba(20, 20, 30, 0.7);
backdrop-filter: blur(24px) saturate(180%);
background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
opacity: 0;
z-index: -1;
transition: all 150ms;
}
&.scrolling {
&::after {
opacity: 1;
opacity: 1;
}
}
}
// Glass styling for Menus and Dialogs
.glass-menu-paper, .glass-dialog-paper {
background-color: rgba(20, 20, 30, 0.7) !important;
backdrop-filter: blur(24px) saturate(180%) !important;
background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)) !important;
border: 1px solid rgba(255, 255, 255, 0.08) !important;
box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
border-radius: 16px !important;
}
// Ensure the menu items themselves look good on the glass background
.glass-menu-paper {
.MuiMenuItem-root {
font-family: inherit;
&:hover {
background-color: rgba(255, 255, 255, 0.1);
}
&.Mui-selected {
background-color: rgba(255, 255, 255, 0.15);
&:hover {
background-color: rgba(255, 255, 255, 0.2);
}
}
}
}
}