feat(panel): modularize 3-tab preferences, add model context windows, and optimize telemetry

- Refactor Preferences into decoupled General, Structure, and Other tabs with unified settings schema, factory reset, and trajectory cache rebuild endpoints
- Extract standalone widget, metric, and step-table column registries to customize topbar/composer slots, hover popup modules, live overview layout, and step detail columns
- Add bilingual zh-CN/en-US i18n dictionaries, theme accent presets, and font scale controls across Shadow DOM overlay and sidebar views
- Support per-model host-advertised context window rules across App and IDE transports
- Preserve CLEARED step generation timings, memoize per-poll model resolution, optimize LOESS sorted-x fitting, and update bilingual READMEs and test suites
This commit is contained in:
fish
2026-11-15 01:18:29 +09:00
parent ad33e9cc62
commit 18c608ae63
63 changed files with 16614 additions and 5873 deletions
@@ -72,6 +72,20 @@ test('unfinished, missing-completion and reversed-time requests cannot fabricate
assert.equal(parse({total:0}).totalTokPerSec,null);
assert.equal(parse({status:'CORTEX_STEP_STATUS_GENERATING'}).totalTokPerSec,null);
});
test('cleared steps with a recorded generation end retain their original request speed',()=>{
const {s,gm}=sample({status:'CORTEX_STEP_STATUS_CLEARED'});
s.metadata.completedAt='2026-01-01T00:04:00Z';
const [cleared]=extractModelSteps([s],[gm]);
assert.equal(cleared.totalDurationSec,12);
assert.equal(cleared.totalTokPerSec,1100/12);
assert.equal(cleared.isComplete,true);
for(const status of ['CORTEX_STEP_STATUS_CANCELED','CORTEX_STEP_STATUS_ERROR','CORTEX_STEP_STATUS_GENERATING']){
assert.equal(extractModelSteps([{...s,status}],[gm])[0].totalTokPerSec,null);
}
delete s.metadata.finishedGeneratingAt;
assert.equal(extractModelSteps([s],[gm])[0].totalTokPerSec,null);
});
test('zero output is a real zero; malformed or missing output counts cannot produce rates',()=>{
const zero=parse({output:0,response:0,thinking:0});
assert.equal(zero.totalTokPerSec,0);assert.equal(zero.responseTokens,0);