mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
Related to issue https://github.com/toeverything/AFFiNE/issues/14094 This PR makes it so that focus is put on the input body when loading a journal. A check is made when loading the document whether it is a normal document or a journal document. If it is a journal document, the last noteblock in the document is focused on. This does not change how the title is focused on normal documents. This makes it more effortless to use the journal, as you don't have to click on the body of the journal after opening/creating it. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved editor focus for journal documents: when opening or switching to a journal the cursor now auto-positions to the end of the last note entry (or the input area) after a short, smooth delay for faster typing and reliable focus behavior. * **Bug Fixes** * Added safeguards and error handling to make automatic focus more robust across load and editor states. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->