Skip to content

V1.1.7#17

Open
nissy wants to merge 5 commits into
mainfrom
v1.1.7
Open

V1.1.7#17
nissy wants to merge 5 commits into
mainfrom
v1.1.7

Conversation

@nissy
Copy link
Copy Markdown
Owner

@nissy nissy commented May 20, 2026

bugfix focus

Copy link
Copy Markdown

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

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 ImeController and PreferencesView by extracting state monitoring and picker views into dedicated files. It enhances IME state reconciliation by monitoring application focus, space changes, and screen parameter updates, and introduces a periodic reconciliation timer for the menu bar icon. The version is bumped to 1.1.7, and unit tests are expanded to cover the new monitoring logic. Feedback suggests replacing hardcoded delay values with descriptive constants to improve code maintainability.

let appName = app.localizedName ?? "Unknown"
Logger.debug("Application activated: \(appName)", category: .ime)

DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { [weak self] in
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The delay 0.2 used for verifying IME state after an app switch is a magic number. Consider defining it as a constant like appSwitchVerificationDelay.

Comment on lines +658 to +661
refreshIconDebounced(delay: 0.12)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) { [weak self] in
self?.refreshIconDebounced(delay: 0)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The magic numbers 0.12 and 0.35 used for debouncing and settling the icon refresh should be defined as constants with descriptive names to explain why these specific delays are necessary.

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