mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
fix(panel): remove 0.9x zoom distortion on structure previews and align capsule font/mock schema
This commit is contained in:
+11
-5
@@ -12237,10 +12237,12 @@ function buildStructurePreviewTelemetry(baseSettings = {}, draftOverrides = {})
|
||||
isRunning: true,
|
||||
stepCount: 16,
|
||||
speedSampleCount: 15,
|
||||
speedSummary: { sampleCount: 15, excludedCount: 1 },
|
||||
latestTokPerSec: 68.4,
|
||||
avgTokPerSec: 54.8,
|
||||
latestTtftSec: 1.15,
|
||||
avgTtftSec: 1.62,
|
||||
ttftSummary: { avgSec: 1.62, sampleCount: 15 },
|
||||
latestStepCostUsd: 0.042,
|
||||
sessionCostUsd: 1.16,
|
||||
latestCacheHitPct: 94.5,
|
||||
@@ -12271,10 +12273,12 @@ function buildStructurePreviewTelemetry(baseSettings = {}, draftOverrides = {})
|
||||
isRunning: false,
|
||||
stepCount: 8,
|
||||
speedSampleCount: 8,
|
||||
speedSummary: { sampleCount: 8, excludedCount: 0 },
|
||||
latestTokPerSec: 96.2,
|
||||
avgTokPerSec: 88.5,
|
||||
latestTtftSec: 0.68,
|
||||
avgTtftSec: 0.82,
|
||||
ttftSummary: { avgSec: 0.82, sampleCount: 8 },
|
||||
latestStepCostUsd: 0.009,
|
||||
sessionCostUsd: 0.12,
|
||||
latestCacheHitPct: 88.1,
|
||||
@@ -12298,8 +12302,10 @@ function buildStructurePreviewTelemetry(baseSettings = {}, draftOverrides = {})
|
||||
...mainAgent,
|
||||
stepCount: 24,
|
||||
speedSampleCount: 23,
|
||||
speedSummary: { sampleCount: 23, excludedCount: 1 },
|
||||
avgTokPerSec: 59.6,
|
||||
avgTtftSec: 1.38,
|
||||
ttftSummary: { avgSec: 1.38, sampleCount: 23 },
|
||||
sessionCostUsd: 1.28,
|
||||
sessionCacheHitPct: 88.9,
|
||||
inputTokens: 186400,
|
||||
@@ -12313,8 +12319,9 @@ function buildStructurePreviewTelemetry(baseSettings = {}, draftOverrides = {})
|
||||
return {
|
||||
settings: mergedSettings,
|
||||
account: {
|
||||
planName: 'Google AI Pro',
|
||||
aiCredits: 1200,
|
||||
tierName: 'Google AI Ultra',
|
||||
planName: 'Pro',
|
||||
aiCredits: 0,
|
||||
},
|
||||
quotas: {
|
||||
activePool: {
|
||||
@@ -14007,7 +14014,7 @@ const SettingsStructureTab = defineComponent({
|
||||
isVisibleFn: () => isStructureVisible() && activeThirdTab === 'hover',
|
||||
initialModuleKeys: [],
|
||||
});
|
||||
const hoverPreviewCanvas = h('div', { className: 'structure-preview-canvas is-scaled' }, [
|
||||
const hoverPreviewCanvas = h('div', { className: 'structure-preview-canvas' }, [
|
||||
hoverPreviewTipEl,
|
||||
hoverPreviewEmptyEl,
|
||||
]);
|
||||
@@ -14099,7 +14106,7 @@ const SettingsStructureTab = defineComponent({
|
||||
isVisibleFn: () => isStructureVisible() && activeThirdTab === 'overview',
|
||||
initialModuleKeys: [],
|
||||
});
|
||||
const overviewPreviewCanvas = h('div', { className: 'structure-preview-canvas is-scaled' }, [
|
||||
const overviewPreviewCanvas = h('div', { className: 'structure-preview-canvas' }, [
|
||||
overviewPreviewContainerEl,
|
||||
]);
|
||||
|
||||
@@ -15796,7 +15803,6 @@ const LiveOverviewView = defineComponent({
|
||||
setup({ onCleanup }) {
|
||||
const overviewInner = h('div', {
|
||||
className: 'overview-modules-host',
|
||||
style: 'display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: 2px;',
|
||||
});
|
||||
|
||||
const widgetHost = createDynamicWidgetHost({
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>用量监控</title>
|
||||
<link rel="stylesheet" href="/styles.css?v=1794974101279">
|
||||
<link rel="stylesheet" href="/styles.css?v=1794975028421">
|
||||
<script src="/preload.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app-root"></div>
|
||||
<script src="/app.js?v=1794974101279"></script>
|
||||
<script src="/app.js?v=1794975028421"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -220,10 +220,12 @@ export function buildStructurePreviewTelemetry(baseSettings = {}, draftOverrides
|
||||
isRunning: true,
|
||||
stepCount: 16,
|
||||
speedSampleCount: 15,
|
||||
speedSummary: { sampleCount: 15, excludedCount: 1 },
|
||||
latestTokPerSec: 68.4,
|
||||
avgTokPerSec: 54.8,
|
||||
latestTtftSec: 1.15,
|
||||
avgTtftSec: 1.62,
|
||||
ttftSummary: { avgSec: 1.62, sampleCount: 15 },
|
||||
latestStepCostUsd: 0.042,
|
||||
sessionCostUsd: 1.16,
|
||||
latestCacheHitPct: 94.5,
|
||||
@@ -254,10 +256,12 @@ export function buildStructurePreviewTelemetry(baseSettings = {}, draftOverrides
|
||||
isRunning: false,
|
||||
stepCount: 8,
|
||||
speedSampleCount: 8,
|
||||
speedSummary: { sampleCount: 8, excludedCount: 0 },
|
||||
latestTokPerSec: 96.2,
|
||||
avgTokPerSec: 88.5,
|
||||
latestTtftSec: 0.68,
|
||||
avgTtftSec: 0.82,
|
||||
ttftSummary: { avgSec: 0.82, sampleCount: 8 },
|
||||
latestStepCostUsd: 0.009,
|
||||
sessionCostUsd: 0.12,
|
||||
latestCacheHitPct: 88.1,
|
||||
@@ -281,8 +285,10 @@ export function buildStructurePreviewTelemetry(baseSettings = {}, draftOverrides
|
||||
...mainAgent,
|
||||
stepCount: 24,
|
||||
speedSampleCount: 23,
|
||||
speedSummary: { sampleCount: 23, excludedCount: 1 },
|
||||
avgTokPerSec: 59.6,
|
||||
avgTtftSec: 1.38,
|
||||
ttftSummary: { avgSec: 1.38, sampleCount: 23 },
|
||||
sessionCostUsd: 1.28,
|
||||
sessionCacheHitPct: 88.9,
|
||||
inputTokens: 186400,
|
||||
@@ -296,8 +302,9 @@ export function buildStructurePreviewTelemetry(baseSettings = {}, draftOverrides
|
||||
return {
|
||||
settings: mergedSettings,
|
||||
account: {
|
||||
planName: 'Google AI Pro',
|
||||
aiCredits: 1200,
|
||||
tierName: 'Google AI Ultra',
|
||||
planName: 'Pro',
|
||||
aiCredits: 0,
|
||||
},
|
||||
quotas: {
|
||||
activePool: {
|
||||
|
||||
@@ -94,6 +94,14 @@
|
||||
}
|
||||
|
||||
/* --- 2. 多任务实时运行卡片列表与 4 格测速指标矩阵 (Live Running Tasks List & 4-Cell Telemetry Matrix) --- */
|
||||
.overview-modules-host {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
min-width: 0;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.live-activity-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -230,19 +230,15 @@
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* --- 结构页真实 UI 实时预览画布(无套娃外框,直接呈现真实组件) --- */
|
||||
/* --- 结构页真实 UI 实时预览画布(1:1 零缩放、零套娃外框,直接呈现真实组件) --- */
|
||||
.structure-preview-canvas {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
gap: var(--space-3);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.structure-preview-canvas.is-scaled {
|
||||
zoom: 0.9;
|
||||
}
|
||||
|
||||
.wm-hover-tip.is-preview {
|
||||
position: relative;
|
||||
top: auto;
|
||||
@@ -260,10 +256,7 @@
|
||||
}
|
||||
|
||||
.overview-modules-host.is-preview {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
min-width: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.structure-preview-empty,
|
||||
@@ -296,6 +289,10 @@
|
||||
background: var(--surface-bg);
|
||||
border: 1px solid var(--border-hairline);
|
||||
border-radius: var(--radius-xs);
|
||||
font-family: "Google Sans Flex", "Google Sans", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
||||
font-variant-numeric: tabular-nums;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
overflow-x: auto;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ export const LiveOverviewView = defineComponent({
|
||||
setup({ onCleanup }) {
|
||||
const overviewInner = h('div', {
|
||||
className: 'overview-modules-host',
|
||||
style: 'display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: 2px;',
|
||||
});
|
||||
|
||||
const widgetHost = createDynamicWidgetHost({
|
||||
|
||||
@@ -449,7 +449,7 @@ export const SettingsStructureTab = defineComponent({
|
||||
isVisibleFn: () => isStructureVisible() && activeThirdTab === 'hover',
|
||||
initialModuleKeys: [],
|
||||
});
|
||||
const hoverPreviewCanvas = h('div', { className: 'structure-preview-canvas is-scaled' }, [
|
||||
const hoverPreviewCanvas = h('div', { className: 'structure-preview-canvas' }, [
|
||||
hoverPreviewTipEl,
|
||||
hoverPreviewEmptyEl,
|
||||
]);
|
||||
@@ -541,7 +541,7 @@ export const SettingsStructureTab = defineComponent({
|
||||
isVisibleFn: () => isStructureVisible() && activeThirdTab === 'overview',
|
||||
initialModuleKeys: [],
|
||||
});
|
||||
const overviewPreviewCanvas = h('div', { className: 'structure-preview-canvas is-scaled' }, [
|
||||
const overviewPreviewCanvas = h('div', { className: 'structure-preview-canvas' }, [
|
||||
overviewPreviewContainerEl,
|
||||
]);
|
||||
|
||||
|
||||
+15
-10
@@ -1341,6 +1341,14 @@ html[data-standalone="true"] .app-shell {
|
||||
}
|
||||
|
||||
/* --- 2. 多任务实时运行卡片列表与 4 格测速指标矩阵 (Live Running Tasks List & 4-Cell Telemetry Matrix) --- */
|
||||
.overview-modules-host {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
min-width: 0;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.live-activity-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -3584,19 +3592,15 @@ html[data-standalone="true"] .app-shell {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* --- 结构页真实 UI 实时预览画布(无套娃外框,直接呈现真实组件) --- */
|
||||
/* --- 结构页真实 UI 实时预览画布(1:1 零缩放、零套娃外框,直接呈现真实组件) --- */
|
||||
.structure-preview-canvas {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
gap: var(--space-3);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.structure-preview-canvas.is-scaled {
|
||||
zoom: 0.9;
|
||||
}
|
||||
|
||||
.wm-hover-tip.is-preview {
|
||||
position: relative;
|
||||
top: auto;
|
||||
@@ -3614,10 +3618,7 @@ html[data-standalone="true"] .app-shell {
|
||||
}
|
||||
|
||||
.overview-modules-host.is-preview {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
min-width: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.structure-preview-empty,
|
||||
@@ -3650,6 +3651,10 @@ html[data-standalone="true"] .app-shell {
|
||||
background: var(--surface-bg);
|
||||
border: 1px solid var(--border-hairline);
|
||||
border-radius: var(--radius-xs);
|
||||
font-family: "Google Sans Flex", "Google Sans", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
||||
font-variant-numeric: tabular-nums;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
overflow-x: auto;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@@ -818,4 +818,6 @@ test('post-compaction context preserves static channels + checkpoint summary, ca
|
||||
assert.match(stylesCss, /\.long-pill-nav\s*\{[^}]*container-type:\s*inline-size;[^}]*minmax\(0,\s*1fr\)[^}]*overflow:\s*hidden;/s);
|
||||
assert.match(stylesCss, /\.pill-tab\s*\{[^}]*min-width:\s*0;/s);
|
||||
assert.match(stylesCss, /@container\s*\(max-width:\s*30em\)\s*\{[\s\S]*?\.pill-tab-badge\s*\{\s*display:\s*none\s*!important;/);
|
||||
assert.doesNotMatch(stylesCss, /\.structure-preview-canvas[^{]*\{[^}]*zoom:/, 'Structure preview must stay 1:1 without zoom distortion');
|
||||
assert.match(stylesCss, /\.preview-capsule-bar\s*\{[^}]*"Google Sans Flex"/s);
|
||||
});
|
||||
|
||||
@@ -1943,6 +1943,21 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
||||
assert.equal(sec2.hasAttribute('hidden'), false);
|
||||
const overviewPreviewHostEl = sec2.querySelector('.overview-modules-host');
|
||||
assert.equal(overviewPreviewHostEl.children.length, 4, 'Overview preview mounts all 4 real overview widgets');
|
||||
assert.equal(
|
||||
sec2.querySelector('.structure-preview-canvas').classList.contains('is-scaled'),
|
||||
false,
|
||||
'Overview preview canvas renders 1:1 without zoom scaling'
|
||||
);
|
||||
const previewCellSubs = Array.from(overviewPreviewHostEl.children[0].querySelectorAll('.cell-sub')).map(
|
||||
(el) => el.textContent
|
||||
);
|
||||
assert.ok(previewCellSubs.includes('均值 1.4s'), 'Preview TTFT card shows populated mean TTFT');
|
||||
assert.ok(previewCellSubs.includes('有效 23/24 步'), 'Preview Avg TPS card shows populated valid sample ratio');
|
||||
assert.equal(
|
||||
overviewPreviewHostEl.children[2].querySelector('.panel-meta').textContent,
|
||||
'Google AI Ultra · Pro',
|
||||
'Preview quota badge matches real tier · plan format'
|
||||
);
|
||||
|
||||
const [ovModWrap, ovMetricWrap] = sec2.querySelectorAll('.editable-slot-wrap');
|
||||
// Move row 2 ('quotas') up above 'context' -> ['metrics', 'quotas', 'context', 'live_tasks']
|
||||
|
||||
Reference in New Issue
Block a user