Repository navigation
fix(lint): move the macOS input-source probe out of app.ts - #26643
Conversation
#26447 pushed src/main/ipc/app.ts one line over the 300-line limit, so main's oxlint is red and merges from main fail the commit hook. Move the keyboard input-source probe and its bounded command runner, unchanged, into macos-keyboard-input-source.ts beside the other macOS keyboard probes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe change adds macOS keyboard input-source probing in a dedicated module. The module runs the preferences-export command with a timeout, parses selected input sources, and reads the current keyboard-layout ID when applicable. App handlers now use the module’s helpers instead of local command and parsing logic. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The macOS input-source behavior is preserved, with no identified issue blocking merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ELI5
Main's lint is red:
src/main/ipc/app.tswent one line over the 300-line limit when #26447 added the slow-profile-save handler. Every PR shows the failure, and merging main into a branch is blocked because the commit hook lints the incoming file. This moves the macOS keyboard input-source probe out ofapp.tsinto its own file. Nothing changes for users.What Changed
src/main/ipc/macos-keyboard-input-source.tsholds the probe that reads which keyboard input source (IME or layout) is selected on macOS, plus the bounded command runner it uses. The code is moved unchanged; only the two functionsapp.tsstill calls are exported.app.tsimports them and keeps every IPC handler where it was. It drops from 353 to 203 lines.Why
The probe is a self-contained macOS concern with its own constants and process handling, and sits next to the existing
macos-keyboard-layout-snapshot.tsandmacos-keyboard-layout-change-notifications.ts. Moving it is the natural split. Raising the limit or disabling the rule isn't allowed.Linked Issue
None. Fixes main's
max-lineslint failure introduced by #26447.Visual Proof
N/A: code move only, no behavior or UI change.
Testing
The existing
src/main/ipc/app.test.ts(19 tests, including the input-source probe's timeout, process-group kill and IME cases) passes unchanged.oxlintandoxfmtpass on both files.orca-ci-checks(lint, code-quality and typecheck): 23/23 passed, including the typecheck.Review
Self-reviewed: a pure move with no logic edits.
Agent skill upstream boundary
Notes
No platform, SSH, mobile or compatibility impact; the probe still runs only on macOS and is called exactly as before.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)