Skip to content

fix: toggle focus mode do not reset editor height#5504

Open
lilonghe wants to merge 4 commits intousememos:mainfrom
lilonghe:fix/toggle-focus-mode-editor-height
Open

fix: toggle focus mode do not reset editor height#5504
lilonghe wants to merge 4 commits intousememos:mainfrom
lilonghe:fix/toggle-focus-mode-editor-height

Conversation

@lilonghe
Copy link

At editor, enter focus mode, and write something, then exit focus mode, the editor height is too high, didn't reset.
截屏2026-01-19 14 11 01
截屏2026-01-19 14 11 17
截屏2026-01-19 14 11 23

Signed-off-by: longhe.li <lilonghe@outlook.com>
@lilonghe lilonghe requested a review from johnnyjoygh as a code owner January 19, 2026 06:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where the editor height was not properly reset when exiting focus mode. After entering focus mode, writing content, and then exiting focus mode, the editor would remain at an incorrectly expanded height instead of recalculating to the appropriate size.

Changes:

  • Added a useEffect hook that triggers updateEditorHeight() whenever isFocusMode changes to ensure the editor height is recalculated when toggling between focus and normal modes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lilonghe and others added 2 commits January 22, 2026 09:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: longhe.li <lilonghe@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: longhe.li <lilonghe@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant