Repository navigation
fix(wework): keep inactive task browsers available - #2513
Conversation
|
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 keeps task workbenches mounted while hiding inactive surfaces, routes browser requests through task-specific labels, validates isolated background browser activity, and updates macOS cache clearing to target disk cache only. ChangesEmbedded browser lifecycle
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ActiveTask
participant InactiveTask
participant BrowserBridge
participant BrowserHost
ActiveTask->>BrowserBridge: Keep active task browser route
InactiveTask->>BrowserBridge: Send task-specific browser request
BrowserBridge->>BrowserHost: Route request to inactive task host
BrowserHost-->>InactiveTask: Complete background navigation
ActiveTask->>ActiveTask: Switch task tabs
ActiveTask-->>BrowserHost: Restore inactive task browser state
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 `@wework/e2e/desktop/scenarios/embedded-browser-agent.scenario.mjs`:
- Around line 456-525: Extend the embedded-browser scenario after the initial
active-browser lookup to assert that activeBrowserLabel is non-empty, then after
inactiveInspect re-read the selected task tab and its active browser label.
Assert they still equal secondTaskTabTestId and activeBrowserLabel, confirming
the inactive-task bridge calls did not activate task A or change task B’s
browser host.
🪄 Autofix
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: 0b2fe604-cdff-4425-a874-3705dbd236e8
📒 Files selected for processing (8)
docs/en/wework/browser.mddocs/en/wework/developer-guide/wework-embedded-browser.mddocs/zh/wework/browser.mddocs/zh/wework/developer-guide/wework-embedded-browser.mdwework/e2e/desktop/scenarios/embedded-browser-agent.scenario.mjswework/src-tauri/src/embedded_browser/data_clearing.rswework/src/App.apps.test.tsxwework/src/App.tsx
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 `@wework/e2e/desktop/scenarios/embedded-browser-agent.scenario.mjs`:
- Around line 527-546: Extend the assertions after inactiveInspect to verify
task A’s workspace-tab-content element, identified by the first task’s
workspace-tab-content-${firstTaskTabId} selector, has the hidden attribute. Keep
the existing selected-task and active-browser-label assertions unchanged, and
assert the hidden state directly so the inactive task surface cannot become
visible unnoticed.
🪄 Autofix
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: ab5a1409-79b0-4065-be14-36170da9c287
📒 Files selected for processing (3)
wework/e2e/desktop/scenarios/embedded-browser-agent.scenario.mjswework/src/App.apps.test.tsxwework/src/App.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- wework/src/App.apps.test.tsx
- wework/src/App.tsx
…ask-browser-routing # Conflicts: # wework/src/components/layout/DesktopWorkbenchMain.tsx
What changed
Why
Each runtime task already receives a distinct embedded-browser label, but inactive top-level task tabs were wrapped in React
Activityhidden mode. That deactivated the workbench effect that consumes task-scoped browser requests, so an agent operating an inactive task timed out even though its browser label was correct.The updated task surface remains effect-active and is hidden with the HTML
hiddenattribute. Non-task tabs retain the existing suspended behavior, and the native browser for an inactive task remains invisible.User impact
Multiple Wework task tabs keep independent browser sessions. An agent can continue opening and inspecting the browser associated with its own task while another task tab is selected, and switching back reveals the updated page.
This does not add browser-internal tabs: each task still owns one embedded-browser host.
Validation
pnpm --filter wework test— 332 files, 3195 tests passedpnpm --filter wework exec eslint src/App.tsx src/App.apps.test.tsx e2e/desktop/scenarios/embedded-browser-agent.scenario.mjspnpm --filter wework exec prettier --check ...pnpm --filter wework e2e:desktop:embedded-browser— real Tauri scenario passedSummary by CodeRabbit
New Features
Bug Fixes
Tests