feat(wework): complete isolated workspace tabs - #2359
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 PR adds persisted workspace document tabs with route synchronization, project selection integration, independent workspace windows, workspace screenshot capture, launcher styling, titlebar updates, credential hydration changes, automated tests, E2E checks, and QA evidence. ChangesWorkspace document tabs
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ChromeTitlebar
participant WorkspaceTabsProvider
participant CloudTodoWorkspace
participant WorkspaceWindow
User->>ChromeTitlebar: create or select workspace tab
ChromeTitlebar->>WorkspaceTabsProvider: update active tab and route
WorkspaceTabsProvider->>CloudTodoWorkspace: provide active project ID
CloudTodoWorkspace-->>WorkspaceTabsProvider: report project selection
User->>WorkspaceWindow: open tab in new window
WorkspaceWindow-->>User: show and focus workspace window
Possibly related PRs
Suggested reviewers: 🚥 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: 11
🧹 Nitpick comments (5)
wework/src/features/workspace-tabs/workspaceWindow.test.ts (1)
28-76: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the
tauri://errorand timeout branches.The suite covers the browser fallback and the successful Tauri creation path. It does not cover the
tauri://errorrejection or the creation-timeout path inopenWorkspaceTabWindow. These are the two error-handling branches of the function and are currently unverified.Add a test that makes
onceinvoke the'tauri://error'callback, and assert the promise rejects with the error message. Add a test that never invokes'tauri://created', uses fake timers to advance past the timeout, and asserts rejection (and, once the leak fix lands, that the window is closed).🤖 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 `@wework/src/features/workspace-tabs/workspaceWindow.test.ts` around lines 28 - 76, Add coverage in the openWorkspaceTabWindow tests for both unverified failure paths: configure once to invoke the tauri://error callback and assert openWorkspaceTabWindow rejects with the reported error message, then add a fake-timer test where tauri://created is never invoked, advance beyond the creation timeout, and assert rejection plus closure of the created window once that cleanup is implemented.wework/src/features/workspace-tabs/WorkspaceTabsContext.tsx (1)
176-301: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider splitting
WorkspaceTabsProviderinto smaller units.
WorkspaceTabsProvideris about 125 lines and combines persistence, sevenuseCallbackhandlers, and the memoized context value. Extracting the tab-action callbacks (e.g., into auseWorkspaceTabsActions(state, dispatch, labels)hook) would keep each unit under the guideline size and make the individual actions easier to test in isolation.As per path instructions: "Comments must be in English, names must be clear, and functions should remain focused, preferably under 50 lines."
🤖 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 `@wework/src/features/workspace-tabs/WorkspaceTabsContext.tsx` around lines 176 - 301, Split WorkspaceTabsProvider into smaller focused units, extracting the tab-action callbacks into a clearly named useWorkspaceTabsActions hook that receives state, dispatch, and labels and returns the existing actions. Keep persistence, state initialization, and context memoization in WorkspaceTabsProvider, preserving all current behavior while keeping each function preferably under 50 lines and using clear English names.Source: Path instructions
wework/src/features/workspace-tabs/WorkspaceTabStrip.tsx (2)
254-261: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winClamp the context menu to the viewport.
The add menu uses
menuPosition, which clampsleftagainstwindow.innerWidth. The context menu uses the rawevent.clientXandevent.clientY. A right-click near the right edge pushes the 196px menu off screen. Reuse the same clamp for both menus.🤖 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 `@wework/src/features/workspace-tabs/WorkspaceTabStrip.tsx` around lines 254 - 261, Update the context-menu positioning in WorkspaceTabStrip, where the portal style uses contextMenu.left and contextMenu.top, to clamp both coordinates against the viewport using the same menuPosition logic as the add menu. Account for the context menu’s 196px width and its height when constraining right and bottom edges, while preserving valid spacing from the viewport.
83-98: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider tightening the tab ARIA structure.
The element carries
role="tab"andaria-selected, but it is not focusable and contains two nested buttons. Screen readers announce a tab that cannot receive focus, and the tablist has no arrow-key navigation. Movingrole="tab"andaria-selectedonto the select button, and keeping the wrapper as a plain container, matches the tabs pattern more closely.🤖 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 `@wework/src/features/workspace-tabs/WorkspaceTabStrip.tsx` around lines 83 - 98, Update the tab markup in the WorkspaceTabStrip rendering so the outer wrapper becomes a plain container without role="tab" or aria-selected, and apply those attributes to the select button instead. Ensure the select button is focusable and retains the tab’s active-state semantics while preserving the existing nested close-button behavior and drag/context-menu handlers.wework/src/features/todo/CloudTodoWorkspace.test.tsx (1)
204-225: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winFeed the reported project back into the controlled prop.
activeProjectIdstaysnullfor the whole test, so the component never enters the selected state. The assertion on line 223 then passes even if selection state was never tracked. Wrap the component in a small stateful harness that setsactiveProjectIdfromonActiveProjectChange. The test then covers the real synchronization path and can assert the resulting project name.🤖 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 `@wework/src/features/todo/CloudTodoWorkspace.test.tsx` around lines 204 - 225, Update the test around CloudTodoWorkspace so a stateful harness feeds each onActiveProjectChange result back into the activeProjectId prop, including resetting it to null. Keep the existing project-selection interactions, and assert the selected project name after synchronization so the test exercises the controlled state path rather than a permanently null prop.
🤖 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/task-flow.e2e.mjs`:
- Around line 2944-2953: Replace the immediate snapshot parsing and assertion
after the board-tab close click with the existing waitForSnapshot helper,
polling until no testId starts with workspace-tab-board-. Preserve the current
failure message and removal condition, following the established pattern used
elsewhere in this test file.
In `@wework/src-tauri/capabilities/default.json`:
- Line 5: Restrict the default capability’s window scope by removing workspace-*
from the windows list in default.json. Define a separate capability for
workspace-* windows containing only the permissions required by secondary
workspace routes, excluding shell execution/opening, unscoped HTTP, dialog,
notification, and webview-creation permissions.
In `@wework/src-tauri/src/desktop_capture.rs`:
- Around line 22-40: The fallback in capture_workspace_webview must select a
deterministic workspace window instead of using HashMap iteration order. Replace
the into_keys().find fallback with logic that filters workspace- labels,
compares their timestamp suffixes, and selects the lexicographically greatest
label; preserve focused-window preference and the existing error when no
workspace window exists.
In `@wework/src/App.tsx`:
- Line 320: Update the workspaceTabStorageScope initialization in App so browser
windows receive a stable, unique per-window scope instead of the shared
'browser' value, while preserving the existing Tauri window-label scope. Use
window.name or another persistent generated window identifier compatible with
WorkspaceTabsProvider storageKey usage.
In `@wework/src/features/todo/CloudTodoWorkspace.tsx`:
- Around line 214-215: Reset project-specific view, board parent, search, and
filter state when the controlled activeProjectId changes externally. Add an
effect keyed to activeProjectId and use a ref or equivalent marker to
distinguish updates initiated by selectProject/applyProjectSelection, preserving
deliberate internal overrides such as onManageProject setting projectView to
manage after selection. Reuse the existing applyProjectSelection reset behavior
without duplicating divergent logic.
In `@wework/src/features/workspace-tabs/workspaceTabs.ts`:
- Around line 51-65: Update WorkspaceTabLabels and workspaceTabTitle to use
caller-provided localized labels for the auxiliary routes instead of hardcoded
English strings. Extend App.tsx’s workspaceTabLabels useMemo with t() values for
Plugins, Sites, Automations, Cloud, and Apps, and add the corresponding
translations to the appropriate Wework namespace in both English and Chinese
locale files.
In `@wework/src/features/workspace-tabs/WorkspaceTabsContext.tsx`:
- Around line 149-160: Compute the collision-adjusted restored tab ID once in
restoreClosedTab, pass that restored tab through the restoreClosed action, and
have the restoreClosed reducer reuse the supplied tab instead of generating
another ID. Keep the existing non-collision behavior and ensure
navigateTo(workspaceTabRoute(...)) and the reducer state reference the same
restored tab.
In `@wework/src/features/workspace-tabs/WorkspaceTabStrip.tsx`:
- Around line 134-135: Update WorkspaceTabButton to call
useTranslation('common') and replace the hardcoded aria-label and title close
text with the translated workbench.workspace_tab_close key, passing the tab
title as its interpolation value. Add matching workspace_tab_close entries to
the English and zh-CN common locale files.
- Around line 76-80: Update handleDragOver to stop reading the source tab ID
from event.dataTransfer, since that value is unavailable during dragover in
Chromium/WebKit. Reuse the drag-start tab ID from the surrounding drag state for
moveTab(sourceId, tab.id), or perform the reorder in the existing drop handler
while preserving the self-tab guard.
In `@wework/src/features/workspace-tabs/workspaceWindow.ts`:
- Around line 46-68: Update the timeout handler in the workspace window creation
flow to close or destroy workspaceWindow before rejecting via finish. Preserve
the existing timeout error and cleanup behavior, and ensure the close operation
is handled without preventing the rejection if it fails.
In `@wework/src/styles/globals.css`:
- Around line 75-95: Update the tablist container in WorkspaceTabStrip so the
10px-outset corners from workspace-document-tab-active::before and ::after are
not clipped: either add sufficient horizontal padding or replace overflow-hidden
with overflow-x-auto overflow-y-visible, while preserving the intended tablist
scrolling behavior.
---
Nitpick comments:
In `@wework/src/features/todo/CloudTodoWorkspace.test.tsx`:
- Around line 204-225: Update the test around CloudTodoWorkspace so a stateful
harness feeds each onActiveProjectChange result back into the activeProjectId
prop, including resetting it to null. Keep the existing project-selection
interactions, and assert the selected project name after synchronization so the
test exercises the controlled state path rather than a permanently null prop.
In `@wework/src/features/workspace-tabs/WorkspaceTabsContext.tsx`:
- Around line 176-301: Split WorkspaceTabsProvider into smaller focused units,
extracting the tab-action callbacks into a clearly named useWorkspaceTabsActions
hook that receives state, dispatch, and labels and returns the existing actions.
Keep persistence, state initialization, and context memoization in
WorkspaceTabsProvider, preserving all current behavior while keeping each
function preferably under 50 lines and using clear English names.
In `@wework/src/features/workspace-tabs/WorkspaceTabStrip.tsx`:
- Around line 254-261: Update the context-menu positioning in WorkspaceTabStrip,
where the portal style uses contextMenu.left and contextMenu.top, to clamp both
coordinates against the viewport using the same menuPosition logic as the add
menu. Account for the context menu’s 196px width and its height when
constraining right and bottom edges, while preserving valid spacing from the
viewport.
- Around line 83-98: Update the tab markup in the WorkspaceTabStrip rendering so
the outer wrapper becomes a plain container without role="tab" or aria-selected,
and apply those attributes to the select button instead. Ensure the select
button is focusable and retains the tab’s active-state semantics while
preserving the existing nested close-button behavior and drag/context-menu
handlers.
In `@wework/src/features/workspace-tabs/workspaceWindow.test.ts`:
- Around line 28-76: Add coverage in the openWorkspaceTabWindow tests for both
unverified failure paths: configure once to invoke the tauri://error callback
and assert openWorkspaceTabWindow rejects with the reported error message, then
add a fake-timer test where tauri://created is never invoked, advance beyond the
creation timeout, and assert rejection plus closure of the created window once
that cleanup is implemented.
🪄 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: d23fafa4-1657-47b2-a139-9fcb390d02c4
📒 Files selected for processing (27)
design-qa.mdwework/e2e/desktop/task-flow.e2e.mjswework/scripts/ai-verify.mjswework/src-tauri/capabilities/default.jsonwework/src-tauri/src/desktop_capture.rswework/src-tauri/src/lib.rswework/src/App.apps.test.tsxwework/src/App.tsxwework/src/components/layout/DesktopAppSwitcher.test.tsxwework/src/components/layout/DesktopAppSwitcher.tsxwework/src/components/layout/DesktopWorkbenchLayout.tsxwework/src/components/topnav/ChromeTitlebar.test.tsxwework/src/components/topnav/ChromeTitlebar.tsxwework/src/e2e/automation.tswework/src/features/todo/CloudTodoWorkspace.test.tsxwework/src/features/todo/CloudTodoWorkspace.tsxwework/src/features/workspace-tabs/WorkspaceTabStrip.test.tsxwework/src/features/workspace-tabs/WorkspaceTabStrip.tsxwework/src/features/workspace-tabs/WorkspaceTabsContext.tsxwework/src/features/workspace-tabs/workspaceTabs.test.tswework/src/features/workspace-tabs/workspaceTabs.tswework/src/features/workspace-tabs/workspaceTabsContextValue.tswework/src/features/workspace-tabs/workspaceWindow.test.tswework/src/features/workspace-tabs/workspaceWindow.tswework/src/i18n/locales/en/common.jsonwework/src/i18n/locales/zh-CN/common.jsonwework/src/styles/globals.css
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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 `@design-qa.md`:
- Around line 19-20: Reorder the documentation sections in design-qa.md so the
Chinese workspace-tabs documentation appears before the English “Workspace
Document Tabs Follow-up Review” section, preserving the content of both sections
unchanged.
- Line 23: Replace the developer-specific absolute reference path in the design
evidence entry with a repository-relative path or a review artifact attachment,
ensuring all reviewers and CI can access the referenced image.
- Around line 53-61: Add case-level QA evidence to the “Interaction and
accessibility verification” section for every changed tab flow, documenting
preconditions, environment, test data, exact steps, expected and actual results,
negative and recovery cases, cleanup, and supporting evidence. Retain the
existing accessibility and visual verification outcomes while expanding the
flows into complete QA cases.
In `@wework/src-tauri/capabilities/workspace-window.json`:
- Around line 7-20: Remove the "core:default" entry from the workspace-window
capability permissions, leaving the explicit window chrome permissions in place.
Do not add broader core permissions unless a concrete caller requires them.
In `@wework/src/features/todo/CloudTodoWorkspace.test.tsx`:
- Line 234: Update the project ID passed to CloudTodoWorkspace in the test
fixture around project.id so it is an actual string, using String(project.id) or
defining the fixture ID as a string. Remove the as unknown as string cast and
preserve the controlled string-ID behavior used by the component.
🪄 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: 7dd6b08c-6165-44d4-b194-f5d6a382cc53
📒 Files selected for processing (19)
design-qa.mdwework/e2e/desktop/task-flow.e2e.mjswework/src-tauri/capabilities/workspace-window.jsonwework/src-tauri/src/desktop_capture.rswework/src/App.apps.test.tsxwework/src/App.tsxwework/src/components/topnav/ChromeTitlebar.test.tsxwework/src/features/todo/CloudTodoWorkspace.test.tsxwework/src/features/todo/CloudTodoWorkspace.tsxwework/src/features/workspace-tabs/WorkspaceTabStrip.test.tsxwework/src/features/workspace-tabs/WorkspaceTabStrip.tsxwework/src/features/workspace-tabs/WorkspaceTabsContext.tsxwework/src/features/workspace-tabs/workspaceTabs.test.tswework/src/features/workspace-tabs/workspaceTabs.tswework/src/features/workspace-tabs/workspaceWindow.test.tswework/src/features/workspace-tabs/workspaceWindow.tswework/src/i18n/locales/en/common.jsonwework/src/i18n/locales/zh-CN/common.jsonwework/src/styles/globals.css
🚧 Files skipped from review as they are similar to previous changes (12)
- wework/src/App.apps.test.tsx
- wework/src-tauri/src/desktop_capture.rs
- wework/src/i18n/locales/zh-CN/common.json
- wework/e2e/desktop/task-flow.e2e.mjs
- wework/src/features/workspace-tabs/workspaceWindow.ts
- wework/src/styles/globals.css
- wework/src/App.tsx
- wework/src/features/workspace-tabs/workspaceTabs.test.ts
- wework/src/i18n/locales/en/common.json
- wework/src/features/todo/CloudTodoWorkspace.tsx
- wework/src/features/workspace-tabs/WorkspaceTabsContext.tsx
- wework/src/features/workspace-tabs/WorkspaceTabStrip.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/src/main.tsx`:
- Line 50: Add a regression test covering a cold start where a persisted
local-model request is selected from the workbench before
LocalModelSettingsSection mounts, and verify native API keys are hydrated before
the request begins. Alternatively, update the request initialization path
associated with installWeworkAutomationBridge so it invokes
ensureLocalModelApiKeysHydrated() before starting local-model requests.
🪄 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: 48487c55-c8e1-47b5-9a67-2d1e30f70f64
📒 Files selected for processing (23)
docs/en/wework/workbench.mddocs/zh/wework/workbench.mdwework/e2e/desktop/task-flow.e2e.mjswework/src-tauri/src/lib.rswework/src/App.apps.test.tsxwework/src/App.tsxwework/src/components/layout/DesktopWorkbenchLayout.test.tsxwework/src/components/layout/DesktopWorkbenchMain.tsxwework/src/components/settings/ModelSettingsPage.tsxwework/src/components/topnav/ChromeTitlebar.test.tsxwework/src/components/topnav/ChromeTitlebar.tsxwework/src/components/topnav/TitlebarActionsPortal.tsxwework/src/e2e/automation.tswework/src/features/model-settings/localModelSettings.secure.test.tswework/src/features/model-settings/localModelSettings.tswework/src/features/workspace-tabs/WorkspaceTabStrip.test.tsxwework/src/features/workspace-tabs/WorkspaceTabStrip.tsxwework/src/features/workspace-tabs/WorkspaceTabsContext.test.tsxwework/src/features/workspace-tabs/WorkspaceTabsContext.tsxwework/src/features/workspace-tabs/workspaceWindow.test.tswework/src/features/workspace-tabs/workspaceWindow.tswework/src/main.tsxwework/src/styles/globals.css
🚧 Files skipped from review as they are similar to previous changes (12)
- wework/src-tauri/src/lib.rs
- wework/src/features/workspace-tabs/WorkspaceTabStrip.test.tsx
- wework/src/styles/globals.css
- wework/src/features/workspace-tabs/workspaceWindow.test.ts
- wework/src/features/workspace-tabs/WorkspaceTabStrip.tsx
- wework/src/features/workspace-tabs/workspaceWindow.ts
- wework/src/App.apps.test.tsx
- wework/e2e/desktop/task-flow.e2e.mjs
- wework/src/e2e/automation.ts
- wework/src/features/workspace-tabs/WorkspaceTabsContext.tsx
- wework/src/App.tsx
- wework/src/components/topnav/ChromeTitlebar.test.tsx
| console.error('Failed to restore local model credentials', error) | ||
| }) | ||
| void installWeworkAutomationBridge(localModelApiKeyHydration) | ||
| void installWeworkAutomationBridge() |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Credential hydration and local-model consumers"
rg -n -C 6 \
'ensureLocalModelApiKeysHydrated|hydrateLocalModelApiKeys|localModelApiKeys|apiKeyConfigured|listLocalModelConfigs' \
wework/src --glob '*.{ts,tsx}'
echo "Settings routes and workbench entry points"
rg -n -i -C 8 \
'ModelSettingsPage|LocalModelSettingsSection|local model|localmodel' \
wework/src --glob '*.{ts,tsx}'Repository: wecode-ai/Wegent
Length of output: 50373
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "wework/src/main.tsx relevant startup"
sed -n '1,90p' wework/src/main.tsx
echo "localModelSettings hydration exports"
rg -n -C 5 \
'(ensureLocalModelApiKeysHydrated|hydrateLocalModelApiKeys|localModelApiKeys|LocalModelApiKeysContext|setApiKeys|getApiKeys|useLocalModelApiKeys|LOCAL_MODEL_API_KEYS_CHANGED_EVENT)' \
wework/src/features/model-settings wework/src --glob '*.{ts,tsx}' | head -n 240
echo "localModelProviders calls with apiKey and model selection"
rg -n -C 7 \
'discoverProviderModels|findLocalModelProviderProfile|LocalModelConfig|providerProfileId|baseUrl|apiKeyConfigured|apiKey' \
wework/src/features/model-settings/localModelProviders.ts \
wework/src/features/workbench/runtimeModelSelection.ts \
wework/src/components/settings/ModelSettingsPage.tsx | head -n 360Repository: wecode-ai/Wegent
Length of output: 50372
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "ModelSettingsPage hydration and change handling"
sed -n '680,750p' wework/src/components/settings/ModelSettingsPage.tsx
sed -n '1620,1700p' wework/src/components/settings/ModelSettingsPage.tsx
sed -n '2065,2125p' wework/src/components/settings/ModelSettingsPage.tsx
echo "workbench model loading and request construction"
sed -n '1,180p' wework/src/features/workbench/useWorkbenchModels.ts
sed -n '1,170p' wework/src/features/workbench/runtimeModelSelection.ts
echo "workbench API consumers with model and execution"
rg -n -C 6 \
'listModels|selectedModel|execute|send|chat|messages|createCompletion|createChatCompletion|create.*Responses|provider === .local|runtime: {.*provider.*local|modelId' \
wework/src/features/workbench wework/src/components/workbench --glob '*.{ts,tsx}' | head -n 320
echo "local model request helpers focused"
rg -n -C 4 \
'buildLocalModelRequestUrl|defaultLocalModelRequestPath|getLocalModelApiKey|readLocalModelConfig|updateLocalModelConfig|deleteLocalModelConfig' \
wework/src/features/model-settings/localModelSettings.ts
echo "exported local-model helper list"
sed -n '160,240p' wework/src/features/model-settings/localModelSettings.ts
sed -n '730,770p' wework/src/features/model-settings/localModelSettings.ts
sed -n '790,870p' wework/src/features/model-settings/localModelSettings.tsRepository: wecode-ai/Wegent
Length of output: 21463
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "workbench execution/request model consumers"
rg -n -C 5 \
'selectedModel|selectedModelOptions|selectedModelExecutionFields|listModels|execute|send|chat|messages|createCompletion|createChatCompletion|create.*Responses|modelId|modelType|provider.*local|RuntimeSendRequest' \
wework/src/features/workbench wework/src/components/workbench --glob '*.{ts,tsx}' | head -n 420
echo "model API definitions and workbench API wiring"
fd -a 'workbench.*\.(ts|tsx)|models|Model' wework/src | sed 's#^\./##' | head -n 80
rg -n -C 5 \
'listModels|UnifiedModel|UnifiedModelListResponse|runtime.*local|provider.*local|modelId|modelType' \
wework/src/api wework/src/features wework/src/components --glob '*.{ts,tsx}' | head -n 500
echo "local model helper exports"
sed -n '145,155p' wework/src/features/model-settings/localModelSettings.ts
sed -n '210,225p' wework/src/features/model-settings/localModelSettings.ts
sed -n '760,810p' wework/src/features/model-settings/localModelSettings.ts
sed -n '830,885p' wework/src/features/model-settings/localModelSettings.ts
echo "model settings hydration event imports"
rg -n \
'LOCAL_MODEL_SETTINGS_CHANGED_EVENT|LOCAL_MODEL_API_KEYS_CHANGED_EVENT|ensureLocalModelApiKeysHydrated' \
wework/src --glob '*.{ts,tsx}'Repository: wecode-ai/Wegent
Length of output: 38257
Add a cold-start test for local-model hydration.
ensureLocalModelApiKeysHydrated() is only called after LocalModelSettingsSection mounts, so a persisted local-model request can start before the native API keys are loaded. Add a regression test that selects a persisted local model from the workbench without opening Model Settings, or hydrate credentials from the request initialization 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 `@wework/src/main.tsx` at line 50, Add a regression test covering a cold start
where a persisted local-model request is selected from the workbench before
LocalModelSettingsSection mounts, and verify native API keys are hydrated before
the request begins. Alternatively, update the request initialization path
associated with installWeworkAutomationBridge so it invokes
ensureLocalModelApiKeysHydrated() before starting local-model requests.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
wework/src/components/layout/DesktopEmptyTaskLauncher.tsx (1)
163-204: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRestore 44px mobile touch targets.
On mobile, the back button is 32px high. The category and suggestion buttons are 36px high. These controls must be at least 44px × 44px.
wework/src/components/layout/DesktopEmptyTaskLauncher.tsx#L163-L204: usemin-h-11andmin-w-11for mobile controls. Apply smaller dimensions only atlgor above if required.wework/src/components/layout/DesktopEmptyTaskLauncher.test.tsx#L68-L71: update the assertion to enforce the mobile touch-target classes.As per coding guidelines, “Mobile controls must be at least 44px × 44px.”
🤖 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 `@wework/src/components/layout/DesktopEmptyTaskLauncher.tsx` around lines 163 - 204, Restore 44px mobile touch targets in DesktopEmptyTaskLauncher.tsx by applying min-h-11 and min-w-11 to the back, category, and suggestion buttons, with any smaller sizing restricted to lg and above. Update DesktopEmptyTaskLauncher.test.tsx lines 68-71 to assert the required mobile touch-target classes.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.
Outside diff comments:
In `@wework/src/components/layout/DesktopEmptyTaskLauncher.tsx`:
- Around line 163-204: Restore 44px mobile touch targets in
DesktopEmptyTaskLauncher.tsx by applying min-h-11 and min-w-11 to the back,
category, and suggestion buttons, with any smaller sizing restricted to lg and
above. Update DesktopEmptyTaskLauncher.test.tsx lines 68-71 to assert the
required mobile touch-target classes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 00f9f51f-d9a9-4d68-91fe-4514329c086a
📒 Files selected for processing (9)
docs/en/wework/workbench.mddocs/zh/wework/workbench.mdwework/src/components/chat/ChatInput.test.tsxwework/src/components/chat/ChatInput.tsxwework/src/components/chat/composer/ProjectChatComposer.tsxwework/src/components/layout/DesktopEmptyTaskLauncher.module.csswework/src/components/layout/DesktopEmptyTaskLauncher.test.tsxwework/src/components/layout/DesktopEmptyTaskLauncher.tsxwework/src/components/layout/DesktopWorkbenchMain.tsx
💤 Files with no reviewable changes (1)
- wework/src/components/layout/DesktopEmptyTaskLauncher.module.css
🚧 Files skipped from review as they are similar to previous changes (3)
- wework/src/components/layout/DesktopWorkbenchMain.tsx
- docs/zh/wework/workbench.md
- docs/en/wework/workbench.md
…ument-tabs # Conflicts: # wework/src/App.tsx
What changed
Multi-tab semantics
Validation
pnpm --filter wework test— 259 files / 2554 tests passedpnpm --filter wework typecheck— passedpnpm --filter wework lint— passed.github/scripts/test-classify-ci-changes.sh— passednode wework/e2e/desktop/run-checkpoints.mjs --segment workspace-tabs— passed in a production-built isolated Tauri apporigin/mainbefore publicationDesktop E2E coverage
The
workspace-tabscheckpoint verifies:Existing E2E scenarios keep their original semantics; the new checkpoint is additive and is included in the CI-covered Wework desktop suite.