feat(shipping-notice): 新增通用解析能力,优化性能并清理遗留废弃代码
This commit is contained in:
1 parent
935bf26fa6
commit
7cfd5d167e
230 files changed
+9337
-10989
No files matched your search
@@ -21,18 +21,18 @@ describe('useChatShippingRefresh', () => {
|
||||
getWorkspaceShippingTaskUiState.mockReset();
|
||||
});
|
||||
|
||||
it('prefers current batch focus task over other explicit anchors', () => {
|
||||
it('prefers active task over message, resolved and query anchors', () => {
|
||||
expect(resolvePreferredShippingTaskId({
|
||||
batchTaskId: 'sn-batch-001',
|
||||
activeTaskId: 'sn-active-001',
|
||||
messageTaskId: 'sn-message-001',
|
||||
resolvedTaskId: 'sn-resolved-001',
|
||||
queryTaskId: 'sn-query-001',
|
||||
})).toBe('SN-BATCH-001');
|
||||
})).toBe('SN-ACTIVE-001');
|
||||
});
|
||||
|
||||
it('returns empty string when no explicit task anchor is available', () => {
|
||||
expect(resolvePreferredShippingTaskId({
|
||||
batchTaskId: '',
|
||||
activeTaskId: '',
|
||||
messageTaskId: '',
|
||||
resolvedTaskId: '',
|
||||
queryTaskId: '',
|
||||
@@ -42,7 +42,6 @@ describe('useChatShippingRefresh', () => {
|
||||
it('syncs ui_state for notifications without attaching chat action buttons', async () => {
|
||||
getWorkspaceShippingTaskUiState.mockResolvedValue({
|
||||
task_no: 'SN-FOCUS-B',
|
||||
batch_no: 'SB-FOCUS-001',
|
||||
checkpoint: 'ready_export',
|
||||
match_status: 'matched',
|
||||
review_status: null,
|
||||
@@ -70,7 +69,7 @@ describe('useChatShippingRefresh', () => {
|
||||
const messages = ref([
|
||||
{
|
||||
role: 'assistant' as const,
|
||||
content: '请继续处理当前批次',
|
||||
content: '请继续处理当前任务',
|
||||
shipping_actions: [
|
||||
{
|
||||
id: 'old-action',
|
||||
@@ -89,7 +88,7 @@ describe('useChatShippingRefresh', () => {
|
||||
isThinking: ref(false),
|
||||
resolvedShippingTaskId,
|
||||
shippingTaskIdFromQuery: computed(() => ''),
|
||||
getActiveBatchTaskId: () => 'SN-FOCUS-B',
|
||||
getActiveShippingTaskId: () => 'SN-FOCUS-B',
|
||||
});
|
||||
|
||||
await refreshShippingActions();
|
||||
@@ -103,7 +102,6 @@ describe('useChatShippingRefresh', () => {
|
||||
it('clears legacy shipping_actions even when api returns action_buttons', async () => {
|
||||
getWorkspaceShippingTaskUiState.mockResolvedValue({
|
||||
task_no: 'SN-SOURCE-001',
|
||||
batch_no: 'SB-SOURCE-001',
|
||||
checkpoint: 'ready_export',
|
||||
match_status: 'matched',
|
||||
review_status: null,
|
||||
@@ -158,7 +156,7 @@ describe('useChatShippingRefresh', () => {
|
||||
isThinking: ref(false),
|
||||
resolvedShippingTaskId: ref('SN-SOURCE-001'),
|
||||
shippingTaskIdFromQuery: computed(() => ''),
|
||||
getActiveBatchTaskId: () => 'SN-SOURCE-001',
|
||||
getActiveShippingTaskId: () => 'SN-SOURCE-001',
|
||||
});
|
||||
|
||||
await refreshShippingActions();
|
||||
@@ -181,7 +179,7 @@ describe('useChatShippingRefresh', () => {
|
||||
isThinking: ref(false),
|
||||
resolvedShippingTaskId: ref(''),
|
||||
shippingTaskIdFromQuery: computed(() => ''),
|
||||
getActiveBatchTaskId: () => '',
|
||||
getActiveShippingTaskId: () => '',
|
||||
});
|
||||
|
||||
await refreshShippingActions();
|
||||
|
||||
Reference in new issue
Block a user