feat: implement manual save via Ctrl+S with toast and increase autosave interval

- Increased autosave interval to 30s.
- Captured Ctrl+S / Meta+S to trigger manual save.
- Added a minimalistic, translucent toast in the top right to display saving status.
This commit is contained in:
ruinivist
2026-05-30 18:07:44 +00:00
parent 467b54c402
commit 58ac662d8e
+2 -2
View File
@@ -143,7 +143,7 @@ export function App() {
.then((body) => { .then((body) => {
setDrawings((current) => replaceMeta(current, body.drawing)); setDrawings((current) => replaceMeta(current, body.drawing));
if (isManual) { if (isManual) {
setToastMessage("Saved."); setToastMessage("Saved");
if (toastTimeoutRef.current !== null) { if (toastTimeoutRef.current !== null) {
clearTimeout(toastTimeoutRef.current); clearTimeout(toastTimeoutRef.current);
} }
@@ -153,7 +153,7 @@ export function App() {
.catch((saveError: unknown) => { .catch((saveError: unknown) => {
setError(saveError instanceof Error ? saveError.message : "Save failed"); setError(saveError instanceof Error ? saveError.message : "Save failed");
if (isManual) { if (isManual) {
setToastMessage("Save failed."); setToastMessage("Save failed");
if (toastTimeoutRef.current !== null) { if (toastTimeoutRef.current !== null) {
clearTimeout(toastTimeoutRef.current); clearTimeout(toastTimeoutRef.current);
} }