refactor(panel): unify settings and bridge contracts, prune dead code, and rename trajectory metrics

- Share settings normalization and window-bridge protocol contracts across frontend and backend
- Encapsulate trajectory cache accessors inside config.mjs and validate bundle imports/syntax before writing
- Remove dead selectors, unused symbols, duplicate re-export imports, and unmounted account tab instantiation
- Rename speed-metrics.mjs to trajectory-metrics.mjs and audit-fixes.test.mjs to cross-module-regressions.test.mjs
This commit is contained in:
fish
2026-11-17 20:00:50 +09:00
parent dba3473494
commit 1ff1c128a8
34 changed files with 802 additions and 676 deletions
@@ -10,7 +10,6 @@
import { h, patchAttr, patchClasses, patchStyleVar, patchText } from '../../core/domPatch.js';
import {
formatMetric,
formatTokens,
formatTokensPrecise,
formatUsd,
@@ -422,21 +421,6 @@ export function computePublicationFit(
};
}
/**
* 计算样本点上的平滑回归拟合值序列(供单元测试与轻量调用直接读取)。
*
* @param {number[]} ys
* @param {{ minVal?: number, maxVal?: number, xs?: number[] }} [bounds]
* @returns {number[]}
*/
export function computeLoessFit(ys, { minVal = 0, maxVal = Infinity, xs = null } = {}) {
const n = Array.isArray(ys) ? ys.length : 0;
if (n === 0) return [];
const xArr =
Array.isArray(xs) && xs.length === n ? xs : Array.from({ length: n }, (_, idx) => idx);
return computePublicationFit(xArr, ys, { minVal, maxVal }).sampleFits;
}
/**
* Heckbert 科学坐标轴刻度取整算法,生成科研图表风格的均匀整洁刻度。
*/