Skip to content

wework新增应用tab - #1388

Merged
qdaxb merged 8 commits into
wecode-ai:mainfrom
Micro66:human/executor-build-0612
Jun 15, 2026
Merged

qdaxb merged 8 commits into
wecode-ai:mainfrom
Micro66:human/executor-build-0612

Conversation

@Micro66

@Micro66 Micro66 commented Jun 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added an App Center dashboard with device status, runtime/proxy overview, executor metrics, and recommended apps.
    • Introduced an /apps page and corresponding apps navigation tab.
  • Improvements

    • Updated the apps titlebar icon and improved the scroll-collapsing header behavior on the apps view.
    • Refined spacing and container height/overflow behavior across the workbench, plugins, and chat layouts.
  • Tests

    • Expanded automated coverage for /apps routing and header/tab behavior.
  • Documentation

    • Clarified the project’s multi-module architecture.
  • Chores

    • Improved local build/start tooling.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a native /apps route and full AppsPage dashboard to the Wework desktop app. The AppTab config gains routing fields; useChromeTabs is updated to resolve active keys and navigate by path for native tabs. ChromeTitlebar gains a Grid3X3 icon for the apps tab. Global overflow and page height CSS classes are adjusted. executor/local.sh gains an optional version argument for builds. Dev server startup and package configuration are updated.

Changes

Apps Tab Feature

Layer / File(s) Summary
AppTab config: path fields and apps tab entry
wework/src/config/apps.ts
AppTab interface gains optional path, url, requiresAuth, and hidden fields; APP_TABS adds the apps tab with path: '/apps' and attaches path: '/' to the existing wework tab.
useChromeTabs: native-tab routing, active-key detection, and titlebar icon
wework/src/components/topnav/useChromeTabs.ts, wework/src/components/topnav/useChromeTabs.test.ts, wework/src/components/topnav/ChromeTitlebar.tsx
activeAppKey now matches native tabs by their path property; isNativeApp derives from activeTab.mode; navigateToApp routes native tabs to tab.path instead of /app/:key. ChromeTitlebar imports Grid3X3 and renders it when tab.key === 'apps'. Tests are extended for /apps route and updated for /app/wegent to include both tabs.
AppsPage: sub-components, data fetching, and dashboard render
wework/src/pages/AppsPage.tsx
Adds utility helpers, presentational sub-components (StatusPill, MetricRow, HeroSection, ExecutorStatusCard, AppCard, SummaryCard, ActivityRow, QuickAction, buildRecommendedApps), and the main AppsPage with concurrent data fetching for devices/codex/proxy configs, cancellation guarding, derived metrics, and full dashboard layout.
App.tsx: /apps route wiring
wework/src/App.tsx
AppRoutes imports and renders AppsPage for path === '/apps'.
App.apps.test: route navigation, header collapse, and UI assertions
wework/src/App.apps.test.tsx
Integration test mocks auth/workbench, stubs fetch for devices/codex/proxy, tests navigation to /apps via chrome tab, and tests header collapse behavior on scroll. Asserts correct headings and verifies absent sections.
Global overflow, height, and padding adjustments with test updates
wework/src/styles/globals.css, wework/src/pages/PluginsPage.tsx, wework/src/pages/PluginManagementPage.tsx, wework/src/components/chat/MessageList.tsx, wework/src/components/layout/DesktopWorkbenchMain.tsx, wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
globals.css switches overflow-x: hidden to overflow: hidden on html, body, #root``; PluginsPage and `PluginManagementPage` switch from `h-dvh`/`lg:h-screen` to `h-full`; `MessageList` reduces vertical padding from `py-8` to `py-2`; `DesktopWorkbenchMain` reduces scroll area bottom padding values. Related test assertions are updated to match the new padding expectations.

Executor Build Version and Dev Server Config

Layer / File(s) Summary
executor/local.sh: optional version arg in usage, build_executor, and CLI
executor/local.sh
usage() documents ./local.sh [command] [version] with examples; build_executor conditionally passes --version to build_local.py; CLI dispatcher reads version from $2 and forwards it.
start.sh and package.json: WeWork dev server startup
start.sh, wework/package.json
start.sh kills existing processes on WEWORK_PORT before starting and launches pnpm exec vite with explicit --host 0.0.0.0 and --port flags; package.json dev script removes the hardcoded --port 1420 argument.

AGENTS.md Module Docs

