Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/components/download/GalleryQueueItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { revealItemInDir } from '@tauri-apps/plugin-opener';
import { CheckCircle2, Clock, FolderOpen, Globe, Loader2, X, XCircle } from 'lucide-react';
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { openFileLocation } from '@/lib/open-file-location';
import type { DownloadItem } from '@/lib/types';
import { cn } from '@/lib/utils';

Expand All @@ -27,7 +27,7 @@ export function GalleryQueueItem({
const handleOpenFolder = useCallback(async () => {
if (!item.completedFilepath) return;
try {
await revealItemInDir(item.completedFilepath);
await openFileLocation(item.completedFilepath);
} catch (error) {
console.error('Failed to open gallery output folder:', error);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/download/QueueItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { revealItemInDir } from '@tauri-apps/plugin-opener';
import {
CheckCircle2,
ChevronDown,
Expand All @@ -24,6 +23,7 @@ import { SchedulePopover } from '@/components/download/SchedulePopover';
import { SimpleMarkdown } from '@/components/ui/simple-markdown';
import { useAI } from '@/contexts/AIContext';
import type { ScheduleConfig } from '@/hooks/useSchedule';
import { openFileLocation } from '@/lib/open-file-location';
import type { DownloadItem, ItemDownloadSettings } from '@/lib/types';
import { cn } from '@/lib/utils';
import { extractYouTubeVideoId, youtubeThumbnailUrl } from '@/lib/youtube-url';
Expand Down Expand Up @@ -233,7 +233,7 @@ export function QueueItem({
if (!item.completedFilepath) return;

try {
await revealItemInDir(item.completedFilepath);
await openFileLocation(item.completedFilepath);
} catch (error) {
console.error('Failed to open completed file location:', error);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/download/UniversalQueueItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { revealItemInDir } from '@tauri-apps/plugin-opener';
import {
CheckCircle2,
ChevronDown,
Expand All @@ -24,6 +23,7 @@ import { SchedulePopover } from '@/components/download/SchedulePopover';
import { SimpleMarkdown } from '@/components/ui/simple-markdown';
import { useAI } from '@/contexts/AIContext';
import type { ScheduleConfig } from '@/hooks/useSchedule';
import { openFileLocation } from '@/lib/open-file-location';
import type { DownloadItem, ItemUniversalSettings } from '@/lib/types';
import { cn } from '@/lib/utils';
import { SourceBadge } from './SourceBadge';
Expand Down Expand Up @@ -215,7 +215,7 @@ export function UniversalQueueItem({
if (!item.completedFilepath) return;

try {
await revealItemInDir(item.completedFilepath);
await openFileLocation(item.completedFilepath);
} catch (error) {
console.error('Failed to open completed file location:', error);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/processing/ChatPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { open } from '@tauri-apps/plugin-dialog';
import { revealItemInDir } from '@tauri-apps/plugin-opener';
import {
Check,
FileText,
Expand All @@ -20,6 +19,7 @@ import { type DragEvent, useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next';
import { ScrollArea } from '@/components/ui/scroll-area';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
import { openFileLocation } from '@/lib/open-file-location';
import type { ChatAttachment, ChatMessage, ProcessingProgress } from '@/lib/types';
import { cn } from '@/lib/utils';

Expand Down Expand Up @@ -403,7 +403,7 @@ export function ChatPanel({
<button
type="button"
className="flex items-center gap-1 text-xs font-medium text-green-600 dark:text-green-400 hover:underline w-fit"
onClick={() => msg.outputPath && revealItemInDir(msg.outputPath)}
onClick={() => msg.outputPath && void openFileLocation(msg.outputPath)}
>
<FolderOpen className="w-3 h-3" />
{t('processing.chat.openInFolder')}
Expand Down
5 changes: 3 additions & 2 deletions src/components/processing/HistoryDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { revealItemInDir } from '@tauri-apps/plugin-opener';
import {
AlertCircle,
Calendar,
Expand Down Expand Up @@ -27,6 +26,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/u
import { Input } from '@/components/ui/input';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
import { ScrollArea } from '@/components/ui/scroll-area';
import { openFileLocation } from '@/lib/open-file-location';
import type { ProcessingJob } from '@/lib/types';
import { cn } from '@/lib/utils';

Expand Down Expand Up @@ -620,7 +620,8 @@ export function HistoryDialog({
<Button
size="sm"
onClick={() =>
selectedJob.output_path && revealItemInDir(selectedJob.output_path)
selectedJob.output_path &&
void openFileLocation(selectedJob.output_path)
}
className="gap-1.5"
>
Expand Down
4 changes: 2 additions & 2 deletions src/contexts/processing/processing-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { invoke } from '@tauri-apps/api/core';
import { listen, type UnlistenFn } from '@tauri-apps/api/event';
import { open } from '@tauri-apps/plugin-dialog';
import { readFile } from '@tauri-apps/plugin-fs';
import { revealItemInDir } from '@tauri-apps/plugin-opener';
import { openFileLocation } from '@/lib/open-file-location';
import type {
FFmpegCommandResult,
ProcessingJob,
Expand Down Expand Up @@ -150,7 +150,7 @@ export async function cancelFfmpeg(jobId: string): Promise<void> {
}

export async function revealOutputInFolder(path: string): Promise<void> {
await revealItemInDir(path);
await openFileLocation(path);
}

export async function deleteProcessingJob(id: string): Promise<void> {
Expand Down
5 changes: 5 additions & 0 deletions src/lib/open-file-location.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { invoke } from '@tauri-apps/api/core';

export async function openFileLocation(filepath: string): Promise<void> {
await invoke('open_file_location', { filepath });
}
Loading