Skip to content

fix: add opt-in Chrome window focus across Spaces - #562

Open
OlegBezr wants to merge 2 commits into
johnste:mainfrom
OlegBezr:codex/focus-chrome-profile-window
Open

OlegBezr wants to merge 2 commits into
johnste:mainfrom
OlegBezr:codex/focus-chrome-profile-window

Conversation

@OlegBezr

@OlegBezr OlegBezr commented Oct 23, 2026 •

Copy link
Copy Markdown

Chrome can open a link in the selected profile while macOS stays on another Space or activates another Chrome window.

Add opt-in focusWindow: true for Google Chrome. The launcher finds the receiving window by its new active tab ID, then raises it across Spaces, including fullscreen. Background links keep their existing behavior.

Requires Automation and Accessibility access. Includes the app permission description and signing entitlement.

Refs #550.

Validation: launcher race tests, all 80 config API tests, and the focused TypeScript check pass. The reporter confirmed focus works on macOS with two Chrome profiles. Runtime behavior is unchanged by the reduced test and README changes.

Summary by CodeRabbit

  • New Features
    • Added an optional focusWindow setting for Chrome profiles to bring the window receiving a link to the foreground, including across Spaces and fullscreen.
    • The setting is off by default and does not apply to background links. Other browsers continue to open links as before.
  • Documentation
    • Added setup guidance for the required Automation and Accessibility permissions when using window focusing.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5aefacb3-27b3-42ad-b195-78cca367451b
📥 Commits

Reviewing files that changed from the base of the PR and between c64ebba and 2d2c0e2.

📒 Files selected for processing: 3
  • README.md
  • apps/finicky/src/browser/launcher_test.go
  • packages/config-api/src/utils.test.ts
💤 Files with no reviewable changes: 1
  • packages/config-api/src/utils.test.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • README.md

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

📝 Walkthrough

Adds an optional focusWindow browser setting. For eligible Chrome launches, Finicky opens the link, identifies the window with a new active tab, and attempts to raise it. The change also updates macOS permission declarations, signing configuration, tests, and documentation.

Changes: Chrome window focus

Layer / File(s) Summary
Focus configuration and validation
packages/config-api/src/configSchema.ts, packages/config-api/src/utils.test.ts, apps/finicky/src/browser/launcher.go
The browser schemas and Go configuration accept the optional focusWindow setting. A test checks that browser resolution preserves the setting.
Chrome launch and window focus
apps/finicky/src/browser/focus_chrome.applescript, apps/finicky/src/browser/launcher.go, apps/finicky/src/browser/launcher_test.go
For non-background Chrome launches with focus enabled, Finicky uses osascript and the embedded script. The script snapshots active tab IDs, opens the launch arguments, searches for a new active tab ID for up to five seconds, and attempts to raise the matching window. Tests cover launcher selection and arguments.
macOS permissions and release configuration
apps/finicky/assets/Info.plist, scripts/Finicky.entitlements, scripts/gon-config.json, scripts/release.sh, README.md
The app declares Apple Events usage and enables the Apple Events entitlement in signing configuration. The README describes the option, required permissions, and behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Finicky
  participant osascript
  participant Chrome
  participant SystemEvents
  Finicky->>osascript: Pass embedded focus script and launch arguments
  osascript->>Chrome: Snapshot active tab IDs
  osascript->>Chrome: Open launch arguments
  osascript->>Chrome: Poll for a new active tab ID
  osascript->>Chrome: Move matching window to front and activate
  osascript->>SystemEvents: Raise front window and set Chrome frontmost
Loading
Merge Risk: ⚪ Minimal · up to 2d2c0

No actionable merge-blocking issue is established; the change is ready for normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed 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 3 functions across 5 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: an opt-in Chrome window focus feature that works across Spaces.
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.
Full details: Docstring Coverage

Explanation

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 3 functions across 5 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · 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.

This branch has not been deployed

No deployments
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