feat(panel): add worker hot-reload, sticky bridge lease, custom token combos, trimmed model IDs, and adaptive popover width

- Isolate SidecarApp /api/* backend runtime inside a hot-swappable Worker thread (sidecar-worker.mjs) with 3s disk-drift detection and queued request handoff so live plugin updates never drop the host-assigned SidecarApp port
- Persist and reuse sticky loopback bridge port/token leases across bridge-daemon and worker reloads, pre-bind the bridge server on boot, allow /api/cache/rebuild on the bridge, and self-heal poisoned CDP fallback states back to HTTP
- Add billing-aligned In / Out / Cache (tokens_io_cache) preset with per-segment USD hover breakdown and custom format DSL (tokens_custom + stepTokenComboFormat, e.g. context:new:cache, in:out:cache)
- Add 3-way model name format (short / upstream / upstream_compact) stripping gemini-, claude-, and gpt- prefixes while protecting compaction suffixes from ellipsis truncation
- Add adaptive content-fit popover width (auto up to viewport bounds on wide step tables) alongside custom fixed width (440-1080 px)
This commit is contained in:
fish
2026-11-16 16:55:56 +09:00
parent cd841b55cf
commit 3b36ade911
33 changed files with 3124 additions and 381 deletions
+12 -2
View File
@@ -24,6 +24,7 @@ import {
formatTokensPrecise,
formatUsd,
mergeModelsByDisplayName,
normalizeModelDisplayMode,
normalizeOrchestratorIdDisplayMode,
} from '../core/formatters.js';
import { i18nStore, isEnglishLocale, t } from '../i18n/index.js';
@@ -527,8 +528,9 @@ export const ConsumptionView = defineComponent({
const locale = i18nStore.getState().locale;
// 额度与会话状态也会发布遥测更新,只对用量页实际展示的数据重绘。
const signature = JSON.stringify([
locale, slice.range, slice.customStartMs, slice.customEndMs, slice.showUpstreamModel,
slice.orchestratorIdMode, dateSpan, preset?.label || rangeInfo.label, acct,
locale, slice.range, slice.customStartMs, slice.customEndMs, slice.modelDisplayMode,
slice.showUpstreamModel, slice.orchestratorIdMode, dateSpan,
preset?.label || rangeInfo.label, acct,
cons.trendSeries, slice.modelBreakdown, cons.sourcesBreakdown,
monthlyYear, currentMonthIdx, cons.monthlySeries,
]);
@@ -642,6 +644,10 @@ export const ConsumptionView = defineComponent({
// 3. 同步热门模型列表(按最终展示名称去重归并后按总 Token 数降序排列并执行键值增量对账)
const localeSig = i18nStore.getState().locale;
const displaySettings = {
modelDisplayMode: normalizeModelDisplayMode(
slice.modelDisplayMode,
slice.showUpstreamModel
),
showUpstreamModel: Boolean(slice.showUpstreamModel),
orchestratorIdMode: slice.orchestratorIdMode,
};
@@ -728,6 +734,10 @@ export const ConsumptionView = defineComponent({
customEndMs: st.customEndMs,
consumption: st.telemetry?.consumption,
modelBreakdown: st.telemetry?.modelBreakdown,
modelDisplayMode: normalizeModelDisplayMode(
st.telemetry?.settings?.modelDisplayMode,
st.telemetry?.settings?.showUpstreamModel
),
showUpstreamModel: Boolean(st.telemetry?.settings?.showUpstreamModel),
orchestratorIdMode: normalizeOrchestratorIdDisplayMode(
st.telemetry?.settings?.orchestratorIdMode