优化:未分类连续维护与柏拉图预汇总,同步已发布修复

This commit is contained in:
2026-11-01 12:40:50 +08:00
parent 572873c6b8
commit 38290f5fec
135 changed files with 17613 additions and 663 deletions
+26 -4
View File
@@ -104,6 +104,27 @@ test('a broad visual remains the root when another visual is narrowed by keyword
visual({id:'filtered',scope:{year:2026,month:9,releaseId:'release-a',productSearch:'16.33'}}),
]}), '2026年9月 · 对比 2026年8月 · 当前授权范围 · 不含未分类');
});
test('a multi-period historical report never inherits the current query month or its broadest chart',()=>{
const value={completionMethod:'confirmed_history_report',plan:{context:{year:2026,month:9,view:'overall'}},
historySources:[{turnId:'a',available:true},{turnId:'b',available:true}],
historySections:[{sourceTurnId:'a',period:{year:2026,month:9},filters:{department:'消费电子产业部',group:'消费电子-3C'}},
{sourceTurnId:'b',period:{year:2026,month:8},filters:{}}],visuals:[visual()]};
assert.equal(analysisScopeText(value),'');
assert.equal(analysisScopeText({...value,historySections:[value.historySections[0],{...value.historySections[0],filters:{department:'其他产业部'}}]}),'');
});
test('a single historical scope uses its authorized source frame, including its actual comparison only',()=>{
const source={sourceTurnId:'a',period:{year:2026,month:8},filters:{department:'产业部甲',group:'分组甲',includeUnassigned:false}};
const value={completionMethod:'confirmed_history_report',plan:{context:{year:2026,month:9},semantic:{compare:true,priorContext:{year:2025,month:1}}},
historySources:[{turnId:'a',available:true}],historySections:[source,{...source}]};
assert.equal(analysisScopeText(value),'2026年8月 · 产业部:产业部甲 · 业务分组:分组甲 · 不含未分类');
assert.equal(analysisScopeText({...value,historySources:[{turnId:'a',available:false}]}),'');
});
test('the current nested result cannot borrow stale flattened historical scope metadata',()=>{
const value={completionMethod:'confirmed_history_report',historySources:[{turnId:'old',available:true}],
historySections:[{sourceTurnId:'old',period:{year:2025,month:1},filters:{group:'旧分组'}}],
result:{completionMethod:'formal_metrics',plan:{context:{year:2026,month:9,group:'当前分组'}}}};
assert.equal(analysisScopeText(value),'2026年9月 · 业务分组:当前分组');
});
test('typing and queuing followups never removes the stop control',()=>{
for(const draft of ['','follow-up'])for(const queued of ['','queued']){
const state=analysisComposerState(true,false,false,draft,queued);
@@ -126,9 +147,9 @@ const thinkingSource=fs.readFileSync(new URL('../src/ModelThinkingPanel.tsx',imp
const Thinking=new Function('React','useEffect','useLayoutEffect','useRef','useState','LoadingOutlined','RightOutlined','analysisScrollFollows','modelThinkingEntries','thinkingStatus',
ts.transpileModule(`${thinkingSource}\nreturn AnalysisThinkingBlock;`,{fileName:'thinking.tsx',compilerOptions:{target:ts.ScriptTarget.ES2022,jsx:ts.JsxEmit.React}}).outputText
)(React,React.useEffect,React.useLayoutEffect,React.useRef,React.useState,icon,icon,analysisScrollFollows,modelThinkingEntries,thinkingStatus);
const Process=new Function('React','useEffect','useState','Spin','CheckCircleOutlined','CloseCircleOutlined','ClockCircleOutlined','RightOutlined','analysisIsRunning','compactAnalysisTimeline','duplicatesFinalAnalysisAnswer','sanitizeAnalysisDisplayText','AiMarkdown','orderedAnalysisProcess','groupAdjacentThinking','AnalysisThinkingBlock',
const Process=new Function('React','useEffect','useRef','useState','Spin','CheckCircleOutlined','CloseCircleOutlined','ClockCircleOutlined','RightOutlined','analysisIsRunning','compactAnalysisTimeline','duplicatesFinalAnalysisAnswer','sanitizeAnalysisDisplayText','AiMarkdown','orderedAnalysisProcess','groupAdjacentThinking','AnalysisThinkingBlock',
ts.transpileModule(`${processSource}\nreturn AnalysisProcess;`,{fileName:'process.tsx',compilerOptions:{target:ts.ScriptTarget.ES2022,jsx:ts.JsxEmit.React}}).outputText
)(React,React.useEffect,React.useState,icon,icon,icon,icon,icon,analysisIsRunning,compactAnalysisTimeline,duplicatesFinalAnalysisAnswer,sanitizeAnalysisDisplayText,({content})=>React.createElement('p',null,content),orderedAnalysisProcess,groupAdjacentThinking,Thinking);
)(React,React.useEffect,React.useRef,React.useState,icon,icon,icon,icon,icon,analysisIsRunning,compactAnalysisTimeline,duplicatesFinalAnalysisAnswer,sanitizeAnalysisDisplayText,({content})=>React.createElement('p',null,content),orderedAnalysisProcess,groupAdjacentThinking,Thinking);
const processTurn=status=>({status,steps:[{tool:'read',label:'读取数据',status:'completed'}]});
test('settled process is collapsed, with the original records retained inside',()=>{
for(const status of ['COMPLETED','PARTIAL','FAILED','CANCELLED']){
@@ -137,9 +158,10 @@ test('settled process is collapsed, with the original records retained inside',(
assert.doesNotMatch(html,/<details class="analysis-process-history analysis-agent-process" open/);
}
});
test('running process remains visible instead of being hidden behind the completed fold',()=>{
test('running process stays folded by default while retaining its current records inside',()=>{
const html=renderToStaticMarkup(React.createElement(Process,{turn:processTurn('RUNNING')}));
assert.match(html,/读取数据/);assert.match(html,/<details class="analysis-process-history analysis-agent-process" open/);
assert.match(html,/读取数据/);assert.match(html,/<details class="analysis-process-history analysis-agent-process"/);
assert.doesNotMatch(html,/<details class="analysis-process-history analysis-agent-process" open/);
});
test('a submitted follow-up rearms following only when its own turn is rendered',()=>{