feat(shipping-notice): 货代会话主区域切换为批次中心常驻并按附件派生会话标题
- 会话命名:新增业务命名纯函数,新建抽取会话按附件内容派生标题,仅新建不回填不改名 - 批次中心常驻主区域并展示会话标题:移除关闭入口、隐藏对话列、去除面板外壳与折叠/钉住徽标 - 清理对话流打开批次中心的冗余链路 - 新增设计文档与实施计划,同步功能清单说明
This commit is contained in:
1 parent
d396371020
commit
e472abc4e3
21 files changed
+1198
-206
No files matched your search
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingWorkbenchLayout.spec.ts
|
||||
* 用途:锁定货代会话主区域显隐规则(有会话即全屏批次进度中心,方案 A)。
|
||||
* 依赖:Vitest、纯函数。
|
||||
* 逻辑:判定必须同时满足货代智能体与非空会话 ID;普通智能体与新会话一律回落欢迎页。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { shouldShowShippingWorkbench } from './shippingWorkbenchLayout';
|
||||
|
||||
describe('shouldShowShippingWorkbench', () => {
|
||||
it('renders the workbench for the shipping agent once a conversation exists', () => {
|
||||
expect(shouldShowShippingWorkbench({ isShippingNoticeAgent: true, conversationId: 'conv-1' })).toBe(true);
|
||||
});
|
||||
|
||||
it('keeps the welcome composer before a conversation is created', () => {
|
||||
expect(shouldShowShippingWorkbench({ isShippingNoticeAgent: true, conversationId: '' })).toBe(false);
|
||||
expect(shouldShowShippingWorkbench({ isShippingNoticeAgent: true, conversationId: null })).toBe(false);
|
||||
});
|
||||
|
||||
it('never switches other agents to the workbench', () => {
|
||||
expect(shouldShowShippingWorkbench({ isShippingNoticeAgent: false, conversationId: 'conv-1' })).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingWorkbenchLayout.ts
|
||||
* 用途:货代发货会话主区域显隐判定(批次进度中心优先,方案 A)。
|
||||
* 依赖:无(纯函数)。
|
||||
* 逻辑:货代智能体且存在非空会话 ID 时全屏渲染批次进度中心;
|
||||
* 否则(新会话欢迎页)显示欢迎页 + 输入框(唯一附件提交入口)。
|
||||
*/
|
||||
|
||||
export interface ShippingWorkbenchLayoutInput {
|
||||
isShippingNoticeAgent: boolean;
|
||||
conversationId: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判定是否以批次进度中心作为会话主区域。
|
||||
* @param input - 智能体身份与当前会话 ID(路由 query 与 page 回填同源优先级)。
|
||||
* @returns true 表示全屏渲染批次进度中心;false 表示欢迎页 + 输入框。
|
||||
*/
|
||||
export function shouldShowShippingWorkbench(input: ShippingWorkbenchLayoutInput): boolean {
|
||||
return Boolean(input.isShippingNoticeAgent && String(input.conversationId || '').trim());
|
||||
}
|
||||
Reference in new issue
Block a user