Repository navigation
fix(ui): preserve browser focus during passive follow - #134480
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 4:58 AM ET / 08:58 UTC (Revision 8). ClawSweeper reviewWhat this changesThe Browser panel follows session results without explicitly activating the browser tab and rejects missing historical targets before capture. Merge readiness✅ Ready for maintainer review This PR remains useful: current main and the latest release still explicitly focus tabs during passive follow. The merged capture prerequisite resolves the earlier concern, and no blocking defect remains in the reviewed patch. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI Browser panel receives browser targets from session results or explicit user selections. Its shared selection controller routes tab discovery and capture through the Gateway to the selected browser. flowchart TD
A[Session browser result] --> C[Shared tab selection]
B[Explicit card or tab choice] --> C
C --> D[Refresh and validate target]
D --> E{Explicit focus requested?}
E -->|Yes| F[Activate browser tab]
E -->|No| G[Capture panel view]
F --> G
D -->|Missing target| H[Show error and restore safe view]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +13, Tests +74. Total +87 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep passive follow on the shared selection and capture path, reserving explicit focus for user choices while preserving safe unavailable-tab recovery. Do we have a high-confidence way to reproduce the issue? Yes: current main routes a successful session browser result through unconditional explicit focus, and the captured acceptance report describes the corresponding physical-tab activation. This review verified the source path without executing it. Is this the best way to solve the issue? Yes: the patch separates focus intent at the existing selection owner and preserves routed capture and rollback, avoiding a parallel passive-selection implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 113e8cf6b934. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
@clawsweeper re-review Accepted the P1 owner-boundary finding. I chose the review's narrow this PR's claim option rather than duplicating #134400's Browser-owner implementation into this UI PR.
The complete external-headed-Chrome outcome requires both owner repairs. After #134400 lands, this PR's GitHub test-merge will contain both; that is the correct exact candidate for the requested combined Control UI + real Chrome proof. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
fc0ee7a to
969162d
Compare
969162d to
1b38cd9
Compare
Keep passive result following on the shared tab selection path while skipping its explicit focus request. Preserve routed capture, lifecycle checks, and explicit card and tab selection actions.
Validate routed selection against its accepted current tab list before capture. Report an unavailable tab and retain the safe selection rollback, so stale history cannot start repeated stream and screenshot requests.
|
Thanks @scotthuang! Proof: A real Control UI agent turn through the Browser tool updated the panel from Sentinel to a background Result page, displayed newly changed content, and kept Sentinel physically active. The baseline sent one passive focus request; the repaired flow sent none. Explicit Open and selection of a different tab each still focused once.
A separate background screenshot timed out and remains failed evidence. This change does not claim general screenshot reliability. Native macOS and remote-node routes have source/component coverage; no live native-app or remote-node result is claimed. Raw captures remain private. |
Related: openclaw#134400, openclaw#139089 ## What Problem This Solves The Browser panel followed session results through the explicit tab-selection path. That sent `/tabs/focus` and activated the result tab in an attached browser, even when the operator had left another tab active. ## Why This Change Was Made Passive following now skips explicit focus while retaining the shared route, capture, lifecycle, and rollback owners. Card Open and selection of a different panel tab still focus normally. Clicking an already-selected panel tab retains its existing no-op. The selection owner also rejects a historical target absent from its accepted current tab list before capture. This preserves the validation previously supplied by the focus request, restores a valid prior view when safe, and prevents a missing target from entering repeated stream/screenshot recovery. The error directs the operator to select another tab. ## User Impact Successful Browser results can update the panel without changing the operator's physical browser tab. The merged capture-owner repair in openclaw#134400 remains in place. Current streaming, screenshot fallback, attach-only policy, native and remote routes, configuration, protocol, and Browser-card semantics are preserved. ## Evidence - A public Control UI agent turn through the real Browser tool reproduced one passive focus request and physical tab activation on pinned main. With the same rendered-tab precondition, the final candidate produced no focus request and preserved the sentinel tab while refreshing the result view. - Fresh source-blind acceptance also exercised the full selection change: the panel and physical browser initially selected Sentinel; a public Browser evaluation of the other Result page changed the panel to Result, displayed newly changed content through routed screenshot/stream capture, and left Sentinel physically active. Explicit Open and different-tab selection each focused once; later results added no focus. Context changes, unavailable history, and recovery were exercised. - The passive-focus regression failed on main. Two additional missing-history cases failed on the initial candidate for invalid selection, lost rollback, and repeated capture. The corrected candidate passed 138 focused tests across selection, routes, input, pending navigation, snapshot races, streaming, and native boundaries. Formatting and keyless language checks passed. - [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/34328435157) passed, including all four cases in the changed [Browser route E2E suite](https://github.com/openclaw/openclaw/actions/runs/34328435157/job/102391432114). The native supplemental E2E attempt hit its 4 GiB limit; that failure was retained and the hosted lane supplied the completed check without raising the native limit. A background Browser-tool screenshot timed out in a separate acceptance attempt. It remains failed evidence, not a passing capture or a claim of general screenshot reliability. The successful evaluation case above verifies the combined background-target selection and fresh-view outcome. Native macOS and remote-node behavior have source/component coverage; no live native-app or remote-node proof is claimed. Raw captures remain private. Thanks @scotthuang for the original passive-focus correction. Contributor ancestry and prior review history are preserved. Co-authored-by: scotthuang <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #134400, #139089
What Problem This Solves
The Browser panel followed session results through the explicit tab-selection path. That sent
/tabs/focusand activated the result tab in an attached browser, even when the operator had left another tab active.Why This Change Was Made
Passive following now skips explicit focus while retaining the shared route, capture, lifecycle, and rollback owners. Card Open and selection of a different panel tab still focus normally. Clicking an already-selected panel tab retains its existing no-op.
The selection owner also rejects a historical target absent from its accepted current tab list before capture. This preserves the validation previously supplied by the focus request, restores a valid prior view when safe, and prevents a missing target from entering repeated stream/screenshot recovery. The error directs the operator to select another tab.
User Impact
Successful Browser results can update the panel without changing the operator's physical browser tab. The merged capture-owner repair in #134400 remains in place. Current streaming, screenshot fallback, attach-only policy, native and remote routes, configuration, protocol, and Browser-card semantics are preserved.
Evidence
A background Browser-tool screenshot timed out in a separate acceptance attempt. It remains failed evidence, not a passing capture or a claim of general screenshot reliability. The successful evaluation case above verifies the combined background-target selection and fresh-view outcome. Native macOS and remote-node behavior have source/component coverage; no live native-app or remote-node proof is claimed. Raw captures remain private.
Thanks @scotthuang for the original passive-focus correction. Contributor ancestry and prior review history are preserved.