Kaynağa Gözat

fix(ui): 任务分发模块桌面端渲染分支缺失——M2 只接了手机远控链

根因(CDP 实证):WorkspaceShellLayout 有两条主视图渲染链——
手机远控走 WebRemoteControlMobileShell 的 chatContent 槽(M2 接线处),
桌面端走 ResizablePanelGroup 内的独立 switch(原 automations/plugin-store
分支处)。M2 把 task-dispatch 分支只加在了前者,桌面端点击侧栏入口后
状态切换(aria-pressed=true)但主区回落聊天页,表现为"页面没有文字"。

修复:在桌面链 automations 与 plugin-store 之间补同构 task-dispatch 分支
(AutomationsMainBreadcrumbFrame + ScopedErrorBoundary + max-w-5xl 列)。

验证:
- 活窗口 CDP 复验:点击入口后主区渲染完整(任务分发/分析项目/目标项目
  选择器/空状态提示/分析记录侧区),vite HMR 即时生效
- vitest 定向 15 用例全过(源码契约计数同步 5→6:BreadcrumbFrame 与
  scrollbar-gutter 槽位在两条渲染链各一份)
- pnpm typecheck / lint 63 警告 0 错误(基线一致)
wubinggen 1 ay önce
ebeveyn
işleme
75d99614bb

+ 26 - 0
packages/ui/src/app-shell/WorkspaceShellLayout.tsx

@@ -2755,6 +2755,32 @@ export const WorkspaceShellLayout = memo(
                         </div>
                         </div>
                       </AutomationsMainBreadcrumbFrame>
                       </AutomationsMainBreadcrumbFrame>
                     </main>
                     </main>
+                  ) : workspaceMainView === "task-dispatch" &&
+                    !isWebRemoteControlShell ? (
+                    <main className="flex h-full min-h-0 flex-1 flex-col bg-background">
+                      <AutomationsMainBreadcrumbFrame
+                        isDesktop={Boolean(isDesktop)}
+                        sectionLabel={intl.formatMessage({
+                          id: "taskDispatch.module.title",
+                        })}
+                        ariaLabel={intl.formatMessage({
+                          id: "taskDispatch.module.title",
+                        })}
+                      >
+                        <div className="min-h-0 flex-1 overflow-y-auto [scrollbar-gutter:stable]">
+                          <ScopedErrorBoundary
+                            scope="task-dispatch-main"
+                            resetKeys={workspaceOnlyResetKeys}
+                            variant="panel"
+                            className="min-h-full"
+                          >
+                            <div className="mx-auto flex h-full min-h-0 w-full max-w-5xl flex-col px-4 py-4 md:px-6 md:py-6">
+                              <TaskDispatchModule />
+                            </div>
+                          </ScopedErrorBoundary>
+                        </div>
+                      </AutomationsMainBreadcrumbFrame>
+                    </main>
                   ) : workspaceMainView === "plugin-store" &&
                   ) : workspaceMainView === "plugin-store" &&
                     !isWebRemoteControlShell ? (
                     !isWebRemoteControlShell ? (
                     <main className="flex h-full min-h-0 flex-1 flex-col bg-background">
                     <main className="flex h-full min-h-0 flex-1 flex-col bg-background">

+ 4 - 4
packages/ui/test/automationsMainDragRegion.test.ts

@@ -29,7 +29,7 @@ describe("workspace main view drag region", () => {
 
 
     expect(
     expect(
       layoutSource.match(/<AutomationsMainBreadcrumbFrame/gu)?.length,
       layoutSource.match(/<AutomationsMainBreadcrumbFrame/gu)?.length,
-    ).toBe(5);
+    ).toBe(6);
     expect(
     expect(
       frameSource.match(/data-testid="automations-main-drag-region"/gu)?.length,
       frameSource.match(/data-testid="automations-main-drag-region"/gu)?.length,
     ).toBe(1);
     ).toBe(1);
@@ -45,8 +45,8 @@ describe("workspace main view drag region", () => {
         /min-h-0 flex-1 overflow-y-auto \[scrollbar-gutter:stable\]/gu,
         /min-h-0 flex-1 overflow-y-auto \[scrollbar-gutter:stable\]/gu,
       )?.length ?? 0;
       )?.length ?? 0;
 
 
-    // automations / plugins / task-dispatch 三处主视图外壳 + Web 远控 = 4 处源内
-    // + task-dispatch 分支 = 5;新增同构主视图时同步维护。
-    expect(stableScrollerCount).toBe(5);
+    // automations / plugins / task-dispatch 主视图外壳在手机远控(chatContent 槽)与
+    // 桌面(ResizablePanel 链)两条渲染链各一份 = 6;新增同构主视图时同步维护。
+    expect(stableScrollerCount).toBe(6);
   });
   });
 });
 });