mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
feat(panel): add conversation turn rail, prompt preview, and decoupled step toggles
- Track user input turn boundaries and prompt previews in extractModelSteps while stripping compaction summary headers - Align interleaved main and subagent steps onto unified rootTurnIndex in telemetry-builder and scope lazy cache refresh to the active session family - Render dynamic left-edge turn rail and viewport-clamped prompt tooltip in StepsDetailView across arbitrary custom column orders - Decouple [主]/[子] agent badges from step index and add independent switches for Turn Rail and Agent Badge under Preferences -> Structure Co-authored-by: Swei <sweilo@qq.com>
This commit is contained in:
@@ -816,6 +816,8 @@ test('preferences schema defaults match pre-refactor UI, migrate legacy none slo
|
||||
assert.deepEqual([...def.hoverModules], ['metrics', 'context', 'quotas']);
|
||||
assert.deepEqual([...def.overviewModules], ['metrics', 'context', 'quotas', 'live_tasks']);
|
||||
assert.deepEqual([...def.overviewMetrics], ['tps', 'ttft', 'avg_tps', 'step_cost']);
|
||||
assert.equal(def.showStepTurnRail, true);
|
||||
assert.equal(def.showStepAgentBadge, true);
|
||||
assert.deepEqual([...def.stepTableColumns], ['step', 'model', 'tps', 'ttft', 'tokens_combo', 'cache', 'cost']);
|
||||
assert.deepEqual({ ...def.modelContextWindows }, {});
|
||||
|
||||
@@ -846,6 +848,8 @@ test('preferences schema defaults match pre-refactor UI, migrate legacy none slo
|
||||
hoverModules: ['metrics', 'context'],
|
||||
overviewModules: ['quotas', 'metrics'],
|
||||
overviewMetrics: ['avg_tps', 'cache_hit'],
|
||||
showStepTurnRail: false,
|
||||
showStepAgentBadge: false,
|
||||
stepTableColumns: ['step', 'time', 'model', 'duration', 'input_tokens', 'output_tokens', 'cost'],
|
||||
contextLimitOverrideTokens: 128000,
|
||||
modelContextWindows: { MODEL_PLACEHOLDER_M418: '900K' },
|
||||
@@ -858,6 +862,8 @@ test('preferences schema defaults match pre-refactor UI, migrate legacy none slo
|
||||
assert.deepEqual([...saveRes.updated.hoverModules], ['metrics', 'context']);
|
||||
assert.deepEqual([...saveRes.updated.overviewModules], ['quotas', 'metrics']);
|
||||
assert.deepEqual([...saveRes.updated.overviewMetrics], ['avg_tps', 'cache_hit']);
|
||||
assert.equal(saveRes.updated.showStepTurnRail, false);
|
||||
assert.equal(saveRes.updated.showStepAgentBadge, false);
|
||||
assert.equal(saveRes.updated.contextLimitOverrideTokens, undefined);
|
||||
assert.deepEqual({ ...saveRes.updated.modelContextWindows }, {});
|
||||
|
||||
@@ -885,5 +891,71 @@ test('preferences schema defaults match pre-refactor UI, migrate legacy none slo
|
||||
assert.equal(resetRes.ok, true);
|
||||
assert.equal(resetRes.updated.language, 'zh-CN');
|
||||
assert.equal(resetRes.updated.themeAccent, 'host');
|
||||
assert.equal(resetRes.updated.showStepTurnRail, true);
|
||||
assert.equal(resetRes.updated.showStepAgentBadge, true);
|
||||
assert.deepEqual([...resetRes.updated.topbarCapsuleSlots], ['context', 'tps', 'quota_auto']);
|
||||
});
|
||||
|
||||
test('assigns unified rootTurnIndex across interleaved main and subagent steps so multi-agent turn rail never fragments', async () => {
|
||||
const mkPlanner = (stepIndex, createdAt, finishedGeneratingAt) => ({
|
||||
status: 'CORTEX_STEP_STATUS_DONE',
|
||||
type: 'CORTEX_STEP_TYPE_PLANNER_RESPONSE',
|
||||
metadata: {
|
||||
sourceTrajectoryStepInfo: { stepIndex },
|
||||
createdAt,
|
||||
finishedGeneratingAt,
|
||||
modelUsage: { model: 'MODEL_PLACEHOLDER_M429', inputTokens: '100', cacheReadTokens: '0', outputTokens: '80' },
|
||||
},
|
||||
plannerResponse: { response: 'ok' },
|
||||
});
|
||||
|
||||
const h = backendHarness({
|
||||
trajectories: {
|
||||
'root-turn': {
|
||||
trajectory: {
|
||||
steps: [
|
||||
{ type: 'CORTEX_STEP_TYPE_USER_INPUT', userInput: { userResponse: '第一轮设计' } },
|
||||
mkPlanner(1, '2026-11-13T20:00:01Z', '2026-11-13T20:00:03Z'),
|
||||
{ type: 'CORTEX_STEP_TYPE_USER_INPUT', userInput: { userResponse: '确认。设计是满意的。执行' } },
|
||||
mkPlanner(3, '2026-11-13T20:33:10Z', '2026-11-13T20:33:12Z'),
|
||||
mkPlanner(5, '2026-11-13T20:33:30Z', '2026-11-13T20:33:35Z'),
|
||||
],
|
||||
},
|
||||
},
|
||||
'sub-turn': {
|
||||
trajectory: {
|
||||
metadata: { parentConversationId: 'root-turn', rootConversationId: 'root-turn' },
|
||||
steps: [
|
||||
{ type: 'CORTEX_STEP_TYPE_USER_INPUT', userInput: { userResponse: 'Subagent internal brief' } },
|
||||
mkPlanner(1, '2026-11-13T20:33:20Z', '2026-11-13T20:33:25Z'),
|
||||
mkPlanner(2, '2026-11-13T20:33:40Z', '2026-11-13T20:33:45Z'),
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
summaries: {
|
||||
'root-turn': { stepCount: 5, lastModifiedTime: '2026-11-13T20:33:35Z', status: 'IDLE' },
|
||||
'sub-turn': {
|
||||
stepCount: 3,
|
||||
lastModifiedTime: '2026-11-13T20:33:45Z',
|
||||
status: 'IDLE',
|
||||
trajectoryMetadata: { parentConversationId: 'root-turn', rootConversationId: 'root-turn' },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const p = await h.buildTelemetryPayloadInternal('root-turn');
|
||||
const mainSteps = p.activeConversation.recentSteps; // desc: #5 (20:33:30), #3 (20:33:10), #1 (20:00:01)
|
||||
const subSteps = p.activeConversation.agents[1].recentSteps; // desc: #2 (20:33:40), #1 (20:33:20)
|
||||
|
||||
for (const s of [mainSteps[0], mainSteps[1], subSteps[0], subSteps[1]]) {
|
||||
assert.equal(s.rootTurnIndex, 2);
|
||||
assert.equal(s.isRootLatestTurn, true);
|
||||
assert.equal(s.rootTurnPrompt, '确认。设计是满意的。执行');
|
||||
}
|
||||
assert.equal(mainSteps[1].isRootTurnStart, true);
|
||||
assert.equal(mainSteps[0].isRootTurnStart, false);
|
||||
assert.equal(subSteps[1].isRootTurnStart, false);
|
||||
assert.equal(subSteps[1].isTurnStart, true);
|
||||
assert.equal(subSteps[1].turnPrompt, 'Subagent internal brief');
|
||||
});
|
||||
|
||||
@@ -295,3 +295,59 @@ test('extractLiveActivity covers thinking, partial streaming tool args, multi-to
|
||||
assert.equal(actTranscript2.stepProgress, '2/2');
|
||||
assert.equal(actTranscript2.detail, '列出插件项目全部源文件 (Get-ChildItem -Path "f:\\ppt")');
|
||||
});
|
||||
|
||||
test('extractModelSteps tracks sequential user turns, merges consecutive prompts, marks media, and strips compaction context summaries', () => {
|
||||
const mkModelStep = (stepIndex) => ({
|
||||
status: 'CORTEX_STEP_STATUS_DONE',
|
||||
type: 'CORTEX_STEP_TYPE_PLANNER_RESPONSE',
|
||||
metadata: {
|
||||
sourceTrajectoryStepInfo: { stepIndex },
|
||||
createdAt: '2026-01-01T00:00:00Z',
|
||||
finishedGeneratingAt: '2026-01-01T00:00:02Z',
|
||||
modelUsage: { inputTokens: '100', cacheReadTokens: '200', outputTokens: '80' },
|
||||
},
|
||||
plannerResponse: { response: 'ok' },
|
||||
});
|
||||
|
||||
const steps = extractModelSteps([
|
||||
{
|
||||
type: 'CORTEX_STEP_TYPE_USER_INPUT',
|
||||
userInput: { userResponse: '第一轮提问' },
|
||||
},
|
||||
mkModelStep(1),
|
||||
{ type: 'CORTEX_STEP_TYPE_VIEW_FILE' },
|
||||
mkModelStep(3),
|
||||
{
|
||||
type: 'CORTEX_STEP_TYPE_USER_INPUT',
|
||||
userInput: { userResponse: '取消前一句' },
|
||||
},
|
||||
{
|
||||
type: 'CORTEX_STEP_TYPE_USER_INPUT',
|
||||
userInput: { userResponse: '第二轮补充提问', media: [{}] },
|
||||
},
|
||||
mkModelStep(7),
|
||||
{
|
||||
type: 'USER_INPUT',
|
||||
content:
|
||||
'<CONTEXT_SUMMARY><USER_REQUEST>旧摘要文本</USER_REQUEST></CONTEXT_SUMMARY>\n<USER_REQUEST>\n 第三轮真实提问 \n</USER_REQUEST>\n<ADDITIONAL_METADATA>ignored</ADDITIONAL_METADATA>',
|
||||
},
|
||||
mkModelStep(9),
|
||||
]);
|
||||
|
||||
assert.equal(steps.length, 4);
|
||||
assert.equal(steps[0].turnIndex, 1);
|
||||
assert.equal(steps[0].isTurnStart, true);
|
||||
assert.equal(steps[0].turnPrompt, '第一轮提问');
|
||||
|
||||
assert.equal(steps[1].turnIndex, 1);
|
||||
assert.equal(steps[1].isTurnStart, false);
|
||||
assert.equal(steps[1].turnPrompt, undefined);
|
||||
|
||||
assert.equal(steps[2].turnIndex, 2);
|
||||
assert.equal(steps[2].isTurnStart, true);
|
||||
assert.equal(steps[2].turnPrompt, '取消前一句\n第二轮补充提问 [附图]');
|
||||
|
||||
assert.equal(steps[3].turnIndex, 3);
|
||||
assert.equal(steps[3].isTurnStart, true);
|
||||
assert.equal(steps[3].turnPrompt, '第三轮真实提问');
|
||||
});
|
||||
|
||||
@@ -763,6 +763,8 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
overviewModules: ['metrics', 'context', 'quotas', 'live_tasks'],
|
||||
overviewMetrics: ['tps', 'ttft', 'avg_tps', 'step_cost'],
|
||||
stepTableColumns: ['step', 'model', 'tps', 'ttft', 'tokens_combo', 'cache', 'cost'],
|
||||
showStepTurnRail: true,
|
||||
showStepAgentBadge: true,
|
||||
showUpstreamModel: false,
|
||||
orchestratorIdMode: 'compact',
|
||||
weeklyLimitMode: 'official',
|
||||
@@ -968,6 +970,14 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
{
|
||||
stepIndex: 35,
|
||||
createdAtMs: 2000,
|
||||
turnIndex: 1,
|
||||
isTurnStart: false,
|
||||
isLatestTurn: true,
|
||||
turnPrompt: '请优化调用明细与轮次导轨',
|
||||
rootTurnIndex: 1,
|
||||
isRootTurnStart: false,
|
||||
isRootLatestTurn: true,
|
||||
rootTurnPrompt: '请优化调用明细与轮次导轨',
|
||||
modelLabel: 'Gemini 4 Hydrogen',
|
||||
modelShort: 'gemini-4-hydrogen',
|
||||
modelUpstream: 'gemini-4-hydrogen',
|
||||
@@ -985,6 +995,14 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
{
|
||||
stepIndex: 20,
|
||||
createdAtMs: 1000,
|
||||
turnIndex: 1,
|
||||
isTurnStart: true,
|
||||
isLatestTurn: true,
|
||||
turnPrompt: '请优化调用明细与轮次导轨',
|
||||
rootTurnIndex: 1,
|
||||
isRootTurnStart: true,
|
||||
isRootLatestTurn: true,
|
||||
rootTurnPrompt: '请优化调用明细与轮次导轨',
|
||||
modelLabel: 'Claude Opus 4.6',
|
||||
modelShort: 'claude-opus-4.6',
|
||||
modelUpstream: 'claude-opus-4-6',
|
||||
@@ -1068,6 +1086,14 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
isSubagent: true,
|
||||
stepIndex: 4,
|
||||
createdAtMs: 3500,
|
||||
turnIndex: 1,
|
||||
isTurnStart: true,
|
||||
isLatestTurn: true,
|
||||
turnPrompt: '审计子代理任务',
|
||||
rootTurnIndex: 1,
|
||||
isRootTurnStart: false,
|
||||
isRootLatestTurn: true,
|
||||
rootTurnPrompt: '请优化调用明细与轮次导轨',
|
||||
modelLabel: 'Gemini 3 Flash',
|
||||
modelShort: 'gemini-3-flash',
|
||||
modelUpstream: 'gemini-3-flash',
|
||||
@@ -1138,6 +1164,12 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
stepCount: 2,
|
||||
activeModelLabel: 'Gemini 4 Hydrogen',
|
||||
activeModelShort: 'gemini-4-hydrogen',
|
||||
recentSteps: mainSteps.map((s) => ({
|
||||
...s,
|
||||
agentId: 'main',
|
||||
agentBadge: '主',
|
||||
isSubagent: false,
|
||||
})),
|
||||
modelBreakdown: mainModels,
|
||||
},
|
||||
{
|
||||
@@ -1163,6 +1195,15 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
activeAgentId: 'sub-fast-1',
|
||||
activeModelLabel: 'Gemini 3 Flash',
|
||||
activeModelShort: 'gemini-3-flash',
|
||||
recentSteps: [
|
||||
subStep,
|
||||
...mainSteps.map((s) => ({
|
||||
...s,
|
||||
agentId: 'main',
|
||||
agentBadge: '主',
|
||||
isSubagent: false,
|
||||
})),
|
||||
],
|
||||
modelBreakdown: [...mainModels, subModel],
|
||||
},
|
||||
};
|
||||
@@ -1745,9 +1786,22 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
assert.deepEqual(mockSettings.overviewModules, ['metrics', 'context', 'quotas', 'live_tasks']);
|
||||
assert.deepEqual(mockSettings.overviewMetrics, ['tps', 'ttft', 'avg_tps', 'step_cost']);
|
||||
|
||||
// Section 3: Step Table Columns (2..12) — add optional 'time' and 'duration' columns
|
||||
// Section 3: Step Table Columns (2..12) + independent Turn Rail & Main/Sub Agent Badge switches
|
||||
const sec3 = accordionSections[3];
|
||||
sec3.querySelector('.collapsible-trigger').dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
const sec3SettingLabels = sec3.querySelectorAll('.form-label').map((el) => el.textContent);
|
||||
assert.ok(sec3SettingLabels.includes('对话轮次导轨'), 'Turn rail switch rendered in 调用明细字段');
|
||||
assert.ok(sec3SettingLabels.includes('主/子代理标识'), 'Main/Sub agent badge switch rendered in 调用明细字段');
|
||||
const sec3SegControls = sec3.querySelectorAll('.segmented');
|
||||
assert.equal(sec3SegControls.length, 2, 'Two independent switches rendered in 调用明细字段');
|
||||
// Toggle off 对话轮次导轨 and 主/子代理标识
|
||||
sec3SegControls[0].querySelectorAll('.seg-btn')[1].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 25));
|
||||
assert.equal(mockSettings.showStepTurnRail, false, 'Turn rail switch updates showStepTurnRail to false');
|
||||
sec3SegControls[1].querySelectorAll('.seg-btn')[1].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 25));
|
||||
assert.equal(mockSettings.showStepAgentBadge, false, 'Agent badge switch updates showStepAgentBadge to false');
|
||||
|
||||
const stepColWrap = sec3.querySelector('.editable-slot-wrap');
|
||||
stepColWrap.querySelector('.slot-add-btn').dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 25));
|
||||
@@ -1756,13 +1810,26 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
assert.equal(mockSettings.stepTableColumns.length, 9, 'Added time and duration columns (7 -> 9)');
|
||||
pillTabs[2].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 15));
|
||||
const stepHeaderThs = allPanes[2].querySelector('.data-table').children[0].children[0].children;
|
||||
const stepTableWhileRailOff = allPanes[2].querySelector('.data-table');
|
||||
assert.equal(
|
||||
stepTableWhileRailOff.classList.contains('has-turn-rail'),
|
||||
false,
|
||||
'has-turn-rail class removed when showStepTurnRail is false'
|
||||
);
|
||||
assert.equal(
|
||||
stepTableWhileRailOff.querySelector('.turn-rail').hasAttribute('hidden'),
|
||||
true,
|
||||
'Turn rail DOM hidden when showStepTurnRail is false'
|
||||
);
|
||||
const stepHeaderThs = stepTableWhileRailOff.children[0].children[0].children;
|
||||
assert.equal(stepHeaderThs.length, 9, 'StepsDetailView thead dynamically renders 9 columns');
|
||||
pillTabs[3].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 15));
|
||||
sec3.querySelector('.btn-ghost-sm').dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 40));
|
||||
assert.equal(mockSettings.stepTableColumns.length, 7);
|
||||
assert.equal(mockSettings.showStepTurnRail, true, 'Section reset restores showStepTurnRail to true');
|
||||
assert.equal(mockSettings.showStepAgentBadge, true, 'Section reset restores showStepAgentBadge to true');
|
||||
|
||||
// --- 其他 (model format, context limits, cache rebuild, reset) ---
|
||||
subNavBtns[2].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
@@ -1928,6 +1995,24 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
assert.equal(stepRows[0].children[4].getAttribute('title'), '上下文 37800 · 思考 420 · 正文 265');
|
||||
assert.equal(stepRows[1].children[4].textContent, '117.7k / 14.5k / 57');
|
||||
|
||||
// Verify minimalist Turn Rail (.has-turn-rail, cap & origin dots) and hover prompt preview tooltip
|
||||
const stepsDataTable = stepsPane.querySelectorAll('.data-table')[0];
|
||||
assert.equal(stepsDataTable.classList.contains('has-turn-rail'), true, 'Turn rail active when showStepTurnRail=true');
|
||||
const row0Rail = stepRows[0].children[0].querySelector('.turn-rail');
|
||||
const row1Rail = stepRows[1].children[0].querySelector('.turn-rail');
|
||||
assert.equal(row0Rail.hasAttribute('hidden'), false);
|
||||
assert.equal(row0Rail.classList.contains('is-latest'), true);
|
||||
assert.equal(row0Rail.querySelector('.turn-rail-dot').classList.contains('is-cap'), true, 'Newest step in turn renders cap dot');
|
||||
assert.equal(row1Rail.querySelector('.turn-rail-dot').classList.contains('is-origin'), true, 'First step of user turn renders hollow origin dot');
|
||||
|
||||
const turnPromptTipEl = stepsPane.querySelector('.turn-prompt-tip');
|
||||
assert.equal(turnPromptTipEl.hasAttribute('hidden'), true, 'Prompt preview tooltip hidden initially');
|
||||
stepRows[0].children[0].onmouseenter({ target: stepRows[0].children[0] });
|
||||
assert.equal(turnPromptTipEl.hasAttribute('hidden'), false, 'Hovering first cell opens turn prompt preview');
|
||||
assert.equal(turnPromptTipEl.textContent, '请优化调用明细与轮次导轨');
|
||||
stepRows[0].children[0].onmouseleave();
|
||||
assert.equal(turnPromptTipEl.hasAttribute('hidden'), true, 'Leaving cell hides turn prompt preview');
|
||||
|
||||
// Verify '按步查看' multi-select model filter (visible when >1 model) & '总汇总' sub-tab rename
|
||||
const stepsHeaderSegBtns = stepsPane.querySelector('.steps-header-controls').querySelectorAll('.seg-btn');
|
||||
assert.equal(stepsHeaderSegBtns[0].textContent, '按步查看 (2)');
|
||||
@@ -2191,8 +2276,78 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
'ModelFitChart model dropdown auto-hidden when only 1 model exists'
|
||||
);
|
||||
|
||||
// Restore sub-tab to 'steps' before subsequent route tests
|
||||
// Restore sub-tab to 'steps', reset scope to 'all', and verify multi-agent rootTurnIndex rail + decoupled [主]/[子] badge toggle
|
||||
stepsHeaderSegBtns[0].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 15));
|
||||
inlineScopeSelectEl
|
||||
.querySelectorAll('.select-option')
|
||||
.find((o) => o.getAttribute('data-value') === 'all')
|
||||
.dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
inlineScopeSelectEl.querySelector('.select-trigger').dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 20));
|
||||
|
||||
const multiStepRows = stepsPane.querySelectorAll('.data-table')[0].children[1].children;
|
||||
assert.equal(multiStepRows.length, 3, 'All 3 interleaved main + subagent steps rendered in 全部代理');
|
||||
assert.equal(
|
||||
multiStepRows[0].children[0].querySelector('.agent-badge').hasAttribute('hidden'),
|
||||
false,
|
||||
'[子1] badge visible when showStepAgentBadge is true'
|
||||
);
|
||||
assert.equal(multiStepRows[0].children[0].querySelector('.agent-badge').textContent, '子1');
|
||||
assert.equal(multiStepRows[1].children[0].querySelector('.agent-badge').textContent, '主');
|
||||
assert.equal(
|
||||
multiStepRows[0].children[0].querySelector('.turn-rail-dot').classList.contains('is-cap'),
|
||||
true,
|
||||
'Interleaved subagent step at top joins unified rootTurnIndex rail as cap'
|
||||
);
|
||||
assert.equal(
|
||||
multiStepRows[1].children[0].querySelector('.turn-rail-dot').hasAttribute('hidden'),
|
||||
true,
|
||||
'Middle main step connects continuously along unified rootTurnIndex rail'
|
||||
);
|
||||
assert.equal(
|
||||
multiStepRows[2].children[0].querySelector('.turn-rail-dot').classList.contains('is-origin'),
|
||||
true,
|
||||
'Earliest main step anchors unified rootTurnIndex rail origin'
|
||||
);
|
||||
|
||||
// Hide [主]/[子] badge independently via settings switch while keeping step numbers (#4, #35, #20) and turn rail intact
|
||||
pillTabs[3].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 15));
|
||||
subNavBtns[1].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 15));
|
||||
sec3SegControls[1].querySelectorAll('.seg-btn')[1].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 25));
|
||||
pillTabs[2].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 15));
|
||||
assert.equal(
|
||||
multiStepRows[0].children[0].querySelector('.agent-badge').hasAttribute('hidden'),
|
||||
true,
|
||||
'[子1] badge hidden when showStepAgentBadge=false'
|
||||
);
|
||||
assert.equal(
|
||||
multiStepRows[1].children[0].querySelector('.agent-badge').hasAttribute('hidden'),
|
||||
true,
|
||||
'[主] badge hidden when showStepAgentBadge=false'
|
||||
);
|
||||
assert.equal(
|
||||
multiStepRows[0].children[0].children.at(-1).textContent,
|
||||
'#4',
|
||||
'Step index remains intact when [主]/[子] badge is hidden'
|
||||
);
|
||||
assert.equal(
|
||||
multiStepRows[0].children[0].querySelector('.turn-rail').hasAttribute('hidden'),
|
||||
false,
|
||||
'Turn rail remains visible independently of [主]/[子] badge switch'
|
||||
);
|
||||
|
||||
// Restore showStepAgentBadge=true before subsequent route tests
|
||||
pillTabs[3].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 15));
|
||||
sec3SegControls[1].querySelectorAll('.seg-btn')[0].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 260));
|
||||
pillTabs[2].dispatchEvent({ type: 'click', stopPropagation() {} });
|
||||
await new Promise((r) => setTimeout(r, 15));
|
||||
liveSubagentPollActive = false;
|
||||
|
||||
// Verify bundle version bump NEVER calls window.location.reload() in overlay mode
|
||||
|
||||
Reference in New Issue
Block a user