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:
fish
2026-11-16 14:00:05 +09:00
parent 76669d5cc7
commit cd841b55cf
23 changed files with 2478 additions and 125 deletions
+14 -2
View File
@@ -122,7 +122,7 @@ export const CLIENT_TOPBAR_SLOT_KEYS = Object.freeze([
'claude_weekly',
]);
export const DEFAULT_CLIENT_TOPBAR_SLOTS = Object.freeze(['context', 'tps', 'quota_auto']);
export const DEFAULT_CLIENT_TOPBAR_SLOTS = Object.freeze(['tps', 'ttft', 'context']);
export const CLIENT_OVERVIEW_MODULE_KEYS = Object.freeze([
'metrics',
@@ -380,15 +380,21 @@ function isEquivalentTelemetry(prev, next) {
return false;
}
if (pSet?.enableWindowOverlay !== nSet?.enableWindowOverlay) return false;
if ((pSet?.enableCliStatusLine !== false) !== (nSet?.enableCliStatusLine !== false)) {
return false;
}
if ((pSet?.showTopbarMultiSession !== false) !== (nSet?.showTopbarMultiSession !== false)) {
return false;
}
if ((pSet?.showStepTurnRail !== false) !== (nSet?.showStepTurnRail !== false)) {
if (Boolean(pSet?.showStepTurnRail) !== Boolean(nSet?.showStepTurnRail)) {
return false;
}
if ((pSet?.showStepAgentBadge !== false) !== (nSet?.showStepAgentBadge !== false)) {
return false;
}
if (Boolean(pSet?.showStepSpeedColor) !== Boolean(nSet?.showStepSpeedColor)) {
return false;
}
if (!sameArr(pSet?.topbarCapsuleSlots, nSet?.topbarCapsuleSlots)) return false;
if (!sameArr(pSet?.hoverModules, nSet?.hoverModules)) return false;
if (!sameArr(pSet?.overviewModules, nSet?.overviewModules)) return false;
@@ -1002,6 +1008,9 @@ export async function saveSettingsPatch(patch) {
safePatch.weeklyLimitMode =
mode === 'custom_tokens' || mode === 'custom_cost' ? mode : 'official';
}
if (Object.prototype.hasOwnProperty.call(safePatch, 'enableCliStatusLine')) {
safePatch.enableCliStatusLine = Boolean(safePatch.enableCliStatusLine);
}
if (Object.prototype.hasOwnProperty.call(safePatch, 'showTopbarMultiSession')) {
safePatch.showTopbarMultiSession = Boolean(safePatch.showTopbarMultiSession);
}
@@ -1011,6 +1020,9 @@ export async function saveSettingsPatch(patch) {
if (Object.prototype.hasOwnProperty.call(safePatch, 'showStepAgentBadge')) {
safePatch.showStepAgentBadge = Boolean(safePatch.showStepAgentBadge);
}
if (Object.prototype.hasOwnProperty.call(safePatch, 'showStepSpeedColor')) {
safePatch.showStepSpeedColor = Boolean(safePatch.showStepSpeedColor);
}
if (Object.prototype.hasOwnProperty.call(safePatch, 'topbarCapsuleSlots')) {
safePatch.topbarCapsuleSlots = normalizeClientTopbarSlots(safePatch.topbarCapsuleSlots);
}