-
Notifications
You must be signed in to change notification settings - Fork 0
Consider providing user feedback when save fails. #47
Copy link
Copy link
Open
Description
🧹 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)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels