From c59e73754b121093d7ff9bde80ce1f116cf7ff5d Mon Sep 17 00:00:00 2001 From: 18628386721 <18628386721@163.com> Date: Tue, 28 Jul 2026 10:25:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E7=A9=BA=E5=8D=A0?= =?UTF-8?q?=E4=BD=8D=E8=A1=A5=E9=BD=90=20=E2=80=94=E2=80=94=20=E6=9C=89?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=B8=B2=E6=9F=93=E5=86=85=E5=AE=B9,?= =?UTF-8?q?=E6=B2=A1=E5=86=85=E5=AE=B9=E6=89=8D=E8=90=BD=E7=A9=BA=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 任务面原来缺两处占位:中栏是一行裸文字,对话区在没选中任务时**整栏不渲染**。 补齐后三栏恒在:中栏落设计空态「手上没有任务」,对话区给全壳(题头 + 空态 + 禁用输入条),空着也看得出这是干什么的地方。 但真起一单之后暴露了更重的问题:占位在**说谎**。待处理角标写着 1,正文却 说「手上没有待办」—— 因为 ChatStream(643 行)与 WorkOrderReport(449 行) 早就写好、也从 @features/desk-task 导出了,却没有一处在用。占位不是缺内容, 是内容没接上。三处接回真渲染: 待处理 → WorkOrderReport(工单正文、编号、派发时间、数据与分析) 工作日志 → .jc-log 行,按归侧四类各一色(机器/人类/裁决/等世界) 工作成果 → .jc-file 行,点开进 FileViewer;打开时右槽换「返回」 对话区 → ChatStream,三个回传(说一句 / 答卡 / 答工单)在这里收口 顺带治了窄对话区的抗压:工作区优先保「五按钮 + 翻页」,对话区在 1280 下被 压到 212px,卡头标题 `flex:1` 没设 `min-width:0`,一挤就逐字折断成竖排单字。 降级顺序改成「状态芯片换行下沉、标题始终整词可读」—— 截断能让布局不崩, 但读的人不知道这是什么卡。不改任何一栏尺寸。 五闸:tsc ✓ eslint ✓ depcruise 373 模块 ✓ api:check 公开契约无变化 ✓ 481 测试 ✓ 走查后清了运行数据(仓库自带 reset-runs,配置原样留着),换业务化主题重起一单。 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m --- apps/web/src/app/app-shell.tsx | 94 ++++++++++++--- apps/web/src/app/styles/app.css | 28 +++++ .../features/desk-task/internal/TaskChat.tsx | 114 +++++++++++++----- .../desk-task/internal/ViewRegion.tsx | 69 +++++++++-- 4 files changed, 243 insertions(+), 62 deletions(-) diff --git a/apps/web/src/app/app-shell.tsx b/apps/web/src/app/app-shell.tsx index af1a7ad..efd9743 100644 --- a/apps/web/src/app/app-shell.tsx +++ b/apps/web/src/app/app-shell.tsx @@ -8,12 +8,13 @@ */ import { useState } from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import type { Session, TaskCard, TaskDetail } from '@contracts'; +import type { Session, TaskCard, TaskDetail, WorkOrderReply } from '@contracts'; import { listApprovalsForMeRoute, listMessagesRoute, listTasksRoute, logoutRoute, + replyWorkOrderRoute, sessionRoute, taskDetailRoute, } from '@contracts'; @@ -25,6 +26,7 @@ import { ReportDesk } from '@features/desk-report'; import { Ico } from '@web-shared/Ico.tsx'; import { call } from '@web-shared/typed-fetch.ts'; import { useChatWidth } from '@web-shared/useChatWidth.ts'; +import { EmptyState } from '@web-shared/desk/module-kit.tsx'; import { SURFACE_META, canSeeSurface } from '@web-shared/gov/surfaces.ts'; import { queryKeys } from './query.ts'; @@ -91,6 +93,17 @@ export function AppShell() { const me = session.data?.staff.name ?? '—'; + /** + * 工单回传 —— 视图区与对话区同一条口。 + * 回传后按键失效、画面由服务端重投影:前端不自行推演卡与工单的状态(§9.2)。 + */ + const replyOrder = useMutation({ + mutationFn: (reply: WorkOrderReply) => call(replyWorkOrderRoute, { body: { reply } }), + onSuccess: () => { + void queryClient.invalidateQueries({ queryKey: ['desk'] }); + }, + }); + return (
@@ -186,29 +199,72 @@ export function AppShell() { onPick={setTaskId} onCollapse={() => setCollapsed(true)} /> + {/* + 手上没任务时,三栏也得**站得住**:中栏与对话区各给自己的空态。 + 少一栏会让整个工位看着像坏了 —— 空态是常态,不是缺页。 + */} {detail.data !== undefined ? ( - + replyOrder.mutate(reply)} + /> ) : (
-
- - {tasks.isLoading ? '载入中…' : '还没有落到你工位的任务'} -
+ {tasks.isLoading ? ( +
+ + 载入中… +
+ ) : ( + + )}
)} - {detail.data !== undefined && ( - - )} - {detail.data !== undefined && ( -
- -
- )} + +
+ {detail.data !== undefined ? ( + undefined} /> + ) : ( +
+
+ + + + 任务助理 + Agent + 开一单即可对话 +
+
+ +
+
+
+