Skip to content

fix(stats): handle trust prompts and report failed refreshes - #94

Merged
abasiri merged 1 commit into
mainfrom
fix/stats-trust-refresh
Sep 9, 2026
Merged

fix(stats): handle trust prompts and report failed refreshes#94
abasiri merged 1 commit into
mainfrom
fix/stats-trust-refresh

Conversation

@abasiri

@abasiri abasiri commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

When Claude's workspace trust dialog defaults to “No, exit,” Switchboard's stats refresh sends Enter and exits before updating the cache. The Stats tab then displays the old data without reporting the failure.

Select Yes explicitly: send Down when No is highlighted, wait for the Yes selection to render, then send Enter separately. Preserve compatibility with older dialogs already selecting Yes. Handle fragmented terminal output, clean up pending input and timers, and share overlapping refresh requests.

Report early exits, timeouts, unreadable caches, and an unchanged outdated cache in the Stats tab while retaining cached charts and independent usage data. An unchanged cache covering yesterday is accepted because Claude computes today's activity separately.

Fixes #92

Validation:

  • npm test with the existing local dependencies via NODE_PATH: 221 passed, 0 failed or skipped, including 22 new tests for trust handling, failure paths, cache freshness, and the renderer.
  • Tested the production helper against Claude Code 2.1.263 on macOS, using Switchboard's home-directory launch and terminal settings. It automatically sent Down, confirmed Yes, and reached the stats display. An already-current cache with unchanged mtime correctly produced no error.
  • Syntax checks and git diff --check passed. Electron GUI and Windows/Linux runtime behavior were not tested locally.

@abasiri
abasiri merged commit 6285ad9 into main Sep 9, 2026
5 checks passed
@abasiri
abasiri deleted the fix/stats-trust-refresh branch September 9, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stats tab silently stops updating: refresh-stats auto-accepts the trust prompt with Enter, which now selects "No, exit"

1 participant