diff --git a/src/renderer/src/components/download/DownloadDialog.tsx b/src/renderer/src/components/download/DownloadDialog.tsx index ebe7893..efc96d8 100644 --- a/src/renderer/src/components/download/DownloadDialog.tsx +++ b/src/renderer/src/components/download/DownloadDialog.tsx @@ -20,6 +20,7 @@ import { import { Tabs, TabsContent, TabsList, TabsTrigger } from '@renderer/components/ui/tabs' import { popularSites } from '@renderer/data/popularSites' +import { cn } from '@renderer/lib/utils' import type { AppSettings, OneClickQualityPreset, PlaylistInfo } from '@shared/types' import { useAtom, useSetAtom } from 'jotai' @@ -1042,23 +1043,41 @@ export function DownloadDialog({ onOpenSupportedSites, onOpenSettings }: Downloa )} {/* Advanced Options Content - Single Video */} - {videoInfo && !loading && singleVideoAdvancedOptionsOpen && ( -
- - setVideoInfoCardState((prev) => ({ ...prev, startTime: value })) - } - onEndTimeChange={(value) => - setVideoInfoCardState((prev) => ({ ...prev, endTime: value })) - } - onDownloadSubsChange={(value) => - setVideoInfoCardState((prev) => ({ ...prev, downloadSubs: value })) - } - showAccordion={false} - /> + {videoInfo && !loading && ( +
+
+
+ + setVideoInfoCardState((prev) => ({ ...prev, startTime: value })) + } + onEndTimeChange={(value) => + setVideoInfoCardState((prev) => ({ ...prev, endTime: value })) + } + onDownloadSubsChange={(value) => + setVideoInfoCardState((prev) => ({ ...prev, downloadSubs: value })) + } + showAccordion={false} + /> +
+
)}
@@ -1191,51 +1210,62 @@ export function DownloadDialog({ onOpenSupportedSites, onOpenSettings }: Downloa )} {/* Advanced Options Content - Playlist */} - {advancedOptionsOpen && ( -
-
-
-
- - -
+
+
+
+
+
+
+ + +
-
- -
- setStartIndex(e.target.value)} - className="text-center" - disabled={playlistBusy} - /> - - - setEndIndex(e.target.value)} - className="text-center" - disabled={playlistBusy} - /> +
+ +
+ setStartIndex(e.target.value)} + className="text-center" + disabled={playlistBusy} + /> + - + setEndIndex(e.target.value)} + className="text-center" + disabled={playlistBusy} + /> +
- )} +
diff --git a/src/renderer/src/components/subscription/SubscriptionFormDialog.tsx b/src/renderer/src/components/subscription/SubscriptionFormDialog.tsx index 429d4eb..1a4bab5 100644 --- a/src/renderer/src/components/subscription/SubscriptionFormDialog.tsx +++ b/src/renderer/src/components/subscription/SubscriptionFormDialog.tsx @@ -1,10 +1,5 @@ -import { - Accordion, - AccordionContent, - AccordionItem, - AccordionTrigger -} from '@renderer/components/ui/accordion' import { Button } from '@renderer/components/ui/button' +import { Checkbox } from '@renderer/components/ui/checkbox' import { Dialog, DialogContent, @@ -17,6 +12,7 @@ import { Input } from '@renderer/components/ui/input' import { Label } from '@renderer/components/ui/label' import { Switch } from '@renderer/components/ui/switch' import { ipcServices } from '@renderer/lib/ipc' +import { cn } from '@renderer/lib/utils' import { settingsAtom } from '@renderer/store/settings' import { resolveFeedAtom } from '@renderer/store/subscriptions' import { DEFAULT_SUBSCRIPTION_FILENAME_TEMPLATE, type SubscriptionRule } from '@shared/types' @@ -85,6 +81,8 @@ export function SubscriptionFormDialog({ const detectTimeout = useRef(null) const prevDefaultPathRef = useRef(buildDefaultSubscriptionDirectory(settings.downloadPath)) const urlInputId = useId() + const advancedOptionsId = useId() + const [advancedOptionsOpen, setAdvancedOptionsOpen] = useState(false) // Initialize form values based on mode useEffect(() => { @@ -92,6 +90,8 @@ export function SubscriptionFormDialog({ return } + setAdvancedOptionsOpen(false) + if (mode === 'edit' && subscription) { setUrl(subscription.feedUrl) setKeywords(subscription.keywords.join(', ')) @@ -274,10 +274,16 @@ export function SubscriptionFormDialog({
- - - {t('advancedOptions.title')} - +
+
+
setKeywords(event.target.value)} /> @@ -299,17 +305,31 @@ export function SubscriptionFormDialog({

{t('subscriptions.fields.onlyLatest')}

- - - +
+
+
- {mode === 'add' && ( - - )} - +
+
+ setAdvancedOptionsOpen(checked === true)} + /> + +
+
+ {mode === 'add' && ( + + )} + +
+