every control writes itself
The Save button is gone, and so is the SaveTarget context that announced it. Every screen here is a preview of the thing being edited, so a change is already visible before it is written — a button then asks somebody to confirm what they can see. useAutosave debounces a burst into one request. It takes the unsaved state as a string rather than a flag, so a failed save is not retried on the next render, and it flushes on unmount so a section change loses nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import { useFlash } from '../useFlash';
|
||||
import { RichText } from '../RichText';
|
||||
import { MediaField } from '../MediaField';
|
||||
import { OverlayEditor, type Overlay } from '../OverlayEditor';
|
||||
import { useSaveTarget } from '../SaveTarget';
|
||||
import { useAutosave } from '../useAutosave';
|
||||
|
||||
/**
|
||||
* About Us — four bands, in the order the page shows them.
|
||||
@@ -139,7 +139,7 @@ export const AboutPanel = () => {
|
||||
}
|
||||
};
|
||||
|
||||
useSaveTarget(dirty, busy !== null, save);
|
||||
useAutosave(dirty ? 'dirty' : null, busy !== null, save);
|
||||
|
||||
if (!about) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user