mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 23:19:43 +02:00
feat(usage): replay last-known plan usage in the SSE init snapshot
The header chip previously only repopulated on reload from per-browser localStorage, so a fresh browser (or cleared storage) stayed blank until a session next rendered telemetry. Store the latest broadcast telemetry process-wide (plan-usage-latest.ts) and include it as `planUsage` in getLightState — the per-connection SSE init snapshot — so handleInit paints the chip immediately on every fresh load / reconnect, authoritative over the localStorage restore. Null until the first telemetry of the process. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2258,6 +2258,10 @@ class CodemanApp {
|
||||
this._serverCjkOverride = data.inputCjkForm || false;
|
||||
this._updateCjkInputState();
|
||||
|
||||
// Plan-usage chip: server's last-known telemetry, so it shows immediately on
|
||||
// a fresh load / reconnect (authoritative; wins over the localStorage restore).
|
||||
if (data.planUsage) this.updatePlanUsageChip(data.planUsage);
|
||||
|
||||
// Update version displays (header and toolbar)
|
||||
if (data.version) {
|
||||
const versionEl = this.$('versionDisplay');
|
||||
|
||||
Reference in New Issue
Block a user