fix(web): 录入卡在等人时,工作区摆占位页,不摆件

建档那一步(「客户 123 不在客户档案里,请核对建档」)要人做的事全在对话区那张录入卡上,
而工作区里躺着的是**上一拍**推的 HTML 件 —— 摆着只会让人以为要在那份工单上办点什么。
`pendingCardsOf`(纯函数,5 测)认出未确认的录入卡 → `ViewRegion` 在 running 之后、viewHtml 之前
插一支占位 `EmptyState`(点名那张表的人读名,指向对话区)。
决策卡**不走**这一支 —— 人要决定的对象常常就是件上那份稿,件得留着给他看。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0167qWjeyBwvfdGovd7FWbCu
This commit is contained in:
xcs
2026-08-28 01:13:07 +08:00
co-authored by Claude Fable 5
parent 282584d26e
commit e3479e0b9b
3 changed files with 122 additions and 3 deletions
@@ -21,6 +21,7 @@ import ScrollArea from '@web-shared/ScrollArea.tsx';
import { EmptyState } from '@web-shared/desk/module-kit.tsx';
import { ViewBlocks, ViewContainer } from '@ui';
import { pagerFace, pagerText } from './pager.ts';
import { pendingCardsOf } from './pending-cards.ts';
import type { ViewEdits, ViewSave } from '@ui';
import { GuideCard, WorkOrderReport } from './work-order-report.tsx';
import { FileViewer } from './FileViewer.tsx';
@@ -173,9 +174,8 @@ export function ViewRegion({ detail, onReplyOrder, values, onField, locate }: Vi
* 出现在这一页(它压根不是工单)。界面不撒谎 —— 这里改成读一眼 `detail.chat`
* 里有没有未回的决策卡 / 录入卡,是就换一句指向对话区的实话。
*/
const pendingChatCard = detail.chat.some(
(m) => (m.k === 'decision' && m.chosen === undefined) || (m.k === 'entry' && m.done === undefined),
);
const pending = pendingCardsOf(detail.chat);
const pendingChatCard = pending.decision || pending.entry;
/*
* 标记已读 / 未读 —— 乐观更新交给失效:标完服务端广播 task 触点,
@@ -776,6 +776,22 @@ export function ViewRegion({ detail, onReplyOrder, values, onField, locate }: Vi
* viewHtml 前面,陈旧的件只在「AI 这会儿不在算」时才配拿来顶上。
*/
<WorkingScene doneN={doneList.length} />
) : pending.entry ? (
/*
* **录入卡在等人时,工作区摆占位页,不摆件**(2026-08-28 用户看柴浩那单
* 「客户 123 不在客户档案里,请核对建档」定的)。建档那一步要人做的事全在
* 对话区那张卡上;这时 `viewHtml` 里躺着的是**上一拍**推的那份 HTML 件,
* 与建档无关 —— 摆着只会让人以为要在那份工单上办点什么。
* 这一支排在 viewHtml 之前、running 之后:AI 在算时照旧是推进场景。
* 决策卡不走这一支 —— 人要决定的对象常常就是件上那份稿,件得留着给他看。
*/
<EmptyState
ico="users"
tone="brand"
title="先把这份档案建起来"
desc={`AI 认不出这位客户,已在右边对话区发了一张「${pending.entryLedger ?? '档案'}」录入卡。核对、确认后档案落进台账,AI 接着往下推进 —— 这一步工作区没有要你看的件。`}
hint="录入在对话区那张卡上,不在这里"
/>
) : detail.viewHtml !== undefined ? (
/*
* **工作区只放那份件本身**(2026-08-01 用户定)。