Fix

Fixed auto-save creating unnecessary requests

The auto-save feature was firing even when no changes were made, generating unnecessary API requests and cluttering the save indicator.

The problem

The 3-second debounce timer was restarting on every editor focus event — not just content changes. This meant clicking into the editor, even without typing, would trigger a save.

The fix

Auto-save now uses a content hash comparison:

const prevHash = useRef(hashContent(content));

const onUpdate = ({ editor }) => {
  const newHash = hashContent(editor.getHTML());
  if (newHash !== prevHash.current) {
    prevHash.current = newHash;
    debouncedSave(editor);
  }
};

Saves only trigger when the content has actually changed. This also means navigating away from an unchanged draft won't show a "unsaved changes" warning.