mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
feat(panel): add inline CLI statusLine capsule, step speed color toggle, and refined defaults
- Auto-provision native Antigravity CLI `statusLine` (`stack_with_default: false`) in `~/.gemini/antigravity-cli/settings.json` while strictly preserving custom third-party `statusLine.command` scripts, using zero-double-quote Windows commands compatible with Go `syscall.EscapeArg` under `cmd /c` - Add `cli-statusline.mjs` and `cli-statusline-config.mjs` to render a single-line transparent 24-bit ANSI footer (`? for shortcuts` left, live multi-session & 1..5 capsule metrics centered, deduplicated `mode · model · effort` right) with responsive narrow-terminal fallbacks and `stdin` quota fallback - Persist `cli-status-snapshot.json` during telemetry builds and self-heal sidecar restarts inside `executeTelemetryAction` error paths when `computeRuntimeCodeVersion()` advances - Add `enableCliStatusLine` and `showStepSpeedColor` preferences in Settings -> Structure, rename the mount sub-tab/section label in `zh-CN` to `挂载胶囊`, set default `topbarCapsuleSlots` to `['tps', 'ttft', 'context']`, and default `showStepTurnRail` and `showStepSpeedColor` to `false` - Add unit and end-to-end tests across `backend.test.mjs` and `window-bridge.test.mjs`, and update `README.md` / `README.zh-CN.md`
This commit is contained in:
@@ -1191,9 +1191,9 @@ export function mountWindowOverlay() {
|
||||
|
||||
// 构建可复用的预占胶囊槽位节点(由 CapsuleBarWidget 共享创建,支持 1..5 项动态槽位)
|
||||
const capsuleSlots = [
|
||||
createCapsuleSlotNode(0, 'context'),
|
||||
createCapsuleSlotNode(1, 'tps'),
|
||||
createCapsuleSlotNode(2, 'quota_auto'),
|
||||
createCapsuleSlotNode(0, 'tps'),
|
||||
createCapsuleSlotNode(1, 'ttft'),
|
||||
createCapsuleSlotNode(2, 'context'),
|
||||
createCapsuleSlotNode(3, 'none'),
|
||||
createCapsuleSlotNode(4, 'none'),
|
||||
];
|
||||
|
||||
@@ -54,7 +54,9 @@ export function createCapsuleSlotNode(slotIndex, initialMetric) {
|
||||
? '--%'
|
||||
: initialMetric === 'tps'
|
||||
? '-- t/s'
|
||||
: t('capsule.quotaUnknown'),
|
||||
: initialMetric === 'ttft'
|
||||
? '--s'
|
||||
: t('capsule.quotaUnknown'),
|
||||
});
|
||||
const el = h(
|
||||
'span',
|
||||
@@ -65,7 +67,9 @@ export function createCapsuleSlotNode(slotIndex, initialMetric) {
|
||||
? 'wm-cap-slot wm-ctx-seg'
|
||||
: initialMetric === 'tps'
|
||||
? 'wm-cap-slot wm-seg-speed'
|
||||
: 'wm-cap-slot wm-seg-quota',
|
||||
: initialMetric === 'ttft'
|
||||
? 'wm-cap-slot wm-seg-metric'
|
||||
: 'wm-cap-slot wm-seg-quota',
|
||||
hidden: isNone,
|
||||
'data-slot-idx': String(slotIndex),
|
||||
'data-metric': initialMetric,
|
||||
@@ -160,9 +164,9 @@ export const CapsuleBarWidget = defineComponent({
|
||||
);
|
||||
|
||||
const capsuleSlots = [
|
||||
createCapsuleSlotNode(0, 'context'),
|
||||
createCapsuleSlotNode(1, 'tps'),
|
||||
createCapsuleSlotNode(2, 'quota_auto'),
|
||||
createCapsuleSlotNode(0, 'tps'),
|
||||
createCapsuleSlotNode(1, 'ttft'),
|
||||
createCapsuleSlotNode(2, 'context'),
|
||||
createCapsuleSlotNode(3, 'none'),
|
||||
createCapsuleSlotNode(4, 'none'),
|
||||
];
|
||||
|
||||
@@ -166,15 +166,16 @@ export const StepTableWidget = defineComponent({
|
||||
effectiveScopes = ['all'],
|
||||
hasSubagents = false,
|
||||
isMergedMultiAgents = false,
|
||||
showStepTurnRail = true,
|
||||
showStepTurnRail = false,
|
||||
showStepAgentBadge = true,
|
||||
showStepSpeedColor = false,
|
||||
displaySettings = {},
|
||||
} = {}
|
||||
) {
|
||||
const colOrderSig = colKeys.join(',');
|
||||
const renderOptions = JSON.stringify([
|
||||
cascadeId, locale, colOrderSig, effectiveScopes, hasSubagents, isMergedMultiAgents,
|
||||
showStepTurnRail, showStepAgentBadge, displaySettings.showUpstreamModel,
|
||||
showStepTurnRail, showStepAgentBadge, showStepSpeedColor, displaySettings.showUpstreamModel,
|
||||
displaySettings.orchestratorIdMode,
|
||||
]);
|
||||
if (lastRenderOptions === renderOptions && lastRenderedRows &&
|
||||
@@ -189,6 +190,7 @@ export const StepTableWidget = defineComponent({
|
||||
const cellCtx = {
|
||||
hasSubagents,
|
||||
showAgentBadge,
|
||||
showStepSpeedColor,
|
||||
effectiveScopes,
|
||||
scopeSigKey: effectiveScopes.join(','),
|
||||
displaySettings,
|
||||
|
||||
Reference in New Issue
Block a user