Repository navigation
Fix browser UA compatibility without blurring Google Sheets - #9054
Conversation
|
To use Codex here, create a Codex account and connect to github. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change adds a URL-sensitive Safari-compatible user-agent policy, applies it across browser and popup navigation surfaces, restarts navigations when the identity changes, and transfers automation transactions from replaced navigations to their replacements. It also adds an explicit shared-index workspace availability overload. ChangesBrowser user-agent policy
Workspace availability API
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant BrowserNavigationDelegate
participant WKWebView
participant BrowserPanel
participant BrowserAutomationNavigationCoordinator
BrowserNavigationDelegate->>WKWebView: apply policy and create restart request
BrowserNavigationDelegate->>WKWebView: cancel original navigation
BrowserNavigationDelegate->>BrowserPanel: start replacement navigation
BrowserPanel->>BrowserAutomationNavigationCoordinator: forward replaced and replacement IDs
BrowserAutomationNavigationCoordinator->>BrowserAutomationNavigationCoordinator: transfer active transaction
Possibly related PRs
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors, 2 warnings)
✅ Passed checks (21 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@Sources/Panels/BrowserNavigationDelegate.swift`:
- Around line 449-452: Extend the browser-user-agent lifecycle to handle server
redirects by applying the authoritative destination-based policy in
webView(_:didReceiveServerRedirectForProvisionalNavigation:) before continuing
or claiming a prewarmed view. Update
Sources/Panels/BrowserNavigationDelegate.swift:449-452 for main navigation,
Sources/Panels/BrowserPopupWindowController.swift:689-695 and 714-715 for popup
redirect/proceed paths, and
Sources/Panels/BrowserPrewarmedWebViewPool.swift:50-52 for prewarmed loads,
ensuring the final page URL is used consistently.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 442dfbb9-8a25-4a98-a5ee-a750042213e7
📒 Files selected for processing (7)
Sources/Panels/BrowserNavigationDelegate.swiftSources/Panels/BrowserPanel.swiftSources/Panels/BrowserPopupWindowController.swiftSources/Panels/BrowserPrewarmedWebViewPool.swiftSources/Panels/BrowserUserAgentPolicy.swiftcmux.xcodeproj/project.pbxprojcmuxTests/BrowserUserAgentPolicyTests.swift
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
Review follow-up pushed as Addressed findings:
Static validation passed: pbxproj normalization, 607-file test wiring audit, workspace package grouping, Package.resolved policy, Swift frontend parse for every changed Swift file, warnings-as-errors typecheck for the extracted policy, and @coderabbitai review |
@austinywang I can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 241,631 of the 240,000 allowed lines of code this month. Reviews resume on 1 August 2026 (in 4 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews. To help optimise your usage, you can tune cubic to get the most out of your usage limits:
|
|
Current-head CI for |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== commit and changed files ==='
git show --stat --oneline --decorate --find-renames 11c6efee86
git diff --name-status 11c6efee86^ 11c6efee86
echo '=== relevant source/test files ==='
fd -t f -e swift . | rg '(BrowserUserAgent|BrowserNavigationDelegate|BrowserPanel|BrowserPopup|WebView|Navigation|Transaction)'
echo '=== symbols and call sites ==='
rg -n -C 4 --glob '*.swift' \
'applyBrowserUserAgentPolicy|BrowserUserAgentPolicy|replay|transfer.*[Tt]ransaction|[Tt]ransfer.*[Nn]avigation|did(Start|Commit|Fail).*Navigation|decidePolicyFor' \
Sources Packages cmuxTests 2>/dev/null || true
echo '=== outlines ==='
for f in $(fd -t f -e swift . | rg '(BrowserUserAgent|BrowserNavigationDelegate|BrowserPanel|BrowserPopup|WebView|Navigation|Transaction)'); do
echo "--- $f"
ast-grep outline "$f" --items all 2>/dev/null || true
doneLength of output: 201375 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== follow-up diff ==='
git diff --find-renames --unified=80 11c6efee86^ 11c6efee86 -- \
Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/BrowserUserAgentPolicy.swift \
Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/BrowserUserAgentPolicyTests.swift \
Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/Control/BrowserAutomationNavigationCoordinator.swift \
Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/Control/BrowserAutomationNavigationCoordinatorTests.swift \
Sources/Panels/WKWebView+BrowserUserAgentPolicy.swift \
Sources/Panels/BrowserNavigationDelegate.swift \
Sources/Panels/BrowserPopupWindowController.swift \
cmuxTests/BrowserUserAgentPolicyWebKitTests.swift
echo '=== app replay helper and delegates ==='
for f in \
Sources/Panels/WKWebView+BrowserUserAgentPolicy.swift \
Sources/Panels/BrowserNavigationDelegate.swift \
Sources/Panels/BrowserPopupWindowController.swift \
cmuxTests/BrowserUserAgentPolicyWebKitTests.swift; do
echo "--- $f"
cat -n "$f"
done
echo '=== coordinator implementation and focused tests ==='
sed -n '1,360p' Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/Control/BrowserAutomationNavigationCoordinator.swift
sed -n '1,460p' Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/Control/BrowserAutomationNavigationCoordinatorTests.swift
echo '=== all app call sites and transaction callback context ==='
rg -n -C 10 --glob '*.swift' \
'\b(restartNavigationForUserAgentPolicyIfNeeded|didReplaceNavigation|didInterruptByPolicyChange|didFail\(|didCommit\(|didStart\(|applyBrowserUserAgentPolicy)\b' \
Sources/Panels cmuxTestsLength of output: 213289 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== BrowserPanel delegate wiring ==='
sed -n '3720,3945p' Sources/Panels/BrowserPanel.swift
echo '=== BrowserPanel navigation dispatch ==='
sed -n '6000,6245p' Sources/Panels/BrowserPanel.swift
sed -n '6470,6630p' Sources/Panels/BrowserPanel.swift
echo '=== every shared load helper call site ==='
rg -n -C 8 --glob '*.swift' '\bbrowserLoadRequest\s*\(' Sources cmuxTests
echo '=== request-navigation callback assignments and active-navigation tracking ==='
rg -n -C 12 --glob '*.swift' \
'(navigationDelegate\.requestNavigation|requestNavigation\s*=|activeMainFrameNavigation|didReplaceNavigationForUserAgentPolicy)' \
Sources cmuxTests
echo '=== diffs for all touched files in this follow-up ==='
git diff --name-only 11c6efee86^ 11c6efee86 | while IFS= read -r f; do
printf '\n--- %s ---\n' "$f"
git diff --unified=12 11c6efee86^ 11c6efee86 -- "$f"
doneLength of output: 135752
Please keep the original transaction pending across this deferred policy replay—e.g., transfer/mark the old navigation as an authorized replacement before issuing the cancellation, or suppress its cancellation until the replacement either starts or the prompt is declined. Add a regression test covering an identity-changing redirect that goes through the insecure-HTTP prompt. ✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@Sources/Panels/BrowserNavigationDelegate.swift`:
- Around line 464-491: Extract the shared target-frame validation and UA-policy
restart-request derivation from restartNavigationForUserAgentPolicyIfNeeded in
Sources/Panels/BrowserNavigationDelegate.swift:464-491 into one reusable helper,
preserving the main delegate’s strict main-frame guard; keep only
didReplaceNavigationForUserAgentPolicy reporting local to this call site. Update
Sources/Panels/BrowserPopupWindowController.swift:729-748 to use that helper and
remove its duplicated restart logic, ensuring both surfaces share the corrected
targetFrame behavior.
In `@Sources/Panels/BrowserPopupWindowController.swift`:
- Around line 729-748: Update restartNavigationForUserAgentPolicyIfNeeded so it
only handles existing main-frame navigations: require
navigationAction.targetFrame to be non-nil and its isMainFrame value to be true
before applying UA-policy restarts. Allow nil targetFrame actions to return
without cancelling, preserving the createWebViewWith new-window path.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 24932ae2-58b2-4dff-a4f7-7c45232e4b2e
📒 Files selected for processing (10)
Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/BrowserUserAgentPolicy.swiftPackages/macOS/CmuxBrowser/Sources/CmuxBrowser/Control/BrowserAutomationNavigationCoordinator.swiftPackages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/BrowserUserAgentPolicyTests.swiftPackages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/Control/BrowserAutomationNavigationCoordinatorTests.swiftSources/Panels/BrowserNavigationDelegate.swiftSources/Panels/BrowserPanel.swiftSources/Panels/BrowserPopupWindowController.swiftSources/Panels/WKWebView+BrowserUserAgentPolicy.swiftcmux.xcodeproj/project.pbxprojcmuxTests/BrowserUserAgentPolicyWebKitTests.swift
|
Addressed the deferred automation-lifecycle finding from #9054 (comment) in The exact old The new regression suite covers immediate transfer, an identity-changing redirect whose replacement is deferred across the HTTP prompt while both old cancellation forms arrive, and prompt decline/no-start. The follow-up Static validation passed; no local @coderabbitai review |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
Sources/Panels/BrowserNavigationDelegate.swift (1)
465-493: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winDuplicated UA-policy restart glue persists across surfaces.
restartNavigationForUserAgentPolicyIfNeededstill independently implements the cancel/strip-header/reissue logic that also exists inBrowserPopupWindowController.swift, unchanged from the prior review round. Extract the shared guard/restart-request derivation into a common helper so both surfaces stay in sync (only the automation-ticket reporting closures should remain call-site-specific).As per coding guidelines, "Do not wire the same behavior separately through multiple surfaces; use one shared action path."
🤖 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 `@Sources/Panels/BrowserNavigationDelegate.swift` around lines 465 - 493, Refactor restartNavigationForUserAgentPolicyIfNeeded and the corresponding BrowserPopupWindowController flow to use one shared helper for the main-frame guard and browserUserAgentPolicyRestartRequest derivation, while preserving each caller’s automation-ticket reporting closure. Keep cancellation and reissue behavior in the shared action path so both surfaces remain synchronized.Source: Coding guidelines
🤖 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.
Duplicate comments:
In `@Sources/Panels/BrowserNavigationDelegate.swift`:
- Around line 465-493: Refactor restartNavigationForUserAgentPolicyIfNeeded and
the corresponding BrowserPopupWindowController flow to use one shared helper for
the main-frame guard and browserUserAgentPolicyRestartRequest derivation, while
preserving each caller’s automation-ticket reporting closure. Keep cancellation
and reissue behavior in the shared action path so both surfaces remain
synchronized.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 63632cf3-c138-4566-a16c-a28d19505da6
📒 Files selected for processing (4)
Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/Control/BrowserAutomationNavigationCoordinator.swiftPackages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/Control/BrowserAutomationNavigationCoordinatorReplacementTests.swiftSources/Panels/BrowserNavigationDelegate.swiftSources/Panels/BrowserPanel.swift
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== follow-up commits ==='
git show --stat --oneline --find-renames 0f35c401e6
git show --stat --oneline --find-renames 4d9ebc7a60
echo
echo '=== files changed across both follow-ups ==='
git diff --name-status 0f35c401e6^ 4d9ebc7a60
echo
echo '=== candidate source and test maps ==='
fd -t f -e swift . | rg '(BrowserNavigationDelegate|BrowserPopupWindowController|BrowserAutomationNavigationCoordinator|BrowserUserAgentPolicy|WKWebView|BrowserPanel|Navigation.*Test|UserAgent.*Test)' | while IFS= read -r f; do
echo "--- $f"
ast-grep outline "$f" --items all 2>/dev/null || true
done
echo
echo '=== focused diffs ==='
git diff --find-renames --unified=60 0f35c401e6^ 4d9ebc7a60 -- \
Sources/Panels/BrowserNavigationDelegate.swift \
Sources/Panels/BrowserPopupWindowController.swift \
Sources/Panels/WKWebView+BrowserUserAgentPolicy.swift \
Sources/Panels/BrowserPanel.swift \
Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/Control/BrowserAutomationNavigationCoordinator.swift \
Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/Control/BrowserAutomationNavigationCoordinatorTests.swift \
cmuxTests/BrowserUserAgentPolicyWebKitTests.swift
echo
echo '=== replay authorization, completion, and delegate call sites ==='
rg -n -C 12 --glob '*.swift' \
'\b(authoriz|replace|replacement|restartNavigationForUserAgentPolicyIfNeeded|didReplaceNavigation|didCancelProvisionalNavigation|didFailProvisionalNavigation|didInterrupt|insecure|decisionHandler\s*\(\.cancel|requestNavigation)\b' \
Sources/Panels Packages/macOS/CmuxBrowser/Sources Packages/macOS/CmuxBrowser/Tests cmuxTestsLength of output: 202130 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== commit file lists ==='
git diff-tree --no-commit-id --name-status -r 0f35c401e6
git diff-tree --no-commit-id --name-status -r 4d9ebc7a60
echo
echo '=== exact diffs ==='
git diff --unified=35 0f35c401e6^ 0f35c401e6
git diff --unified=35 4d9ebc7a60^ 4d9ebc7a60
echo
echo '=== policy replay symbols only ==='
rg -n -C 18 --glob '*.swift' \
'authorizeNavigationReplacement|completeNavigationReplacement|restartNavigationForUserAgentPolicyIfNeeded|didReplaceNavigationForUserAgentPolicy|didCancelProvisionalNavigation|didCancelNavigationPolicy' \
Sources/Panels Packages/macOS/CmuxBrowser/Sources Packages/macOS/CmuxBrowser/Tests cmuxTests
echo
echo '=== focused test declarations ==='
rg -n -C 30 --glob '*.swift' \
'deferred|insecure.*HTTP|replacement.*(cancel|transfer)|policy.*replacement|authorization' \
Packages/macOS/CmuxBrowser/Tests cmuxTests
echo
echo '=== relevant portions of captured output, if present ==='
rg -n 'BrowserNavigationDelegate.swift|BrowserPopupWindowController.swift|BrowserAutomationNavigationCoordinator.swift|BrowserUserAgentPolicyWebKitTests.swift' \
/tmp/coderabbit-shell-logs/shell-output-O7GlPV | head -n 120Length of output: 201871 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== changed files ==='
git diff-tree --no-commit-id --name-only -r 0f35c401e6
git diff-tree --no-commit-id --name-only -r 4d9ebc7a60
echo
echo '=== BrowserNavigationDelegate: declarations, callbacks, and policy replay ==='
cat -n Sources/Panels/BrowserNavigationDelegate.swift | sed -n '1,180p;240,560p'
echo
echo '=== BrowserPopupWindowController: policy replay ==='
cat -n Sources/Panels/BrowserPopupWindowController.swift | sed -n '1,420p'
echo
echo '=== BrowserPanel: wiring of replacement lifecycle ==='
rg -n -C 16 --glob 'BrowserPanel.swift' \
'willReplaceNavigationForUserAgentPolicy|didReplaceNavigationForUserAgentPolicy|requestNavigation\s*=' \
Sources/Panels/BrowserPanel.swift
echo
echo '=== BrowserAutomationNavigationCoordinator: replacement state ==='
cat -n Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/Control/BrowserAutomationNavigationCoordinator.swift | sed -n '1,420p'
echo
echo '=== focused test methods and bodies ==='
rg -n --glob 'BrowserAutomationNavigationCoordinatorTests.swift' '^\s*`@Test`|^\s*func ' \
Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/Control/BrowserAutomationNavigationCoordinatorTests.swift
cat -n Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/Control/BrowserAutomationNavigationCoordinatorTests.swift | tail -n 260
rg -n --glob 'BrowserUserAgentPolicyWebKitTests.swift' '^\s*`@Test`|^\s*func ' \
cmuxTests/BrowserUserAgentPolicyWebKitTests.swift
cat -n cmuxTests/BrowserUserAgentPolicyWebKitTests.swiftLength of output: 91451 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== dedicated replacement coordinator tests ==='
cat -n Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/Control/BrowserAutomationNavigationCoordinatorReplacementTests.swift
echo
echo '=== BrowserPanel request-navigation implementation and insecure prompt completion ==='
rg -n --glob 'BrowserPanel.swift' \
'func requestNavigation|func presentInsecureHTTPAlert|onNavigationStarted|BrowserInsecureHTTPNavigationIntent' \
Sources/Panels/BrowserPanel.swift
cat -n Sources/Panels/BrowserPanel.swift | sed -n '6000,6320p'
echo
echo '=== shared replay helper ==='
cat -n Sources/Panels/WKWebView+BrowserUserAgentPolicy.swift
echo
echo '=== popup navigation delegate and main-frame replay path ==='
rg -n -C 16 --glob 'BrowserPopupWindowController.swift' \
'final class PopupNavigationDelegate|restartNavigationForUserAgentPolicyIfNeeded|targetFrame.*isMainFrame|requestNavigation\(' \
Sources/Panels/BrowserPopupWindowController.swiftLength of output: 33433
I did not run runtime tests locally; this review is based on targeted source and test inspection. No further issues found. If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! |
|
Current-head CI for |
|
CI repair pushed as The Fresh current-head CI: https://github.com/manaflow-ai/cmux/actions/runs/30360052501 |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
Safari support-floor follow-up:
Regression pair:
Current-head CI: https://github.com/manaflow-ai/cmux/actions/runs/30391946301 |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
@austinywang I can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 241,631 of the 240,000 allowed lines of code this month. Reviews resume on 1 August 2026 (in 4 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews. To help optimise your usage, you can tune cubic to get the most out of your usage limits:
|
|
To use Codex here, create a Codex account and connect to github. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== PR head and recent commits ==='
gh pr view 9054 --repo manaflow-ai/cmux --json headRefOid,commits,statusCheckRollup \
--jq '{headRefOid, commits: [.commits[] | {oid, messageHeadline}], statusCheckRollup: [.statusCheckRollup[] | {name, status, conclusion}]}'
echo '=== follow-up commit details ==='
git show --stat --oneline --find-renames 7ff6d68cfe
git show --stat --oneline --find-renames 2dfc28ad92
echo '=== current-head changes after prior accepted replay follow-up ==='
git diff --name-status 4d9ebc7a60..HEAD
git diff --find-renames --unified=80 4d9ebc7a60..HEAD -- \
Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/BrowserUserAgentPolicy.swift \
Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/BrowserUserAgentPolicyTests.swift \
Sources/Workspace+ForkAgentConversationAvailability.swift
echo '=== policy and test structure ==='
ast-grep outline Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/BrowserUserAgentPolicy.swift --items all
ast-grep outline Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/BrowserUserAgentPolicyTests.swift --items all
echo '=== focused source and tests ==='
cat -n Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/BrowserUserAgentPolicy.swift
cat -n Packages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/BrowserUserAgentPolicyTests.swift
echo '=== policy construction and identity consumers ==='
rg -n -C 6 --glob '*.swift' \
'\bBrowserUserAgentPolicy\b|safariCompatibleUserAgent|customUserAgent\s*\(' \
Packages Sources cmuxTestsLength of output: 48917
The compatibility floor correctly uses numeric component comparison, raises stale/invalid candidates to Safari 26.6, preserves newer versions, and retains the Sheets embedded-WebKit exception. The Swift 6 actor-isolation repair also preserves the convenience API while keeping the injectable overload for tests. I did not run local builds or tests; this is based on focused source and regression-test inspection. ✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/BrowserUserAgentPolicy.swift`:
- Around line 27-29: Update versionComponents(from:) to return [Int] instead of
[Int]?, using an empty array for invalid input. In the candidate-version logic,
replace optional binding with an isEmpty check, assigning non-empty parsed
components and preserving the existing fallback behavior for invalid Safari
versions.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 075a4065-e94c-4b63-a98b-c6df8caf113f
📒 Files selected for processing (3)
Packages/macOS/CmuxBrowser/Sources/CmuxBrowser/BrowserUserAgentPolicy.swiftPackages/macOS/CmuxBrowser/Tests/CmuxBrowserTests/BrowserUserAgentPolicyTests.swiftSources/Workspace+ForkAgentConversationAvailability.swift
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Current-head CI is green for All 18 jobs passed on attempt 2, including the Safari support-floor regression and universal Release build. Attempt 1 had one unrelated timing failure in |
Summary
BrowserUserAgentPolicyReveal geometry is intentionally unchanged: #8697's controlled same-URL experiments disproved it as the Sheets blur cause, while the standalone Safari identity reproduced the 0.5 backing/CSS canvas ratio.
The configurable override requested in #7513 remains a complementary follow-up rather than the default fix: arbitrary sites get correct compatibility behavior without configuration, and a future override can sit above this pure policy.
Closes #9052
Testing
7ff6d68cfefailed on installed 26.4 remaining 26.4; fix2dfc28ad92raises it to 26.6 while preserving newer 27.x versions; red CI job: https://github.com/manaflow-ai/cmux/actions/runs/30390021738/job/90379876425; review cleanupc9e336824eremoves the optional-collection lint warning; current-head CI: https://github.com/manaflow-ai/cmux/actions/runs/30392519058 (18 jobs green on attempt 2; the isolated rerun cleared one unrelated timing-test flake)0f35c401e6: authorize the exact old navigation before cancellation, preserve automation across a deferred insecure-HTTP prompt, transfer on allow, and cancel on no-start/decline4d9ebc7a60: centralize pane and popup replay behind one strict existing-main-frame path; nil/new-window and subframe targets remain untouchedf74bef3e38test-only,0478aed897implementation)./scripts/lint-pbxproj-test-wiring.sh./scripts/check-pbxproj.shpython3 scripts/check-package-resolved-policy.pyxcrun swiftc -frontend -parsefor all changed Swift filesxcrun swiftc -typecheck -warnings-as-errors Sources/Panels/BrowserUserAgentPolicy.swiftgit diff --checkxcodebuildwas run.github/swift-file-length-budget.tsvorscripts/swift_file_length_budget.py(removed upstream in Remove Swift file length budget #8125); no budget TSV was touched, the new files are below 500 lines, andBrowserPanel.swiftshrankDemo Video
Cloud-mac visual verification has not been run yet. The run and full-screen recording evidence for both the Workspace gate and Sheets canvas ratio remain pending before merge readiness is reported.
Review Trigger (Copy/Paste as PR comment)
Checklist
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Adds a URL-aware browser user agent policy that uses a Safari‑compatible UA for most sites while keeping WKWebView’s native UA for Google Sheets to prevent blur. Floors the advertised Safari version to current stable when local Safari is older, and restarts top‑level navigations on identity changes so sites see the right UA immediately. Closes #9052.
Bug Fixes
applyBrowserUserAgentPolicy,browserUserAgentPolicyRestartRequest,restartNavigationForBrowserUserAgentPolicyIfNeeded) to swap UA, strip staleUser-Agent, and replay main‑frame loads; used in panels, popups, nested popups, prewarmed views.BrowserAutomationNavigationCoordinator.willReplaceNavigationand.didReplaceNavigation; policy cancellations for the replaced load are ignored until the replacement starts.URLSessionrequests now useBrowserUserAgentPolicy.system.safariCompatibleUserAgent.SharedLiveAgentIndexvia a convenience overload to avoid cross‑actor default parameter use.Refactors
Written for commit c9e3368. Summary will update on new commits.
Summary by CodeRabbit