Skip to content

Consider providing user feedback when save fails. #47

@AStevensTaylor

Description

@AStevensTaylor

🧹 Nitpick | 🔵 Trivial

Consider providing user feedback when save fails.

Errors are caught and logged but the user receives no indication that the save operation failed. Consider setting an error state or displaying a toast notification.

♻️ Suggested approach
+const [saveError, setSaveError] = useState<string | null>(null);

 // In saveToDirectory:
 		} catch (err) {
 			console.error("Failed to save frames:", err);
+			setSaveError("Failed to save frames. Please try again.");
 		} finally {
 			setIsSaving(false);
 		}

Then display saveError in the UI, perhaps near the save progress indicator.

🤖 Prompt for AI Agents
In `@src/components/GifFrameExtractor.tsx` around lines 541 - 545, The catch block
that currently only logs errors should also set UI-visible error state so users
know the save failed: add a saveError state (e.g., const [saveError,
setSaveError] = useState<string | null>(null)), clear it before starting the
save, and in the catch for the save operation call setSaveError(err?.message ??
String(err)); optionally invoke any existing toast helper (e.g., showToast or
useToast) to surface the message; ensure you still call setIsSaving(false) in
finally and display saveError in the component near the save progress indicator.

Originally posted by @coderabbitai[bot] in #44 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions