Fix three ide browse follow-ups: cmux routing, duplicate GitHub link, dead dock icon#59
Conversation
📝 WalkthroughWalkthroughThe PR keeps the ChangesBrowse flow
Git attribution
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
|
/gemini review |
|
@codex review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Code Review
This pull request introduces several key improvements. First, it updates the CLI installation script to run the browser-opening command in the foreground, preventing orphaned child processes under cmux. Second, it refactors the Git attribution logic to select a single primary remote (preferring the tracking remote, then origin), avoiding duplicate or incorrect 'Open in GitHub' links. Finally, it adds macOS-specific handling to re-show and focus the main window when the application is reopened with no visible windows. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
Fixes three ide browse (v0.11) follow-ups by ensuring browse launches route correctly under cmux, preventing duplicate/incorrect “Open in GitHub” actions, and restoring expected macOS dock-icon reopen behavior after a headless browse launch.
Changes:
- macOS: handle
RunEvent::Reopento re-show/focus the hiddenmainwindow when no windows are visible. - Git attribution: collapse multiple GitHub remotes down to a single primary remote based on upstream tracking (then
origin, then fallback). - CLI wrapper: run
open "$browse_url"in the foreground (and update validation) to preserve cmux pane context.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src-tauri/src/lib.rs | Adds a macOS Reopen handler to re-show/focus the main window after browse launches hide it. |
| src-tauri/src/git_attribution.rs | Chooses a single primary GitHub remote template (tracking → origin → first) and adds unit coverage. |
| scripts/validate-launch-runners.mjs | Updates assertions to match the new foreground open "$browse_url" behavior. |
| scripts/install-cli-command.sh | Stops backgrounding open "$browse_url" so cmux routing doesn’t fall back to the system browser. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request prevents orphaned browser processes by running the open command in the foreground, and updates the validation tests accordingly. It also refactors Git attribution to prioritize a single primary remote (upstream tracking branch, then 'origin') to avoid duplicate buttons, and adds macOS-specific logic to restore the main window on reopen events. Feedback suggests using the existing focus_window helper in src-tauri/src/lib.rs to simplify window restoration and handle unminimizing.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5f24f913e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
focus_window also restores a minimized window, unlike the raw show+set_focus pair.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src-tauri/src/git_attribution.rs (1)
644-681: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover real upstream resolution in the tests.
This test supplies a synthetic
tracking_remote, so it will pass even iftracking_remote_namefails against actual Git configuration. Add a repository-backed case withbranch.main.remote = upstreamand multiple GitHub remotes. Also, the “unknown upstream” case currently passesNone; useSome("nope")to test that fallback explicitly.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src-tauri/src/git_attribution.rs` around lines 644 - 681, Extend pick_primary_template tests with a repository-backed case configuring branch.main.remote = upstream and multiple GitHub remotes, then verify the resolved upstream is preferred. Update the unknown-upstream scenario in pick_primary_template_prefers_tracking_then_origin to pass Some("nope") instead of None, preserving its origin fallback assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/validate-launch-runners.mjs`:
- Line 115: Update the assertion for ideCommand in the launcher validation to
require the exact foreground open command and reject the same command when
followed by a background operator. Replace the broad substring check with an
assertion that distinguishes the intended command boundary while preserving the
existing redirection validation.
In `@src-tauri/src/git_attribution.rs`:
- Around line 494-515: Update tracking_remote_name to derive the upstream remote
with repo.branch_remote_name using the branch reference, instead of parsing the
tracking ref returned by branch_remote_tracking_ref_name. Preserve the existing
Option-based failure behavior and return the configured remote name directly.
---
Nitpick comments:
In `@src-tauri/src/git_attribution.rs`:
- Around line 644-681: Extend pick_primary_template tests with a
repository-backed case configuring branch.main.remote = upstream and multiple
GitHub remotes, then verify the resolved upstream is preferred. Update the
unknown-upstream scenario in pick_primary_template_prefers_tracking_then_origin
to pass Some("nope") instead of None, preserving its origin fallback assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 54b30cb2-a0bf-4b20-ba03-6130245ffd6f
📒 Files selected for processing (4)
scripts/install-cli-command.shscripts/validate-launch-runners.mjssrc-tauri/src/git_attribution.rssrc-tauri/src/lib.rs
A remote name containing a slash (e.g. team/fork) made refs/remotes/<remote>/<branch> ambiguous to split on '/'. Read branch.<name>.remote via gix's branch_remote_name instead, and add a regression test for a slashed remote name.
The prior assertion only checked a substring, so it still passed if the launcher regressed to 'open "$browse_url" >/dev/null 2>&1 &' — exactly the cmux-orphaning form this PR fixes.
|
@coderabbitai review |
|
/gemini review |
|
@codex review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Code Review
This pull request introduces several improvements across the codebase. In scripts/install-cli-command.sh, the open command is now run in the foreground to prevent orphaned child processes under cmux, with corresponding updates made to the validation script. In src-tauri/src/git_attribution.rs, logic was added to resolve the branch's upstream remote or fall back to origin to avoid duplicate or incorrect GitHub links when multiple remotes exist. Finally, in src-tauri/src/lib.rs, a macOS-specific handler was added to re-show and focus the main window when the application is reopened without any visible windows. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Three bugs the
ide browsefeature (v0.11) surfaced, each with a confirmed root cause.ide browseopened the system browser instead of cmux's embedded one. The generated CLI wrapper ended withopen "$browse_url" >/dev/null 2>&1 &thenexit 0. Under cmux,openis a shim that hands the URL to acmux browser openchild; backgrounding it and exiting immediately orphans that child, which loses its pane context so the shim falls back to the system browser. Foregrounding theopenkeeps the wrapper alive through the handoff. An orphan-vs-foreground probe confirmed it: the backgrounded form falls to the system browser, the foreground form routes to cmux.origin, then the first) and shows a single action.RunEvent::Reopenhandler, so clicking the dock icon reactivated an app with no visible window. A macOS Reopen handler now re-shows and focuses the main window when nothing is visible.Test plan
ide browse .opens a cmux embedded tab. The orphan probe shows the foreground form routing to cmux and the backgrounded form falling to the system browser.pick_primary_templateunit test: two GitHub remotes resolve to one action for the tracking remote, withoriginand first-remote fallbacks.cargo test,cargo fmt --check, vitest (411), and both launcher-validation scripts.Summary by CodeRabbit
New Features
Bug Fixes