Skip to content

fix(claude): accept array-like daily analytics in details view - #136

Merged
bernardopg merged 3 commits into
mainfrom
fix/issue-130-claude-daily-bars
Nov 22, 2026
Merged

bernardopg merged 3 commits into
mainfrom
fix/issue-130-claude-daily-bars

Conversation

@bernardopg

Copy link
Copy Markdown
Owner

Summary

  • Make ClaudeProfiles.week() accept array-like daily analytics values, not only JS arrays.
  • Add QML smoke coverage for QVariantList-like array wrappers.

Root cause

QML can expose JSON arrays as QVariantList wrappers that are array-like but fail Array.isArray(). ClaudeProfiles.week() discarded them, so dailyTokens/dailyCosts fell back to zero and the Claude details panel rendered empty daily bars and Today tokens = 0.

Test plan

  • bash tests/test-qml-smoke.sh

Fixes #130

QML can expose JSON arrays as QVariantList wrappers that fail Array.isArray(). ClaudeProfiles.week() discarded them, leaving daily token/cost bars and the Today tokens tile at zero even when the analytics payload was correct.

Accept any object with a numeric length as the week source and cover the case in the QML smoke test.

Fixes #130

Signed-off-by: Bernardo Pinto Gomes <[email protected]>
Signed-off-by: Bernardo Pinto Gomes <[email protected]>

# Conflicts:
#	CHANGELOG.md
Signed-off-by: Bernardo Pinto Gomes <[email protected]>

# Conflicts:
#	CHANGELOG.md
@bernardopg
bernardopg merged commit 608bb48 into main Nov 22, 2026
20 checks passed
@bernardopg
bernardopg deleted the fix/issue-130-claude-daily-bars branch November 22, 2026 04:43
@bernardopg bernardopg mentioned this pull request Nov 22, 2026
4 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, workflows, tooling documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Claude daily token/cost bars always render zero (week() rejects QVariantList-wrapped arrays)

1 participant