Layer / File(s) Summary
AGENTS.md: separate Wework module entry
AGENTS.md
Replaces single Frontend bullet with distinct frontend/ and wework/ bullets in the multi-module architecture section.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ChromeTitlebar
  participant useChromeTabs
  participant AppRoutes
  participant AppsPage
  participant deviceApi
  participant userApi

  User->>ChromeTitlebar: clicks apps tab
  ChromeTitlebar->>useChromeTabs: navigateToApp('apps')
  useChromeTabs->>useChromeTabs: find tab by key, tab.mode === 'native'
  useChromeTabs->>AppRoutes: navigate to tab.path ('/apps')
  AppRoutes->>AppsPage: render path === '/apps'
  AppsPage->>deviceApi: getAllDevices()
  AppsPage->>userApi: getRuntimeConfig('codex')
  AppsPage->>userApi: getProxyConfig()
  deviceApi-->>AppsPage: DeviceInfo[]
  userApi-->>AppsPage: codexConfig, proxyConfig
  AppsPage->>AppsPage: derive metrics, buildRecommendedApps
  AppsPage-->>User: render dashboard with HeroSection, ExecutorStatusCard, AppCard[], QuickAction[]
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • wecode-ai/Wegent#1380: Directly modifies the same chrome tabs infrastructure — useChromeTabs.ts, config/apps.ts, App.tsx, and ChromeTitlebar.tsx — that this PR extends with the /apps tab.
  • wecode-ai/Wegent#1260: Touches DesktopWorkbenchMain.tsx scroll-area padding behavior and DesktopWorkbenchLayout.test.tsx assertions, directly related to this PR's bottom padding adjustments.
  • wecode-ai/Wegent#1328: Modifies MessageList.tsx Tailwind layout classes, overlapping with this PR's py-8 → py-2 padding change in the same file.

Suggested reviewers

  • qdaxb

🐇 A new apps tab appears with a grid of squares so neat,
Three APIs fetched in concert — devices, codex, proxy complete!
The chrome titlebar gains a Grid3X3 icon so bright,
Native paths now route by tab.path, all wired up right.
The rabbit hops to /apps and declares the dashboard sweet! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.03% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding a new 'apps' application tab to the wework interface, which is the main purpose of this PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
wework/src/pages/AppsPage.tsx (1)

338-499: 🏗️ Heavy lift

Split AppsPage into smaller units to keep page orchestration maintainable.

AppsPage currently carries data loading, derivation, and large render composition in one function well above the preferred function-length threshold. Extracting a data hook (useAppsPageData) plus section components will reduce coupling and future change risk.

