Files
grimoire/src
Claude b89004bbba Fix TipTap editor readiness race condition
The previous `isEditorReady()` helper was a callback that could become
stale in closures, and didn't properly track when the editor view was
fully mounted.

Changes:
- Add `isEditorReady` state that's set via TipTap's `onCreate` callback
- Add `onDestroy` callback to reset state when editor is destroyed
- Replace `isEditorReady()` callback with `checkEditorReady()` that
  checks both the state flag AND actual editor/view existence
- Check `editor.isDestroyed` to handle destroyed editor edge cases
- Use non-null assertion after `checkEditorReady()` passes
- Remove manual `editor.destroy()` in MentionEditor (useEditor handles this)
- Add `isEditorReady` to useEffect dependencies for keydown listener

This fixes intermittent "DOM not available" errors in the POST composer
that occurred when parent components called editor methods before the
view was fully mounted.

https://claude.ai/code/session_01Y1xotRNwx95jUAHARNavEn
2026-02-02 13:07:55 +00:00
..
2026-01-30 17:34:33 +01:00