Skip to content

refactor: extract editor activation restore - #564

Merged
hhhjin merged 2 commits into
mainfrom
codex/extract-editor-activation-restore
Apr 12, 2026
Merged

refactor: extract editor activation restore#564
hhhjin merged 2 commits into
mainfrom
codex/extract-editor-activation-restore

Conversation

@hhhjin

@hhhjin hhhjin commented Apr 12, 2026

Copy link
Copy Markdown
Member

Summary

  • extract the editor activation restore logic into a dedicated utility
  • cover pending-restore, path-change, and normal activation behavior with focused tests
  • preserve the alias-switch guard while simplifying the activation effect in the editor component

Review

  • review gate found no actionable issues in the reviewed scope

Testing

  • pnpm lint:fix
  • pnpm test:desktop

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the editor selection restoration logic into a dedicated utility function, restoreSelectionOnEditorActivate, and introduces unit tests for this logic. The review identifies a regression where the explicit editor focus call was omitted during the refactoring, which would negatively impact the user experience when opening notes. Additionally, there is a suggestion to improve type maintainability by using TypeScript's Parameters utility instead of duplicating the editor type definition.

@hhhjin
hhhjin merged commit b8b8e4e into main Apr 12, 2026
3 checks passed
@hhhjin
hhhjin deleted the codex/extract-editor-activation-restore branch April 12, 2026 10:20
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