As per coding guidelines, **/*.{ts,tsx,py} functions should stay within 50 lines (preferred). Based on learnings, “Manage complexity through extraction” and “High cohesion, low coupling” should guide this page structure.

🤖 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/pages/AppsPage.tsx` around lines 338 - 499, The AppsPage function
exceeds the preferred 50-line threshold and mixes data loading, derivation, and
large render composition. Extract the entire useEffect block (that calls
deviceApi.getAllDevices, userApi.getRuntimeConfig, and userApi.getProxyConfig,
along with the state updates and cancellation logic) into a custom hook named
useAppsPageData that returns the state object. Then extract each major section
of the render output (the header with search, the recommended apps section, the
run overview section with SummaryCard items, the quick actions section with
QuickAction items, and the recent activity section with ActivityRow items) into
separate presentational components. Update the main AppsPage function to use the
useAppsPageData hook and compose these extracted section components, reducing
the function body to primarily orchestration logic.

Sources: Coding guidelines, Learnings

🤖 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/App.apps.test.tsx`:
- Around line 45-96: The test file App.apps.test.tsx is mocking the global fetch
function with synthetic payloads for API endpoints like /devices,
/users/me/runtime-configs/codex, and /users/me/proxy-config. Remove the entire
vi.stubGlobal('fetch', vi.fn(...)) block that creates these artificial
responses. Instead, configure the test to make real HTTP requests to the actual
backend API endpoints, ensuring the test validates genuine integration behavior
rather than relying on mocked responses. This aligns with the frontend E2E
coverage guidelines that require real HTTP communication with backend APIs.

In `@wework/src/pages/AppsPage.tsx`:
- Line 339: Replace the 'common' namespace in the useTranslation call at line
339 with a feature-owned namespace appropriate for the AppsPage (such as
'apps'). Then locate the translation call with a fallback literal at line 414
and remove the fallback string, keeping only the translation key to rely on
keyed translations without any fallback literals. Ensure all new translation
strings follow this pattern of using the feature namespace with keyed-only
access.
- Line 215: The primary action button styling in AppsPage.tsx is using the wrong
color tokens for the design system. Locate the button element with className
containing bg-text-primary and text-background (around line 215), and update the
className to replace bg-text-primary with bg-primary and text-background with
text-white to align with the primary button design token guidelines.

---

Nitpick comments:
In `@wework/src/pages/AppsPage.tsx`:
- Around line 338-499: The AppsPage function exceeds the preferred 50-line
threshold and mixes data loading, derivation, and large render composition.
Extract the entire useEffect block (that calls deviceApi.getAllDevices,
userApi.getRuntimeConfig, and userApi.getProxyConfig, along with the state
updates and cancellation logic) into a custom hook named useAppsPageData that
returns the state object. Then extract each major section of the render output
(the header with search, the recommended apps section, the run overview section
with SummaryCard items, the quick actions section with QuickAction items, and
the recent activity section with ActivityRow items) into separate presentational
components. Update the main AppsPage function to use the useAppsPageData hook
and compose these extracted section components, reducing the function body to
primarily orchestration logic.
🪄 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

Run ID: 57370c8d-de97-4d80-813d-28bcaaafc70d

📥 Commits

Reviewing files that changed from the base of the PR and between 7688576 and 9c0d5ac.

📒 Files selected for processing (14)
  • AGENTS.md
  • executor/local.sh
  • wework/src/App.apps.test.tsx
  • wework/src/App.tsx
  • wework/src/components/chat/MessageList.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/topnav/ChromeTitlebar.tsx
  • wework/src/components/topnav/useChromeTabs.test.ts
  • wework/src/components/topnav/useChromeTabs.ts
  • wework/src/config/apps.ts
  • wework/src/pages/AppsPage.tsx
  • wework/src/pages/PluginManagementPage.tsx
  • wework/src/pages/PluginsPage.tsx
  • wework/src/styles/globals.css

Comment thread wework/src/App.apps.test.tsx
Comment thread wework/src/pages/AppsPage.tsx
Comment thread wework/src/pages/AppsPage.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@start.sh`:
- Around line 2380-2385: The current implementation force-kills all processes
listening on WEWORK_PORT using get_port_listener_pids and kill -9, which is
overly broad and can terminate unrelated processes. Modify the logic to first
attempt to kill only the tracked wework.pid process (and optionally its process
group) using a gentler signal, then only escalate to kill -9 if that tracked
process fails to exit cleanly. This ensures only the intended wework process is
terminated rather than any process that happens to be listening on that port.
🪄 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

Run ID: 70dbb40b-3b17-442b-9f17-2a14aa7fd621

📥 Commits

Reviewing files that changed from the base of the PR and between 9c0d5ac and cab2924.

📒 Files selected for processing (4)
  • start.sh
  • wework/package.json
  • wework/src/App.apps.test.tsx
  • wework/src/pages/AppsPage.tsx
✅ Files skipped from review due to trivial changes (1)
  • wework/package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • wework/src/App.apps.test.tsx
  • wework/src/pages/AppsPage.tsx

Comment thread start.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
wework/src/components/layout/DesktopWorkbenchLayout.test.tsx (1)

55-2884: 🏗️ Heavy lift

Split this oversized test suite into sub-modules to meet the file-size rule.

This file is 2884 lines and exceeds the 1000-line limit, which is making the suite hard to evolve safely. Please split by feature areas (e.g., sidebar/search/settings/workspace panels) into focused test files.

As per coding guidelines, “File size limit: if a file exceeds 1000 lines, split it into multiple sub-modules”.

🤖 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/DesktopWorkbenchLayout.test.tsx` around lines 55
- 2884, Split the DesktopWorkbenchLayout.test.tsx file (currently 2884 lines)
into multiple focused test files organized by feature areas to meet the
1000-line file-size limit. Create separate test files for: (1) sidebar
functionality (collapse/expand, width management, section toggling), (2) search
and task discovery, (3) settings menu and account management, (4) project
creation and management, (5) device status and availability, (6) offline
conversations and device locking, (7) environment info and git branch
operations, and (8) workspace panels (right and bottom). Move the shared setup
code (beforeEach, baseProps, helper functions like
createCloudWorkspacePanelState) to a separate test utilities file that all test
modules can import, and ensure each new test file focuses on a cohesive set of
related functionality while maintaining proper test isolation.

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.

Nitpick comments:
In `@wework/src/components/layout/DesktopWorkbenchLayout.test.tsx`:
- Around line 55-2884: Split the DesktopWorkbenchLayout.test.tsx file (currently
2884 lines) into multiple focused test files organized by feature areas to meet
the 1000-line file-size limit. Create separate test files for: (1) sidebar
functionality (collapse/expand, width management, section toggling), (2) search
and task discovery, (3) settings menu and account management, (4) project
creation and management, (5) device status and availability, (6) offline
conversations and device locking, (7) environment info and git branch
operations, and (8) workspace panels (right and bottom). Move the shared setup
code (beforeEach, baseProps, helper functions like
createCloudWorkspacePanelState) to a separate test utilities file that all test
modules can import, and ensure each new test file focuses on a cohesive set of
related functionality while maintaining proper test isolation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2b9bebbd-032d-40dd-961a-0080f7a154a5

📥 Commits

Reviewing files that changed from the base of the PR and between cab2924 and a1e9f08.

📒 Files selected for processing (1)
  • wework/src/components/layout/DesktopWorkbenchLayout.test.tsx

@qdaxb
qdaxb merged commit 8512730 into wecode-ai:main Jun 15, 2026
24 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants