Skip to content

fix(lint): move the macOS input-source probe out of app.ts - #26643

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/app-ipc-max-lines
Oct 8, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/app-ipc-max-lines

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​153 $\color{#cf222e}{\Huge{\mathbf{−}}}$​152 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

ELI5

Main's lint is red: src/main/ipc/app.ts went 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 of app.ts into its own file. Nothing changes for users.

What Changed

  • New src/main/ipc/macos-keyboard-input-source.ts holds 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 functions app.ts still calls are exported.
  • app.ts imports 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.ts and macos-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-lines lint failure introduced by #26447.

Visual Proof

N/A: code move only, no behavior or UI change.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

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. oxlint and oxfmt pass 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No platform, SSH, mobile or compatibility impact; the probe still runs only on macOS and is called exactly as before.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

#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.
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3993f26b-8ca0-4b64-8b9f-6356c26217d7
📥 Commits

Reviewing files that changed from the base of the PR and between b6b4d68 and 545a7e5.

📒 Files selected for processing (2)
  • src/main/ipc/app.ts
  • src/main/ipc/macos-keyboard-input-source.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The 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 545a7

The macOS input-source behavior is preserved, with no identified issue blocking merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: moving the macOS input-source probe out of app.ts to resolve the lint issue.
Description check ✅ Passed The description is mostly complete. It explains the problem, change, rationale, testing, lack of behavior change, and checklist status. It states that no linked issue exists, although the template req…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025
brennanb2025 merged commit 4b13ab6 into main Oct 8, 2026
30 checks passed
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