mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
feat(panel): polish compaction row popover, pill selects, steps header, scrollbar, and chart tooltips
# Conflicts: # sidecars/panel/index.html
This commit is contained in:
@@ -782,11 +782,23 @@ export function createSessionLineChart() {
|
||||
const tipHeadRight = h('span', { className: 'trend-tip-calls text-mono' });
|
||||
const tipMainLeft = h('strong', { className: 'trend-tip-tokens text-mono' });
|
||||
const tipMainRight = h('span', { className: 'trend-tip-cost text-mono' });
|
||||
const tipInLabelEl = h('span', { className: 'trend-tip-stat-label', text: t('cons.legInput') });
|
||||
const tipInValEl = h('span', { className: 'trend-tip-stat-val text-mono' });
|
||||
const tipCacheLabelEl = h('span', { className: 'trend-tip-stat-label', text: t('cons.legCache') });
|
||||
const tipCacheValEl = h('span', { className: 'trend-tip-stat-val text-mono' });
|
||||
const tipOutLabelEl = h('span', { className: 'trend-tip-stat-label', text: t('cons.legOutput') });
|
||||
const tipOutValEl = h('span', { className: 'trend-tip-stat-val text-mono' });
|
||||
const tipIoGrid = h('div', { className: 'trend-tip-sub is-grid', hidden: true }, [
|
||||
h('div', { className: 'trend-tip-stat' }, [tipInLabelEl, tipInValEl]),
|
||||
h('div', { className: 'trend-tip-stat' }, [tipCacheLabelEl, tipCacheValEl]),
|
||||
h('div', { className: 'trend-tip-stat' }, [tipOutLabelEl, tipOutValEl]),
|
||||
]);
|
||||
const tipSub = h('div', { className: 'trend-tip-sub text-mono', hidden: true });
|
||||
const tipAnomaly = h('div', { className: 'trend-tip-anomaly text-mono', hidden: true });
|
||||
const tooltipEl = h('div', { className: 'trend-tooltip', hidden: true }, [
|
||||
h('div', { className: 'trend-tip-head' }, [tipHeadLeft, tipHeadRight]),
|
||||
h('div', { className: 'trend-tip-main' }, [tipMainLeft, tipMainRight]),
|
||||
tipIoGrid,
|
||||
tipSub,
|
||||
tipAnomaly,
|
||||
]);
|
||||
@@ -863,8 +875,18 @@ export function createSessionLineChart() {
|
||||
pt.valid ? formatChartMetricValue(currentMetric, pt.value) : t('chart.step.excluded')
|
||||
);
|
||||
patchText(tipMainRight, pt.secondaryRight || '');
|
||||
patchAttr(tipSub, 'hidden', !pt.subDetail);
|
||||
if (pt.subDetail) {
|
||||
const hasIoParts = Boolean(pt.ioParts);
|
||||
patchAttr(tipIoGrid, 'hidden', !hasIoParts);
|
||||
if (hasIoParts) {
|
||||
patchText(tipInLabelEl, t('cons.legInput'));
|
||||
patchText(tipCacheLabelEl, t('cons.legCache'));
|
||||
patchText(tipOutLabelEl, t('cons.legOutput'));
|
||||
patchText(tipInValEl, pt.ioParts.inTok);
|
||||
patchText(tipCacheValEl, pt.ioParts.cacheTok);
|
||||
patchText(tipOutValEl, pt.ioParts.outTok);
|
||||
}
|
||||
patchAttr(tipSub, 'hidden', hasIoParts || !pt.subDetail);
|
||||
if (!hasIoParts && pt.subDetail) {
|
||||
patchText(tipSub, pt.subDetail);
|
||||
}
|
||||
patchAttr(tipAnomaly, 'hidden', !pt.anomalySummary);
|
||||
@@ -1107,15 +1129,17 @@ export function createSessionLineChart() {
|
||||
let value = 0;
|
||||
let secondaryRight = '';
|
||||
let subDetail = '';
|
||||
let ioParts = null;
|
||||
|
||||
if (metric === 'totalTokens') {
|
||||
value = isMultiCompare ? modelCumTok : runningTokens;
|
||||
secondaryRight = t('chart.step.stepAdd', { tokens: formatTokens(stepTotalTok) });
|
||||
subDetail = t('chart.step.ioSplit', {
|
||||
ioParts = {
|
||||
inTok: formatTokens(inTok),
|
||||
cacheTok: formatTokens(cacheTok),
|
||||
outTok: formatTokens(outTok),
|
||||
});
|
||||
};
|
||||
subDetail = t('chart.step.ioSplit', ioParts);
|
||||
} else if (metric === 'context') {
|
||||
value = ctxTok;
|
||||
if (hasPrevCtx) {
|
||||
@@ -1198,6 +1222,7 @@ export function createSessionLineChart() {
|
||||
value,
|
||||
secondaryRight,
|
||||
subDetail,
|
||||
ioParts,
|
||||
anomalySummary,
|
||||
anomalySeverity: st.anomaly?.severity || '',
|
||||
};
|
||||
|
||||
@@ -324,7 +324,17 @@ export function createTrendAreaChart() {
|
||||
const tipCallsEl = h('span', { className: 'trend-tip-calls text-mono' });
|
||||
const tipTokensEl = h('strong', { className: 'trend-tip-tokens text-mono' });
|
||||
const tipCostEl = h('span', { className: 'trend-tip-cost text-mono' });
|
||||
const tipSubEl = h('div', { className: 'trend-tip-sub text-mono', hidden: true });
|
||||
const tipInLabelEl = h('span', { className: 'trend-tip-stat-label', text: t('cons.legInput') });
|
||||
const tipInValEl = h('span', { className: 'trend-tip-stat-val text-mono' });
|
||||
const tipCacheLabelEl = h('span', { className: 'trend-tip-stat-label', text: t('cons.legCache') });
|
||||
const tipCacheValEl = h('span', { className: 'trend-tip-stat-val text-mono' });
|
||||
const tipOutLabelEl = h('span', { className: 'trend-tip-stat-label', text: t('cons.legOutput') });
|
||||
const tipOutValEl = h('span', { className: 'trend-tip-stat-val text-mono' });
|
||||
const tipSubEl = h('div', { className: 'trend-tip-sub is-grid', hidden: true }, [
|
||||
h('div', { className: 'trend-tip-stat' }, [tipInLabelEl, tipInValEl]),
|
||||
h('div', { className: 'trend-tip-stat' }, [tipCacheLabelEl, tipCacheValEl]),
|
||||
h('div', { className: 'trend-tip-stat' }, [tipOutLabelEl, tipOutValEl]),
|
||||
]);
|
||||
const tipModelsEl = h('div', { className: 'cons-pop-models', hidden: true });
|
||||
|
||||
const tooltipEl = h(
|
||||
@@ -455,14 +465,12 @@ export function createTrendAreaChart() {
|
||||
slot.outputTokens !== undefined);
|
||||
patchAttr(tipSubEl, 'hidden', !hasSubBreakdown);
|
||||
if (hasSubBreakdown) {
|
||||
patchText(
|
||||
tipSubEl,
|
||||
t('chart.step.ioSplit', {
|
||||
inTok: formatTokensPrecise(safeSlotTokens(slot.inputTokens)),
|
||||
cacheTok: formatTokensPrecise(safeSlotTokens(slot.cacheReadTokens)),
|
||||
outTok: formatTokensPrecise(safeSlotTokens(slot.outputTokens)),
|
||||
})
|
||||
);
|
||||
patchText(tipInLabelEl, t('cons.legInput'));
|
||||
patchText(tipCacheLabelEl, t('cons.legCache'));
|
||||
patchText(tipOutLabelEl, t('cons.legOutput'));
|
||||
patchText(tipInValEl, formatTokensPrecise(safeSlotTokens(slot.inputTokens)));
|
||||
patchText(tipCacheValEl, formatTokensPrecise(safeSlotTokens(slot.cacheReadTokens)));
|
||||
patchText(tipOutValEl, formatTokensPrecise(safeSlotTokens(slot.outputTokens)));
|
||||
}
|
||||
|
||||
const modelSegs = Array.isArray(slot.modelSegments) ? slot.modelSegments : [];
|
||||
|
||||
@@ -56,6 +56,7 @@ export const CustomSelect = defineComponent({
|
||||
setup({ getProps, setProps, emit, onCleanup }) {
|
||||
let isOpen = false;
|
||||
let focusedIndex = -1;
|
||||
let lastOpenMenuLayoutSig = '';
|
||||
|
||||
const initialIcon = getProps().icon;
|
||||
const leadIcon = createSvgIcon(initialIcon || 'bolt', { size: 13 });
|
||||
@@ -134,6 +135,15 @@ export const CustomSelect = defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function buildMenuLayoutSig(options = [], labelText = '') {
|
||||
let sig = `${labelText}|${options.length}`;
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
const o = options[i];
|
||||
sig += `|${o?.value ?? ''}:${o?.label ?? ''}:${o?.meta ?? ''}`;
|
||||
}
|
||||
return sig;
|
||||
}
|
||||
|
||||
function toggleOpen(nextOpen) {
|
||||
isOpen = Boolean(nextOpen);
|
||||
if (isOpen) {
|
||||
@@ -144,6 +154,9 @@ export const CustomSelect = defineComponent({
|
||||
opts.findIndex((o) => selSet.has(o.value))
|
||||
);
|
||||
renderMenuOptions();
|
||||
lastOpenMenuLayoutSig = buildMenuLayoutSig(opts, triggerLabel.textContent || '');
|
||||
} else {
|
||||
lastOpenMenuLayoutSig = '';
|
||||
}
|
||||
patchClasses(rootEl, { 'is-open': isOpen });
|
||||
patchAttr(triggerBtn, 'aria-expanded', isOpen ? 'true' : 'false');
|
||||
@@ -343,7 +356,11 @@ export const CustomSelect = defineComponent({
|
||||
patchAttr(triggerBtn, 'title', titleText);
|
||||
if (isOpen) {
|
||||
renderMenuOptions();
|
||||
positionMenu();
|
||||
const nextLayoutSig = buildMenuLayoutSig(options, labelText);
|
||||
if (nextLayoutSig !== lastOpenMenuLayoutSig) {
|
||||
lastOpenMenuLayoutSig = nextLayoutSig;
|
||||
positionMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
} from '../../core/domPatch.js';
|
||||
import {
|
||||
buildStepAnomalyDiagnostic,
|
||||
buildStepCompactionDiagnostic,
|
||||
resolveModelDisplayInfo,
|
||||
speedReasonText,
|
||||
} from '../../core/formatters.js';
|
||||
@@ -22,6 +23,7 @@ import { getEffectiveLocale, t } from '../../i18n/index.js';
|
||||
import {
|
||||
DEFAULT_STEP_COLUMN_KEYS,
|
||||
STEP_COLUMN_REGISTRY,
|
||||
isCompactionStepItem,
|
||||
} from '../../registries/stepColumnRegistry.js';
|
||||
import {
|
||||
formatAgentBadgeText,
|
||||
@@ -329,7 +331,7 @@ function buildColumnSizerSpec(tableSteps, colKeys, wantedSet, cellCtx) {
|
||||
let bestModelObj = firstStep;
|
||||
for (const cand of modelCandidates.values()) {
|
||||
const disp = resolveModelDisplayInfo(cand, cellCtx?.displaySettings, { fallback: '—' });
|
||||
const len = (disp.baseText?.length || 0) + (disp.compactionSuffix?.length || 0);
|
||||
const len = disp.baseText?.length || 0;
|
||||
if (len > bestModelLen) {
|
||||
bestModelLen = len;
|
||||
bestModelObj = cand;
|
||||
@@ -509,7 +511,10 @@ export const StepTableWidget = defineComponent({
|
||||
return;
|
||||
}
|
||||
hideTurnTip();
|
||||
patchClasses(anomalyTipEl, { 'is-danger': diag.severity === 'danger' });
|
||||
patchClasses(anomalyTipEl, {
|
||||
'is-danger': diag.severity === 'danger',
|
||||
'is-compaction': diag.severity === 'compaction',
|
||||
});
|
||||
patchText(anomalyTipTitleEl, diag.title);
|
||||
patchAttr(anomalyTipSubEl, 'hidden', !diag.sub);
|
||||
if (diag.sub) patchText(anomalyTipSubEl, diag.sub);
|
||||
@@ -527,7 +532,10 @@ export const StepTableWidget = defineComponent({
|
||||
if (row.detail) {
|
||||
itemChildren.push(
|
||||
h('div', {
|
||||
className: 'step-anomaly-tip-detail text-mono',
|
||||
className:
|
||||
row.mono === false
|
||||
? 'step-anomaly-tip-detail'
|
||||
: 'step-anomaly-tip-detail text-mono',
|
||||
text: row.detail,
|
||||
})
|
||||
);
|
||||
@@ -679,16 +687,35 @@ export const StepTableWidget = defineComponent({
|
||||
if (event?.target === badge) hideTurnTip();
|
||||
}
|
||||
|
||||
function buildStepRowDiagnostic(st, displaySettings, hasStepAnomaly, isCompactionRow) {
|
||||
if (hasStepAnomaly) {
|
||||
const diag = buildStepAnomalyDiagnostic(st);
|
||||
if (diag && isCompactionRow) {
|
||||
return {
|
||||
...diag,
|
||||
hint: diag.hint
|
||||
? `${diag.hint} · ${t('steps.compactionAnomalyHint')}`
|
||||
: t('steps.compactionAnomalyHint'),
|
||||
};
|
||||
}
|
||||
return diag;
|
||||
}
|
||||
if (isCompactionRow) {
|
||||
return buildStepCompactionDiagnostic(st, displaySettings);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function moveAlongTurnRail(event) {
|
||||
const { badge, prompt, anomalyStep } = hoverRows.get(this);
|
||||
const { badge, prompt, rowDiagGetter } = hoverRows.get(this);
|
||||
const rect = this.getBoundingClientRect?.();
|
||||
const relX = rect ? (event?.clientX ?? 0) - rect.left : 0;
|
||||
if (event?.target !== badge && relX <= 18) {
|
||||
showTurnTip(this, prompt);
|
||||
} else {
|
||||
hideTurnTip();
|
||||
if (anomalyStep) {
|
||||
showAnomalyTip(this, buildStepAnomalyDiagnostic(anomalyStep));
|
||||
if (rowDiagGetter) {
|
||||
showAnomalyTip(this, rowDiagGetter());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -696,8 +723,8 @@ export const StepTableWidget = defineComponent({
|
||||
function leaveStepCell(event) {
|
||||
const entry = hoverRows.get(this);
|
||||
hideTurnTip();
|
||||
if (entry?.anomalyStep && entry.tr && event?.relatedTarget && entry.tr.contains?.(event.relatedTarget)) {
|
||||
showAnomalyTip(this, buildStepAnomalyDiagnostic(entry.anomalyStep));
|
||||
if (entry?.rowDiagGetter && entry.tr && event?.relatedTarget && entry.tr.contains?.(event.relatedTarget)) {
|
||||
showAnomalyTip(this, entry.rowDiagGetter());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -991,7 +1018,8 @@ export const StepTableWidget = defineComponent({
|
||||
: '';
|
||||
const stripeSig = isVirtualized ? (item.isStripeEven ? 'E' : 'O') : 'N';
|
||||
const anomalySig = st.anomalySig || '';
|
||||
return `${locale}:${colOrderSig}:${stripeSig}:${badgeSig}:${anomalySig}:${railActive}:${item.hasTurn}:${item.hasUp}:${item.hasDown}:${item.isStart}:${item.isLatest}:${item.prompt}:${parts}`;
|
||||
const compactSig = isCompactionStepItem(st) ? 'C' : '';
|
||||
return `${locale}:${colOrderSig}:${stripeSig}:${badgeSig}:${anomalySig}:${compactSig}:${railActive}:${item.hasTurn}:${item.hasUp}:${item.hasDown}:${item.isStart}:${item.isLatest}:${item.prompt}:${parts}`;
|
||||
},
|
||||
createRow: (item) => {
|
||||
if (item.isSizer) {
|
||||
@@ -1236,14 +1264,20 @@ export const StepTableWidget = defineComponent({
|
||||
const hasStepAnomaly = Boolean(st?.anomaly && Number(st.anomaly.count) > 0);
|
||||
const isAnomalyDanger = Boolean(hasStepAnomaly && st.anomaly.severity === 'danger');
|
||||
const isAnomalyWarn = Boolean(hasStepAnomaly && !isAnomalyDanger);
|
||||
const isCompactionRow = isCompactionStepItem(st);
|
||||
const hasRowTip = hasStepAnomaly || isCompactionRow;
|
||||
const rowDiagGetter = hasRowTip
|
||||
? () => buildStepRowDiagnostic(st, cellCtx.displaySettings, hasStepAnomaly, isCompactionRow)
|
||||
: null;
|
||||
patchClasses(tr, {
|
||||
'is-compaction': isCompactionRow,
|
||||
'is-anomaly-warn': isAnomalyWarn,
|
||||
'is-anomaly-danger': isAnomalyDanger,
|
||||
});
|
||||
if (hasStepAnomaly) {
|
||||
if (hasRowTip) {
|
||||
const anchorEl = firstTd || tr;
|
||||
tr.onmouseenter = () => {
|
||||
showAnomalyTip(anchorEl, buildStepAnomalyDiagnostic(st));
|
||||
showAnomalyTip(anchorEl, rowDiagGetter());
|
||||
};
|
||||
tr.onmouseleave = hideAnomalyTip;
|
||||
} else {
|
||||
@@ -1268,10 +1302,10 @@ export const StepTableWidget = defineComponent({
|
||||
hoverRows.set(hoverTd, {
|
||||
badge: refs.agentBadgeEl,
|
||||
prompt,
|
||||
anomalyStep: hasStepAnomaly ? st : null,
|
||||
rowDiagGetter,
|
||||
tr,
|
||||
});
|
||||
const useWholeCellTurnTip = firstColKey === 'step' && !hasStepAnomaly;
|
||||
const useWholeCellTurnTip = firstColKey === 'step' && !hasRowTip;
|
||||
hoverTd.onmouseenter = useWholeCellTurnTip ? enterStepCell : null;
|
||||
hoverTd.onmousemove = useWholeCellTurnTip ? moveInStepCell : moveAlongTurnRail;
|
||||
hoverTd.onmouseleave = leaveStepCell;
|
||||
@@ -1299,6 +1333,7 @@ export const StepTableWidget = defineComponent({
|
||||
patchClasses(tr, {
|
||||
'is-stripe-even': false,
|
||||
'is-step-entering': false,
|
||||
'is-compaction': false,
|
||||
'is-anomaly-warn': false,
|
||||
'is-anomaly-danger': false,
|
||||
});
|
||||
|
||||
@@ -322,7 +322,22 @@ export function positionAnchoredPopup(
|
||||
popupEl.style.maxHeight = '';
|
||||
|
||||
const availWidth = Math.max(120, Math.floor(bound.width - margin * 2));
|
||||
popupEl.style.maxWidth = `${availWidth}px`;
|
||||
let cssMaxW = NaN;
|
||||
if (typeof window !== 'undefined' && typeof window.getComputedStyle === 'function') {
|
||||
try {
|
||||
const rawMaxW = window.getComputedStyle(popupEl)?.maxWidth;
|
||||
if (rawMaxW && rawMaxW !== 'none') {
|
||||
cssMaxW = Number.parseFloat(rawMaxW);
|
||||
}
|
||||
} catch {
|
||||
// 忽略 Mock DOM 样式查询异常
|
||||
}
|
||||
}
|
||||
const effectiveMaxW =
|
||||
Number.isFinite(cssMaxW) && cssMaxW > 0
|
||||
? Math.max(120, Math.min(availWidth, Math.floor(cssMaxW)))
|
||||
: availWidth;
|
||||
popupEl.style.maxWidth = `${effectiveMaxW}px`;
|
||||
|
||||
const rawRect = popupEl.getBoundingClientRect?.();
|
||||
// 优先读取 offsetWidth,避免入场动画 scale(0.975) 导致测宽偏小
|
||||
@@ -330,10 +345,13 @@ export function positionAnchoredPopup(
|
||||
Number(popupEl.offsetWidth || 0),
|
||||
Math.ceil(Number(rawRect?.width || 0))
|
||||
);
|
||||
if (naturalW > availWidth) {
|
||||
if (naturalW > effectiveMaxW) {
|
||||
popupEl.style.minWidth = '0px';
|
||||
}
|
||||
const popupW = Math.min(availWidth, naturalW > 0 ? naturalW : Math.max(triggerRect.width, 210));
|
||||
const popupW = Math.min(
|
||||
effectiveMaxW,
|
||||
naturalW > 0 ? naturalW : Math.max(triggerRect.width, 210)
|
||||
);
|
||||
|
||||
const safeLeft = bound.left + margin;
|
||||
const safeRight = bound.right - margin;
|
||||
|
||||
@@ -222,6 +222,42 @@ export function buildStepAnomalyDiagnostic(st) {
|
||||
};
|
||||
}
|
||||
|
||||
export function buildStepCompactionDiagnostic(st, displaySettings = {}) {
|
||||
if (!st || typeof st !== 'object') return null;
|
||||
const disp = resolveModelDisplayInfo(st, displaySettings, { fallback: '' });
|
||||
const promptTok =
|
||||
Math.max(0, Number(st.inputTokens || 0)) + Math.max(0, Number(st.cacheReadTokens || 0));
|
||||
const outTok = Math.max(0, Number(st.outputTokens || 0));
|
||||
const title = t('steps.compactionStepTitle', { step: Number(st.stepIndex ?? 0) });
|
||||
const rows =
|
||||
promptTok > 0 || outTok > 0
|
||||
? [
|
||||
{
|
||||
text: t('steps.compactionSummaryRow', {
|
||||
input: formatTokens(promptTok),
|
||||
output: formatTokens(outTok),
|
||||
}),
|
||||
detail: t('steps.compactionDetailHint'),
|
||||
mono: false,
|
||||
danger: false,
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
text: t('steps.compactionDetailHint'),
|
||||
detail: '',
|
||||
danger: false,
|
||||
},
|
||||
];
|
||||
return {
|
||||
title,
|
||||
sub: disp.baseText || '',
|
||||
rows,
|
||||
hint: '',
|
||||
severity: 'compaction',
|
||||
};
|
||||
}
|
||||
|
||||
export function buildModelAnomalyDiagnostic(m) {
|
||||
const sum = resolveModelAnomalySummary(m);
|
||||
if (!sum) return null;
|
||||
|
||||
@@ -325,6 +325,10 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
|
||||
'steps.anomalyKind.canceled': 'Canceled by User',
|
||||
'steps.anomalyStepTitle': '#{step} · {count} Retries / Errors',
|
||||
'steps.anomalyDelayPart': 'Backoff {sec}s',
|
||||
'steps.compactionStepTitle': '#{step} · Auto-Compaction',
|
||||
'steps.compactionSummaryRow': 'Input {input} → Summary {output}',
|
||||
'steps.compactionDetailHint': 'Automatic context compaction step triggered to summarize history and free window space',
|
||||
'steps.compactionAnomalyHint': 'This step is also an auto-compaction step',
|
||||
'steps.anomalyTerminalTag': 'Stopped',
|
||||
'steps.anomalyModelTitle': '{model} · {count} Retries / Errors',
|
||||
'steps.anomalyModelSub': '{steps} steps affected',
|
||||
|
||||
@@ -325,6 +325,10 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
|
||||
'steps.anomalyKind.canceled': '用户取消',
|
||||
'steps.anomalyStepTitle': '#{step} · 异常 {count} 次',
|
||||
'steps.anomalyDelayPart': '退避 {sec}s',
|
||||
'steps.compactionStepTitle': '#{step} · 自动压缩',
|
||||
'steps.compactionSummaryRow': '输入 {input} → 摘要输出 {output}',
|
||||
'steps.compactionDetailHint': '系统自动触发的上下文压缩步骤,用于折叠历史对话以释放窗口空间',
|
||||
'steps.compactionAnomalyHint': '该步骤同时为系统自动压缩步骤',
|
||||
'steps.anomalyTerminalTag': '中止',
|
||||
'steps.anomalyModelTitle': '{model} · 异常 {count} 次',
|
||||
'steps.anomalyModelSub': '涉及 {steps} 步',
|
||||
|
||||
@@ -114,6 +114,13 @@ function formatStepClockTime(createdAtMs) {
|
||||
return { text: hhmmss, title: full };
|
||||
}
|
||||
|
||||
export function isCompactionStepItem(st) {
|
||||
if (!st || typeof st !== 'object') return false;
|
||||
if (st.isCompactionStep) return true;
|
||||
const raw = `${st.activeModelShort ?? st.modelShort ?? ''} ${st.activeModelLabel ?? st.modelLabel ?? ''} ${st.activeModelUpstream ?? st.modelUpstream ?? ''}`;
|
||||
return /·(?:压缩|compact)(?=\s|$)|\[自动压缩\]/iu.test(raw);
|
||||
}
|
||||
|
||||
export const STEP_COLUMN_REGISTRY = Object.freeze({
|
||||
step: {
|
||||
key: 'step',
|
||||
@@ -153,21 +160,17 @@ export const STEP_COLUMN_REGISTRY = Object.freeze({
|
||||
optLabel: () => t('stepCol.model.opt'),
|
||||
sigPart: (st, ctx) => {
|
||||
const disp = resolveModelDisplayInfo(st, ctx.displaySettings, { fallback: '—' });
|
||||
return `${disp.baseText}:${disp.compactionSuffix}:${disp.title}`;
|
||||
return `${disp.baseText}:${disp.title}`;
|
||||
},
|
||||
createCell: () => {
|
||||
const nameEl = h('span', { className: 'step-model-name' });
|
||||
const compactEl = h('span', { className: 'step-model-compact', hidden: true });
|
||||
const wrapEl = h('span', { className: 'step-model-cell' }, [nameEl, compactEl]);
|
||||
const wrapEl = h('span', { className: 'step-model-cell' }, [nameEl]);
|
||||
const td = h('td', {}, [wrapEl]);
|
||||
return { td, refs: { td, wrapEl, nameEl, compactEl } };
|
||||
return { td, refs: { td, wrapEl, nameEl } };
|
||||
},
|
||||
updateCell: (refs, st, ctx) => {
|
||||
const modelDisplay = resolveModelDisplayInfo(st, ctx.displaySettings, { fallback: '—' });
|
||||
patchText(refs.nameEl, modelDisplay.baseText);
|
||||
const suffix = modelDisplay.compactionSuffix || '';
|
||||
patchText(refs.compactEl, suffix);
|
||||
patchAttr(refs.compactEl, 'hidden', !suffix);
|
||||
patchAttr(refs.td, 'title', modelDisplay.title);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
|
||||
.steps-inline-scope-select .select-menu,
|
||||
.steps-inline-model-select .select-menu {
|
||||
left: 0;
|
||||
right: auto;
|
||||
left: auto;
|
||||
right: 0;
|
||||
min-width: 220px;
|
||||
max-width: min(320px, calc(100vw - 24px));
|
||||
}
|
||||
@@ -306,7 +306,15 @@
|
||||
font-size: var(--fs-base);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
transition: background-color var(--dur-instant) var(--ease-fast);
|
||||
transition:
|
||||
background-color var(--dur-instant) var(--ease-fast),
|
||||
border-color var(--dur-instant) var(--ease-fast),
|
||||
box-shadow var(--dur-instant) var(--ease-fast);
|
||||
}
|
||||
|
||||
.select-trigger .svg-icon {
|
||||
flex-shrink: 0;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.select-trigger:hover,
|
||||
@@ -314,6 +322,27 @@
|
||||
background: var(--surface-hover);
|
||||
}
|
||||
|
||||
.form-row > .custom-select > .select-trigger {
|
||||
min-height: calc(28px * var(--ui-font-scale, 1));
|
||||
padding: 3px 12px;
|
||||
background: color-mix(in srgb, var(--text-primary) 7.5%, var(--surface-panel));
|
||||
border: none;
|
||||
border-radius: var(--radius-pill);
|
||||
}
|
||||
|
||||
.form-row > .custom-select > .select-trigger:hover {
|
||||
background: color-mix(in srgb, var(--text-primary) 11.5%, var(--surface-panel));
|
||||
}
|
||||
|
||||
.form-row > .custom-select.is-open > .select-trigger {
|
||||
background: color-mix(in srgb, var(--text-primary) 14%, var(--surface-panel));
|
||||
}
|
||||
|
||||
.form-row > .custom-select > .select-trigger:disabled {
|
||||
opacity: 0.52;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.select-label {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
--modern-surface-card: color-mix(in srgb, var(--surface-panel) 95.2%, #ffffff 4.8%);
|
||||
--modern-surface-subtle: color-mix(in srgb, var(--text-primary) 5.2%, transparent);
|
||||
--modern-surface-hover: color-mix(in srgb, var(--accent-primary) 11%, color-mix(in srgb, var(--text-primary) 4%, transparent));
|
||||
--modern-pill-select-bg: color-mix(in srgb, var(--text-primary) 8.5%, var(--modern-surface-card));
|
||||
--modern-pill-select-hover: color-mix(in srgb, var(--text-primary) 12.5%, var(--modern-surface-card));
|
||||
--modern-pill-select-open: color-mix(in srgb, var(--text-primary) 15%, var(--modern-surface-card));
|
||||
--modern-card-shadow: none;
|
||||
--modern-nav-track-bg: var(--modern-surface-card);
|
||||
--modern-inline-track-bg: color-mix(in srgb, var(--text-primary) 4.2%, transparent);
|
||||
@@ -42,6 +45,9 @@
|
||||
--modern-surface-card: #ffffff;
|
||||
--modern-surface-subtle: hsl(216 42% 97.2%);
|
||||
--modern-surface-hover: hsl(216 56% 94.4%);
|
||||
--modern-pill-select-bg: hsl(220 14% 94%);
|
||||
--modern-pill-select-hover: hsl(220 14% 90.5%);
|
||||
--modern-pill-select-open: hsl(220 14% 88.5%);
|
||||
--modern-card-shadow: 0 1px 3px rgb(15 23 42 / 0.045), 0 4px 14px rgb(15 23 42 / 0.028);
|
||||
--modern-nav-track-bg: hsl(216 28% 94.2%);
|
||||
--modern-inline-track-bg: hsl(216 32% 96.2%);
|
||||
@@ -463,11 +469,16 @@ html[data-standalone="true"][data-modern-ui="true"] .app-shell {
|
||||
border: none;
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .trend-tip-sub,
|
||||
[data-modern-ui="true"] .trend-tip-anomaly,
|
||||
[data-modern-ui="true"] .trend-tip-sub {
|
||||
background: var(--modern-surface-subtle);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .trend-tip-cost {
|
||||
background: var(--modern-surface-subtle);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .cons-pop-models {
|
||||
border-top: none;
|
||||
padding-top: 3px;
|
||||
border-top-color: var(--modern-surface-hover);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .cons-source-bar-hit:hover .cons-source-model-bar,
|
||||
@@ -525,6 +536,17 @@ html[data-standalone="true"][data-modern-ui="true"] .app-shell {
|
||||
background: var(--modern-surface-hover);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .data-table tbody tr.is-compaction,
|
||||
[data-modern-ui="true"] .data-table:not(.is-virtualized) tbody tr.is-compaction:nth-child(even),
|
||||
[data-modern-ui="true"] .data-table.is-virtualized tbody tr.is-stripe-even.is-compaction {
|
||||
background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .data-table tbody tr.is-compaction:hover,
|
||||
[data-modern-ui="true"] .data-table.is-virtualized tbody tr.is-stripe-even.is-compaction:hover {
|
||||
background: color-mix(in srgb, var(--accent-primary) 19%, transparent);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .data-table tbody tr.is-anomaly-warn,
|
||||
[data-modern-ui="true"] .data-table:not(.is-virtualized) tbody tr.is-anomaly-warn:nth-child(even),
|
||||
[data-modern-ui="true"] .data-table.is-virtualized tbody tr.is-stripe-even.is-anomaly-warn {
|
||||
@@ -547,11 +569,28 @@ html[data-standalone="true"][data-modern-ui="true"] .app-shell {
|
||||
background: color-mix(in srgb, var(--metric-danger) 21%, transparent);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .form-row > .custom-select > .select-trigger,
|
||||
[data-modern-ui="true"] .steps-inline-scope-select .select-trigger,
|
||||
[data-modern-ui="true"] .steps-inline-model-select .select-trigger,
|
||||
[data-modern-ui="true"] .sstep-fit-model-select .select-trigger {
|
||||
border: none;
|
||||
background: var(--modern-surface-subtle);
|
||||
box-shadow: none;
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--modern-pill-select-bg);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .form-row > .custom-select > .select-trigger:hover,
|
||||
[data-modern-ui="true"] .steps-inline-scope-select .select-trigger:hover,
|
||||
[data-modern-ui="true"] .steps-inline-model-select .select-trigger:hover,
|
||||
[data-modern-ui="true"] .sstep-fit-model-select .select-trigger:hover {
|
||||
background: var(--modern-pill-select-hover);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .form-row > .custom-select.is-open > .select-trigger,
|
||||
[data-modern-ui="true"] .steps-inline-scope-select.is-open .select-trigger,
|
||||
[data-modern-ui="true"] .steps-inline-model-select.is-open .select-trigger,
|
||||
[data-modern-ui="true"] .sstep-fit-model-select.is-open .select-trigger {
|
||||
background: var(--modern-pill-select-open);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .sstep-card,
|
||||
@@ -667,12 +706,12 @@ html[data-standalone="true"][data-modern-ui="true"] .app-shell {
|
||||
border: none;
|
||||
background: var(--modern-surface-card);
|
||||
box-shadow: var(--shadow-popover);
|
||||
animation: anim-modern-pop-in 150ms var(--ease-modern);
|
||||
animation: anim-modern-tip-fade 120ms var(--ease-modern);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .select-menu.is-above,
|
||||
[data-modern-ui="true"] .dt-popover.is-above {
|
||||
animation-name: anim-modern-pop-in-up;
|
||||
transform-origin: bottom right;
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .trend-tooltip,
|
||||
|
||||
@@ -211,12 +211,6 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.cons-title-model-dot {
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.cons-row-metrics {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -349,9 +343,9 @@
|
||||
left: var(--tip-x, 50%);
|
||||
transform: translateX(var(--tip-shift, -50%));
|
||||
width: max-content;
|
||||
min-width: 196px;
|
||||
max-width: min(320px, calc(100% - 8px));
|
||||
padding: 6px 10px;
|
||||
min-width: 224px;
|
||||
max-width: min(316px, calc(100% - 8px));
|
||||
padding: 9px 11px;
|
||||
background: var(--surface-panel);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-sm);
|
||||
@@ -360,27 +354,29 @@
|
||||
z-index: 25;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.trend-tip-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
font-size: var(--fs-sm);
|
||||
gap: 12px;
|
||||
font-size: var(--fs-xs);
|
||||
line-height: 1.25;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.trend-tip-time {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.trend-tip-calls {
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
max-width: 190px;
|
||||
@@ -390,36 +386,85 @@
|
||||
|
||||
.trend-tip-main {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
gap: 10px;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.trend-tip-tokens {
|
||||
font-size: var(--fs-base);
|
||||
font-size: var(--fs-lg);
|
||||
font-weight: 700;
|
||||
line-height: 1.18;
|
||||
letter-spacing: -0.02em;
|
||||
color: var(--accent-primary);
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.trend-tip-cost {
|
||||
font-size: var(--fs-md);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
padding: 2px 7px;
|
||||
border-radius: var(--radius-xs);
|
||||
color: var(--text-primary);
|
||||
background: color-mix(in srgb, var(--text-primary) 6%, transparent);
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.trend-tip-cost:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.trend-tip-sub {
|
||||
padding: 5px 8px;
|
||||
border: none;
|
||||
border-radius: var(--radius-xs);
|
||||
background: color-mix(in srgb, var(--text-primary) 4.2%, transparent);
|
||||
font-size: var(--fs-xs);
|
||||
line-height: 1.3;
|
||||
color: var(--text-secondary);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
border-top: 1px solid var(--border-hairline);
|
||||
padding-top: 2px;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.trend-tip-sub[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.trend-tip-sub.is-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
padding: 6px 8px;
|
||||
white-space: normal;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.trend-tip-stat {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.trend-tip-stat-label {
|
||||
font-size: var(--fs-2xs);
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.trend-tip-stat-val {
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
color: var(--text-primary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.trend-tooltip.is-line-low {
|
||||
@@ -807,9 +852,9 @@
|
||||
left: var(--pop-x, 8px);
|
||||
top: var(--pop-y, 8px);
|
||||
width: max-content;
|
||||
min-width: 196px;
|
||||
max-width: min(310px, calc(100% - 16px));
|
||||
padding: 6px 10px;
|
||||
min-width: 224px;
|
||||
max-width: min(316px, calc(100% - 16px));
|
||||
padding: 9px 11px;
|
||||
background: var(--surface-panel);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-sm);
|
||||
@@ -818,24 +863,34 @@
|
||||
z-index: 30;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.cons-pop-models {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
border-top: 1px solid var(--border-hairline);
|
||||
padding-top: 4px;
|
||||
margin-top: 2px;
|
||||
gap: 4px;
|
||||
border-top: 1px solid color-mix(in srgb, var(--border-hairline) 75%, transparent);
|
||||
padding-top: 6px;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.cons-pop-models[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.trend-tip-sub:not([hidden]) + .cons-pop-models {
|
||||
border-top: none;
|
||||
padding-top: 1px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.cons-pop-model-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
font-size: var(--fs-sm);
|
||||
gap: 10px;
|
||||
font-size: var(--fs-xs);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
@@ -849,6 +904,7 @@
|
||||
|
||||
.cons-pop-model-name {
|
||||
max-width: 156px;
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@@ -871,10 +927,11 @@
|
||||
}
|
||||
|
||||
.cons-pop-model-pct {
|
||||
min-width: 40px;
|
||||
min-width: 38px;
|
||||
text-align: right;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
/* --- 6. 12 个月垂直堆叠柱状图 (12-Month Stacked Bar Chart) --- */
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
background: var(--surface-panel);
|
||||
}
|
||||
|
||||
.panel > .table-scroll-host {
|
||||
margin-right: calc(-1 * var(--space-5) + 2px);
|
||||
}
|
||||
|
||||
.panel > .table-scroll-host > .custom-scroll-content {
|
||||
padding-right: calc(var(--space-5) - 2px);
|
||||
}
|
||||
|
||||
.table-viewport {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
@@ -127,57 +135,69 @@
|
||||
flex: 0 1 auto;
|
||||
}
|
||||
|
||||
.step-model-compact {
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
color: var(--accent-primary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.step-model-compact[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.steps-panel-header {
|
||||
flex-wrap: wrap;
|
||||
row-gap: 6px;
|
||||
}
|
||||
|
||||
.steps-panel-title {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.steps-header-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 6px;
|
||||
flex: 1 1 280px;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px 8px;
|
||||
flex: 1 1 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.steps-header-controls .segmented {
|
||||
flex-shrink: 0;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.steps-header-filters {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 6px;
|
||||
margin-left: auto;
|
||||
flex: 1 1 156px;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.steps-header-filters[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.steps-inline-scope-select,
|
||||
.steps-inline-model-select {
|
||||
flex: 0 1 165px;
|
||||
min-width: 72px;
|
||||
max-width: 175px;
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
max-width: 148px;
|
||||
}
|
||||
|
||||
.steps-inline-scope-select .select-trigger,
|
||||
.steps-inline-model-select .select-trigger {
|
||||
min-height: calc(22px * var(--ui-font-scale, 1));
|
||||
min-height: calc(25px * var(--ui-font-scale, 1));
|
||||
height: auto;
|
||||
padding: 2px 6px;
|
||||
gap: 4px;
|
||||
padding: 2px 10px;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
font-size: var(--fs-md);
|
||||
border: 1px solid var(--border-hairline);
|
||||
background: var(--surface-subtle);
|
||||
border: none;
|
||||
border-radius: var(--radius-pill);
|
||||
background: color-mix(in srgb, var(--text-primary) 7.5%, var(--surface-panel));
|
||||
}
|
||||
|
||||
.steps-inline-scope-select .select-trigger:hover,
|
||||
.steps-inline-model-select .select-trigger:hover {
|
||||
background: color-mix(in srgb, var(--text-primary) 11.5%, var(--surface-panel));
|
||||
}
|
||||
|
||||
.steps-inline-scope-select.is-open .select-trigger,
|
||||
.steps-inline-model-select.is-open .select-trigger {
|
||||
background: color-mix(in srgb, var(--text-primary) 14%, var(--surface-panel));
|
||||
}
|
||||
|
||||
/* --- 2.5 极简对话轮次导轨与起点圆点 (Minimalist Turn Rail & Prompt Preview) --- */
|
||||
@@ -295,7 +315,24 @@
|
||||
animation: anim-popover-in var(--dur-instant) var(--ease-fast);
|
||||
}
|
||||
|
||||
/* --- 2.6 单步异常整行语义着色、模型汇总微标、筛选条与悬停诊断卡 --- */
|
||||
/* --- 2.6 单步压缩 / 异常整行语义着色、模型汇总微标、筛选条与悬停诊断卡 --- */
|
||||
.data-table tbody tr.is-compaction {
|
||||
background: color-mix(in srgb, var(--accent-primary) 11%, transparent);
|
||||
}
|
||||
|
||||
.data-table tbody tr.is-compaction:hover {
|
||||
background: color-mix(in srgb, var(--accent-primary) 18%, transparent);
|
||||
}
|
||||
|
||||
.data-table tbody tr.is-compaction td:first-child {
|
||||
box-shadow: inset 2px 0 0 var(--accent-primary);
|
||||
}
|
||||
|
||||
.data-table tbody tr.is-compaction td:first-child > span:not(.agent-badge):not(.turn-rail) {
|
||||
color: var(--accent-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.data-table tbody tr.is-anomaly-warn {
|
||||
background: color-mix(in srgb, var(--metric-warn) 11%, transparent);
|
||||
}
|
||||
@@ -399,6 +436,10 @@
|
||||
border-color: color-mix(in srgb, var(--metric-danger) 46%, var(--border-strong));
|
||||
}
|
||||
|
||||
.step-anomaly-tip.is-compaction {
|
||||
border-color: color-mix(in srgb, var(--accent-primary) 46%, var(--border-strong));
|
||||
}
|
||||
|
||||
.step-anomaly-tip[hidden],
|
||||
.step-anomaly-tip-sub[hidden],
|
||||
.step-anomaly-tip-list[hidden],
|
||||
@@ -423,6 +464,10 @@
|
||||
color: var(--metric-danger);
|
||||
}
|
||||
|
||||
.step-anomaly-tip.is-compaction .step-anomaly-tip-title {
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
.step-anomaly-tip-sub {
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--text-secondary);
|
||||
@@ -542,7 +587,9 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-3) 0 2px;
|
||||
padding-top: var(--space-3);
|
||||
padding-bottom: 2px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.sstep-card {
|
||||
@@ -599,15 +646,24 @@
|
||||
}
|
||||
|
||||
.sstep-fit-model-select .select-trigger {
|
||||
min-height: calc(22px * var(--ui-font-scale, 1));
|
||||
min-height: calc(24px * var(--ui-font-scale, 1));
|
||||
height: auto;
|
||||
padding: 2px 6px;
|
||||
gap: 4px;
|
||||
padding: 2px 10px;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
font-size: var(--fs-sm);
|
||||
border: 1px solid var(--border-hairline);
|
||||
background: var(--surface-subtle);
|
||||
border: none;
|
||||
border-radius: var(--radius-pill);
|
||||
background: color-mix(in srgb, var(--text-primary) 7.5%, var(--surface-panel));
|
||||
}
|
||||
|
||||
.sstep-fit-model-select .select-trigger:hover {
|
||||
background: color-mix(in srgb, var(--text-primary) 11.5%, var(--surface-panel));
|
||||
}
|
||||
|
||||
.sstep-fit-model-select.is-open .select-trigger {
|
||||
background: color-mix(in srgb, var(--text-primary) 14%, var(--surface-panel));
|
||||
}
|
||||
|
||||
.sstep-chart-wrap {
|
||||
@@ -783,9 +839,11 @@
|
||||
}
|
||||
|
||||
.trend-tip-anomaly {
|
||||
margin-top: 3px;
|
||||
padding-top: 3px;
|
||||
border-top: 1px solid var(--border-hairline);
|
||||
margin-top: 0;
|
||||
padding: 4px 8px;
|
||||
border: none;
|
||||
border-radius: var(--radius-xs);
|
||||
background: color-mix(in srgb, var(--metric-warn) 11%, transparent);
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 600;
|
||||
color: var(--metric-warn);
|
||||
@@ -794,6 +852,7 @@
|
||||
|
||||
.trend-tip-anomaly.is-danger {
|
||||
color: var(--metric-danger);
|
||||
background: color-mix(in srgb, var(--metric-danger) 12%, transparent);
|
||||
}
|
||||
|
||||
.trend-tip-anomaly[hidden] {
|
||||
|
||||
@@ -586,12 +586,11 @@ export const ConsumptionView = defineComponent({
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建热门模型单行 DOM 结构(模型名称后附专属颜色圆点 + 按总占比缩放的 4 段比例条 + 底部分项脚标)。
|
||||
* 创建热门模型单行 DOM 结构(模型名称 + 按总占比缩放的 4 段比例条 + 底部分项脚标)。
|
||||
*/
|
||||
function createBreakdownItemRow() {
|
||||
const nameTextEl = h('span', { className: 'cons-row-title-text' });
|
||||
const modelDotEl = h('span', { className: 'dot-swatch cons-model-dot cons-title-model-dot' });
|
||||
const nameEl = h('strong', { className: 'cons-row-title' }, [nameTextEl, modelDotEl]);
|
||||
const nameEl = h('strong', { className: 'cons-row-title' }, [nameTextEl]);
|
||||
const pctBadge = h('span', { className: 'cons-share-pill text-mono', text: '0%' });
|
||||
const totalTokEl = h('span', { className: 'cons-row-tok text-mono' });
|
||||
const costEl = h('strong', { className: 'cons-row-cost text-mono' });
|
||||
@@ -652,7 +651,6 @@ export const ConsumptionView = defineComponent({
|
||||
refs: {
|
||||
nameEl,
|
||||
nameTextEl,
|
||||
modelDotEl,
|
||||
pctBadge,
|
||||
totalTokEl,
|
||||
costEl,
|
||||
@@ -672,9 +670,9 @@ export const ConsumptionView = defineComponent({
|
||||
}
|
||||
|
||||
/**
|
||||
* 增量更新热门模型单行的指标文本、名称后的专属颜色圆点与按总占比缩放的 4 段比例条宽度。
|
||||
* 增量更新热门模型单行的指标文本与按总占比缩放的 4 段比例条宽度。
|
||||
*/
|
||||
function updateBreakdownItemRow(refs, item, grandTotalTokens, modelColor = '') {
|
||||
function updateBreakdownItemRow(refs, item, grandTotalTokens) {
|
||||
patchText(refs.inLbl, t('cons.footInput'));
|
||||
patchText(refs.cacheLbl, t('cons.footCache'));
|
||||
patchText(refs.outLbl, t('cons.footOutput'));
|
||||
@@ -683,10 +681,6 @@ export const ConsumptionView = defineComponent({
|
||||
const displayLabel = item.label || item.name || item.shortName || '—';
|
||||
patchText(refs.nameTextEl, displayLabel);
|
||||
patchAttr(refs.nameEl, 'title', item.title || displayLabel);
|
||||
patchAttr(refs.modelDotEl, 'hidden', !modelColor);
|
||||
if (modelColor) {
|
||||
patchStyleVar(refs.modelDotEl, '--dot-color', modelColor);
|
||||
}
|
||||
const total = Number(item.totalTokens || 0);
|
||||
const share = grandTotalTokens > 0 ? +((total / grandTotalTokens) * 100).toFixed(1) : 0;
|
||||
const scaleRatio =
|
||||
@@ -1169,23 +1163,17 @@ export const ConsumptionView = defineComponent({
|
||||
});
|
||||
trendChart.update(enrichedTrendSeries);
|
||||
|
||||
// 3. 同步热门模型列表(名称后带专属颜色圆点 + 4 段条按总占比缩放长度)
|
||||
// 3. 同步热门模型列表(4 段条按总占比缩放长度)
|
||||
patchKeyedList(modelsListEl, models, {
|
||||
keyFn: (m) => m.displayText || m.label || m.shortName,
|
||||
sigFn: (m) => {
|
||||
const seed = getCanonicalModelColorSeed(m);
|
||||
const color = modelColorMap.get(seed) || resolveDeterministicModelColor(seed);
|
||||
return `${localeSig}:${m.displayText}:${m.displayTitle}:${color}:${m.totalTokens}:${m.inputTokens}:${m.cacheReadTokens}:${m.responseTokens}:${m.thinkingTokens}:${m.costUsd}:${m.unpricedCalls}:${m.calls}:${modelsTotalTok}`;
|
||||
},
|
||||
sigFn: (m) =>
|
||||
`${localeSig}:${m.displayText}:${m.displayTitle}:${m.totalTokens}:${m.inputTokens}:${m.cacheReadTokens}:${m.responseTokens}:${m.thinkingTokens}:${m.costUsd}:${m.unpricedCalls}:${m.calls}:${modelsTotalTok}`,
|
||||
createRow: createBreakdownItemRow,
|
||||
updateRow: (refs, m) => {
|
||||
const seed = getCanonicalModelColorSeed(m);
|
||||
const color = modelColorMap.get(seed) || resolveDeterministicModelColor(seed);
|
||||
updateBreakdownItemRow(
|
||||
refs,
|
||||
{ ...m, label: m.displayText, title: m.displayTitle },
|
||||
modelsTotalTok,
|
||||
color
|
||||
modelsTotalTok
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -27,7 +27,6 @@ import {
|
||||
resolveModelAnomalySummary,
|
||||
resolveModelDisplayInfo,
|
||||
} from '../core/formatters.js';
|
||||
import { createSvgIcon } from '../icons/SvgIcon.js';
|
||||
import { getEffectiveLocale, i18nStore, t } from '../i18n/index.js';
|
||||
import {
|
||||
formatAgentLabel,
|
||||
@@ -477,7 +476,11 @@ export const StepsDetailView = defineComponent({
|
||||
});
|
||||
modelsScroll.el.setAttribute('hidden', '');
|
||||
|
||||
const panelTitleTextEl = h('span', { text: t('steps.title') });
|
||||
const headerFiltersEl = h('div', { className: 'steps-header-filters', hidden: true }, [
|
||||
inlineScopeSelect.el,
|
||||
stepsModelSelect.el,
|
||||
]);
|
||||
|
||||
const panelEl = h(
|
||||
'section',
|
||||
{
|
||||
@@ -486,14 +489,9 @@ export const StepsDetailView = defineComponent({
|
||||
},
|
||||
[
|
||||
h('div', { className: 'panel-header steps-panel-header' }, [
|
||||
h('span', { className: 'panel-title steps-panel-title' }, [
|
||||
createSvgIcon('table', { size: 13 }),
|
||||
panelTitleTextEl,
|
||||
]),
|
||||
h('div', { className: 'steps-header-controls' }, [
|
||||
inlineScopeSelect.el,
|
||||
stepsModelSelect.el,
|
||||
subTabSwitch.el,
|
||||
headerFiltersEl,
|
||||
]),
|
||||
]),
|
||||
anomalyFilterBarEl,
|
||||
@@ -566,7 +564,6 @@ export const StepsDetailView = defineComponent({
|
||||
}
|
||||
|
||||
function refreshStaticLocaleLabels() {
|
||||
patchText(panelTitleTextEl, t('steps.title'));
|
||||
patchText(lineTitleEl, t('steps.lineTitle'));
|
||||
patchText(fitTitleEl, t('steps.fitTitle'));
|
||||
patchText(modelsSectionTitleEl, t('steps.modelsTitle'));
|
||||
@@ -786,6 +783,7 @@ export const StepsDetailView = defineComponent({
|
||||
);
|
||||
const showStepsModelFilter = uiSt.stepsSubTab === 'steps' && hasMultipleModels;
|
||||
patchAttr(stepsModelSelect.el, 'hidden', !showStepsModelFilter);
|
||||
patchAttr(headerFiltersEl, 'hidden', !hasSubagents && !showStepsModelFilter);
|
||||
if (hasMultipleModels) {
|
||||
stepsModelSelect.setProps({
|
||||
modelValue: selectedTableModels,
|
||||
|
||||
Reference in New Issue
Block a user