* Don't save animated webp

* Fix bad export state

* Contain scroll for camera group

* Use dvh
This commit is contained in:
Nicolas Mowen 2024-04-29 15:23:24 -06:00 committed by GitHub
parent 7745313cdc
commit 1c9626ecff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 43 additions and 31 deletions

View File

@ -110,6 +110,8 @@ class RecordingExporter(threading.Thread):
f"00:{minutes}:{seconds}",
"-i",
preview.path,
"-frames",
"1",
"-c:v",
"libwebp",
thumb_path,

View File

@ -282,7 +282,7 @@ function NewGroupDialog({
}}
>
<Content
className={`min-w-0 ${isMobile ? "w-full p-3 rounded-t-2xl max-h-[90%]" : "w-6/12 max-h-dvh overflow-y-auto"}`}
className={`min-w-0 ${isMobile ? "w-full p-3 rounded-t-2xl max-h-[90%]" : "w-6/12 max-h-dvh overflow-y-hidden"}`}
>
<div className="flex flex-col my-4 overflow-y-auto">
{editState === "none" && (
@ -535,7 +535,10 @@ export function CameraGroupEdit({
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="mt-2 space-y-6">
<form
onSubmit={form.handleSubmit(onSubmit)}
className="mt-2 space-y-6 overflow-y-hidden"
>
<FormField
control={form.control}
name="name"
@ -556,34 +559,38 @@ export function CameraGroupEdit({
/>
<Separator className="flex my-2 bg-secondary" />
<FormField
control={form.control}
name="cameras"
render={({ field }) => (
<FormItem>
<FormLabel>Cameras</FormLabel>
<FormDescription>Select cameras for this group.</FormDescription>
{[
...(birdseyeConfig?.enabled ? ["birdseye"] : []),
...Object.keys(config?.cameras ?? {}),
].map((camera) => (
<FormControl key={camera}>
<FilterSwitch
isChecked={field.value && field.value.includes(camera)}
label={camera.replaceAll("_", " ")}
onCheckedChange={(checked) => {
const updatedCameras = checked
? [...(field.value || []), camera]
: (field.value || []).filter((c) => c !== camera);
form.setValue("cameras", updatedCameras);
}}
/>
</FormControl>
))}
<FormMessage />
</FormItem>
)}
/>
<div className="max-h-[40dvh] overflow-y-auto">
<FormField
control={form.control}
name="cameras"
render={({ field }) => (
<FormItem>
<FormLabel>Cameras</FormLabel>
<FormDescription>
Select cameras for this group.
</FormDescription>
{[
...(birdseyeConfig?.enabled ? ["birdseye"] : []),
...Object.keys(config?.cameras ?? {}),
].map((camera) => (
<FormControl key={camera}>
<FilterSwitch
isChecked={field.value && field.value.includes(camera)}
label={camera.replaceAll("_", " ")}
onCheckedChange={(checked) => {
const updatedCameras = checked
? [...(field.value || []), camera]
: (field.value || []).filter((c) => c !== camera);
form.setValue("cameras", updatedCameras);
}}
/>
</FormControl>
))}
<FormMessage />
</FormItem>
)}
/>
</div>
<Separator className="flex my-2 bg-secondary" />
<FormField

View File

@ -138,7 +138,10 @@ export default function MobileReviewSettingsDrawer({
{features.includes("export") && (
<Button
className="w-full flex justify-center items-center gap-2"
onClick={() => setDrawerMode("export")}
onClick={() => {
setDrawerMode("export");
setMode("select");
}}
>
<FaArrowDown className="p-1 fill-secondary bg-secondary-foreground rounded-md" />
Export