Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/wework/workbench.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The first main window starts with three default tabs: Task, Project spaces, and

When many tabs are open, the tab list scrolls horizontally while the **+** and the rightmost feedback button remain visible. A tab can also be moved to a separate window from its context menu. After the move succeeds, the source window removes the tab and the destination window contains only the moved tab and its state; it does not create the three default tabs again. If destination-window creation fails, the source tab remains unchanged.

The Task page and auxiliary product pages such as Plugins and Cloud Work share the same desktop content surface. Switching pages within a tab therefore keeps the left sidebar's inset, corner treatment, and border stable instead of shifting with the page type.
The Task page and auxiliary product pages such as Plugins and Cloud Work share the same full-bleed desktop content container below the title bar. Switching pages within a tab therefore keeps the left sidebar's position and chrome stable instead of shifting with the page type. Pages may still render their own internal chrome inside this container.

## Move between project-space tasks and runtime tasks

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/wework/workbench.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Wework 桌面版使用顶部标签页承载任务、项目空间、智能体和

标签页较多时,标签列表会水平滚动,顶部 **+** 和最右侧的反馈按钮始终保持可见。标签页也可以通过右键菜单移动到独立窗口。移动成功后,原窗口会移除该标签页;新窗口只包含被移动的标签页及其状态,不会再次创建三个默认标签页。创建新窗口失败时,原窗口中的标签页保持不变。

任务页与插件、云端工作等功能页面共用同一桌面内容容器。因此在同一标签页内切换页面时,左侧栏的边距、圆角和边框保持一致,不会因页面类型不同而发生位置跳动。
任务页与插件、云端工作等功能页面共用标题栏下方的全宽桌面内容容器。因此在同一标签页内切换页面时,左侧栏的位置与外观保持一致,不会因页面类型不同而发生位置跳动。页面仍可在该容器内绘制各自的内部外观

## 在项目空间和运行任务之间往返

Expand Down
19 changes: 9 additions & 10 deletions wework/src/App.apps.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,10 @@ describe('App center route', () => {
await waitFor(() => expect(window.location.pathname).toBe('/apps'))
expect(screen.getByTestId('workspace-tab-strip')).toHaveTextContent('应用')
expect(screen.getByRole('tab', { name: /应用/ })).toHaveAttribute('aria-selected', 'true')
expect(screen.getByTestId('desktop-auxiliary-surface')).toHaveClass(
'app-view-surface',
'rounded-xl',
'border'
)
expect(screen.getByTestId('desktop-auxiliary-surface')).toHaveClass('h-full')
expect(screen.getByTestId('desktop-auxiliary-surface')).not.toHaveClass('app-view-surface')
expect(screen.getByTestId('desktop-auxiliary-surface')).not.toHaveClass('rounded-xl')
expect(screen.getByTestId('desktop-auxiliary-surface')).not.toHaveClass('border')
expect(screen.getByTestId('workspace-tab-add')).toBeInTheDocument()
expect(screen.getByTestId('apps-page')).toBeInTheDocument()
expect(screen.getByRole('heading', { name: '管理你的办公与编码应用' })).toBeInTheDocument()
Expand Down Expand Up @@ -285,6 +284,7 @@ describe('App center route', () => {
'data-src',
'https://app.example.com/login/oidc?access_token=cloud-token&token_type=bearer&login_success=true'
)
expect(screen.getByTestId('app-iframe-wegent')).toHaveClass('app-view-surface')
})

test('renders the global Chrome titlebar on the workbench route', async () => {
Expand All @@ -295,11 +295,10 @@ describe('App center route', () => {
await waitForStartupScreenToClose()
expect(screen.getByTestId('chrome-titlebar')).toBeInTheDocument()
expect(screen.getByTestId('workbench-page')).toBeInTheDocument()
expect(screen.getByTestId('desktop-workbench-surface')).toHaveClass(
'app-view-surface',
'rounded-xl',
'border'
)
expect(screen.getByTestId('desktop-workbench-surface')).toHaveClass('h-full')
expect(screen.getByTestId('desktop-workbench-surface')).not.toHaveClass('app-view-surface')
expect(screen.getByTestId('desktop-workbench-surface')).not.toHaveClass('rounded-xl')
expect(screen.getByTestId('desktop-workbench-surface')).not.toHaveClass('border')
})

test('keeps duplicate task tabs as independent persistent workbench instances', async () => {
Expand Down
19 changes: 2 additions & 17 deletions wework/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,6 @@ function WorkspaceTabSurface({
const renderedIframe = iframe ?? surfaceHistory.iframe
const renderProvider = surfaceHistory.hasMountedProvider || !iframe
const renderWorkbench = surfaceHistory.hasMountedWorkbench || nativeWorkbenchActive
const usesAuxiliaryDesktopSurface = auxiliaryActive && isTauriRuntime()
const usesWorkbenchDesktopSurface = nativeWorkbenchActive && isTauriRuntime()

return (
<WorkspaceTabPortalOwner ownerId={tab.id}>
<Activity mode={active ? 'visible' : 'hidden'}>
Expand All @@ -277,26 +274,14 @@ function WorkspaceTabSurface({
{renderWorkbench ? (
<div
data-testid="desktop-workbench-surface"
className={cn(
'h-full',
usesWorkbenchDesktopSurface &&
'app-view-surface overflow-hidden rounded-xl border border-border/60 bg-background shadow-[0_3px_16px_rgba(0,0,0,0.04)]',
!nativeWorkbenchActive && 'hidden'
)}
className={cn('h-full', !nativeWorkbenchActive && 'hidden')}
aria-hidden={!nativeWorkbenchActive}
>
<WorkbenchPage routeActive={active && nativeWorkbenchActive} />
</div>
) : null}
{auxiliaryPage ? (
<div
data-testid="desktop-auxiliary-surface"
className={cn(
'h-full',
usesAuxiliaryDesktopSurface &&
'app-view-surface overflow-hidden rounded-xl border border-border/60 bg-background shadow-[0_3px_16px_rgba(0,0,0,0.04)]'
)}
>
<div data-testid="desktop-auxiliary-surface" className="h-full">
{auxiliaryPage}
</div>
) : null}
Expand Down
Loading