Skip to content

[codex] add input method health diagnostics - #33

Merged
ygsgdbd merged 2 commits into
mainfrom
codex/input-method-health-diagnostics
Aug 14, 2026
Merged

ygsgdbd merged 2 commits into
mainfrom
codex/input-method-health-diagnostics

Conversation

@ygsgdbd

@ygsgdbd ygsgdbd commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

TypeSwitch previously treated input method discovery and automatic switching as best-effort operations without exposing whether the catalog was still loading, had failed, or whether a requested switch actually completed. A transient catalog failure could also look like an empty catalog and make valid saved rules appear unavailable.

This change adds explicit input method health and switch diagnostics to the menu bar UI. Users can now distinguish catalog loading or failure from a genuinely empty catalog, inspect the affected app and target input method after a switch failure, reload the catalog, retry the current app, and open Keyboard Settings when the configured input method is missing or disabled.

Root cause and user impact

Catalog fetch errors were collapsed into an empty array, so the reducer could not preserve the last known-good list or explain why input methods disappeared. Programmatic switches only returned a Boolean and relied on cancellation alone, which made stale asynchronous completions capable of affecting newer app activations. Retrying the current app also reused an asynchronously captured frontmost-app snapshot without a generation check.

As a result, users could see saved input method rules reported as missing during a transient failure, receive no explanation when a switch failed, or have an older asynchronous result overwrite newer foreground-app or catalog state.

Changes

  • Model input method catalog state as loading, ready, or failed while preserving the last successful catalog.
  • Record structured switch outcomes for already-selected, switched, and failed attempts.
  • Verify the selected input source after TISSelectInputSource succeeds.
  • Add generation IDs for catalog refreshes, foreground-app retries, and programmatic switch attempts so stale responses are ignored.
  • Continue attempting a switch when the preliminary current-input-method lookup fails.
  • Keep retry requests valid across unrelated app termination events while invalidating them for newer activations or termination of the current app.
  • Show localized menu diagnostics with reload, retry, and Keyboard Settings recovery actions.
  • Prevent missing-rule cleanup while the catalog is unavailable.
  • Add regression coverage for catalog failures, stale refresh responses, retry races, stale switch completions, termination handling, target changes, and diagnostic presentation.

Validation

  • rtk just check
  • SwiftFormat lint passed.
  • Tuist project generation passed.
  • 117 tests passed with zero failures.
  • git diff --check passed before commit.

@ygsgdbd
ygsgdbd marked this pull request as ready for review August 14, 2026 10:08
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ygsgdbd
ygsgdbd enabled auto-merge (squash) August 14, 2026 10:16
@ygsgdbd
ygsgdbd merged commit 80ff135 into main Aug 14, 2026
2 checks passed
@ygsgdbd
ygsgdbd deleted the codex/input-method-health-diagnostics branch August 14, 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