Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embeddings UI updates #14378

Merged
merged 26 commits into from
Oct 16, 2024
Merged
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e746956
Handle Frigate+ submitted case
NickM-27 Oct 15, 2024
4716ab2
Add search settings and rename general to ui settings
NickM-27 Oct 15, 2024
e11f4b8
Add platform aware sheet component
NickM-27 Oct 15, 2024
d76228a
use two columns on mobile view
hawkeye217 Oct 15, 2024
9d61fe3
Merge branch 'embeddings-ui' of https://github.com/blakeblackshear/fr…
hawkeye217 Oct 15, 2024
9bce6ef
Add cameras page to more filters
NickM-27 Oct 15, 2024
53ac693
clean up search settings view
hawkeye217 Oct 15, 2024
af4a291
Add time range to side filter
NickM-27 Oct 15, 2024
e48f3c5
Merge branch 'embeddings-ui' of github.com:blakeblackshear/frigate in…
NickM-27 Oct 15, 2024
28139f2
better match with ui settings
hawkeye217 Oct 15, 2024
f1ffcc0
Merge branch 'embeddings-ui' of https://github.com/blakeblackshear/fr…
hawkeye217 Oct 15, 2024
6664ec6
fix icon size
hawkeye217 Oct 15, 2024
fd7580c
use two columns on mobile view
hawkeye217 Oct 15, 2024
37bece3
clean up search settings view
hawkeye217 Oct 15, 2024
b7ffc1e
Add zones and saving logic
NickM-27 Oct 15, 2024
3fad61d
Add all filters to side panel
NickM-27 Oct 15, 2024
683e350
better match with ui settings
hawkeye217 Oct 15, 2024
00d16d8
fix icon size
hawkeye217 Oct 15, 2024
8ce569d
Fix mobile fitler page
NickM-27 Oct 15, 2024
0e180cd
Fix embeddings access
NickM-27 Oct 15, 2024
eff4e66
Cleanup
NickM-27 Oct 15, 2024
a1abaed
Fix scroll
NickM-27 Oct 15, 2024
a894cd6
Merge branch 'embeddings-ui' of https://github.com/blakeblackshear/fr…
hawkeye217 Oct 16, 2024
4fb807a
fix double scrollbars and add separators on mobile too
hawkeye217 Oct 16, 2024
39a5ca5
two columns on mobile
hawkeye217 Oct 16, 2024
68aa3aa
italics for emphasis
hawkeye217 Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions web/src/components/filter/SearchFilterGroup.tsx
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ import SearchSourceIcon from "../icons/SearchSourceIcon";
import PlatformAwareDialog from "../overlay/dialog/PlatformAwareDialog";
import { FaArrowRight, FaClock } from "react-icons/fa";
import { useFormattedHour } from "@/hooks/use-date-utils";
import SearchFilterDialog from "../overlay/dialog/SearchFilterDialog";

type SearchFilterGroupProps = {
className: string;
@@ -159,6 +160,16 @@ export default function SearchFilterGroup({
}}
/>
)}
{filters.includes("general") && (
<GeneralFilterButton
allLabels={filterValues.labels}
selectedLabels={filter?.labels}
updateLabelFilter={(newLabels) => {
onUpdateFilter({ ...filter, labels: newLabels });
}}
/>
)}
<SearchFilterDialog />
{filters.includes("date") && (
<CalendarRangeFilterButton
range={
@@ -191,15 +202,6 @@ export default function SearchFilterGroup({
}
/>
)}
{filters.includes("general") && (
<GeneralFilterButton
allLabels={filterValues.labels}
selectedLabels={filter?.labels}
updateLabelFilter={(newLabels) => {
onUpdateFilter({ ...filter, labels: newLabels });
}}
/>
)}
{filters.includes("sub") && (
<SubFilterButton
allSubLabels={allSubLabels}
42 changes: 42 additions & 0 deletions web/src/components/overlay/dialog/PlatformAwareDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { MobilePage, MobilePageContent } from "@/components/mobile/MobilePage";
import { Button } from "@/components/ui/button";
import { Drawer, DrawerContent, DrawerTrigger } from "@/components/ui/drawer";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";
import { isMobile } from "react-device-detect";

type PlatformAwareDialogProps = {
@@ -42,3 +45,42 @@ export default function PlatformAwareDialog({
</Popover>
);
}

type PlatformAwareSheetProps = {
trigger: JSX.Element;
content: JSX.Element;
triggerClassName?: string;
contentClassName?: string;
open: boolean;
onOpenChange: (open: boolean) => void;
};
export function PlatformAwareSheet({
trigger,
content,
triggerClassName = "",
contentClassName = "",
open,
onOpenChange,
}: PlatformAwareSheetProps) {
if (isMobile) {
return (
<MobilePage open={open} onOpenChange={onOpenChange}>
<Button asChild onClick={() => onOpenChange(!open)}>
{trigger}
</Button>
<MobilePageContent className="max-h-[75dvh] overflow-hidden px-4">
{content}
</MobilePageContent>
</MobilePage>
);
}

return (
<Sheet open={open} onOpenChange={onOpenChange}>
<SheetTrigger asChild className={triggerClassName}>
{trigger}
</SheetTrigger>
<SheetContent className={contentClassName}>{content}</SheetContent>
</Sheet>
);
}
28 changes: 28 additions & 0 deletions web/src/components/overlay/dialog/SearchFilterDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { FaCog } from "react-icons/fa";

import { useState } from "react";
import { PlatformAwareSheet } from "./PlatformAwareDialog";
import { Button } from "@/components/ui/button";

type SearchFilterDialogProps = {};
export default function SearchFilterDialog({}: SearchFilterDialogProps) {
const [open, setOpen] = useState(false);

const trigger = (
<Button className="flex items-center gap-2" size="sm">
<FaCog className={"text-secondary-foreground"} />
More Filters
</Button>
);
const content = <></>;

return (
<PlatformAwareSheet
trigger={trigger}
content={content}
contentClassName="w-auto"
open={open}
onOpenChange={setOpen}
/>
);
}