Repository navigation
Conversation
19d2bc7 to
cf30496
Compare
cf30496 to
ab64ead
Compare
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that a live paid-account payload really carries a non-null [DESIGN-REVIEWED] 9ea7158 Description read[DESCRIPTION-READ] 7e0ebcc34f0954a835a52eb16e19d41a4cb08757e4d7509ca3d45ace3817d01d That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check one live WakaTime payload: What this change shipsInventory (5 items) — 5 justifiedIntent: let a user see the same coding time on the WakaTime overview headline as on WakaTime.com and the Languages bars below it. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 9ea7158 Description read[DESCRIPTION-READ] 84917fb20855d7ef9df9cfc47d566a6d3ccaac24ca2d612f7a66e5285a94d5b3 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Verify on a real account that the summary card and the drill-in's "This range" now match WakaTime.com. [UX-REVIEWED] 9ea7158 Description read[DESCRIPTION-READ] 5b6953de97acdefc5569841b778a7796f1d7a5308fb9df1b4413371b5185bbb4 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
ab64ead to
1bbac4a
Compare
1bbac4a to
cec657b
Compare
|
Fixed in cec657b. The UX review was right: the first revision moved only the drill-in headline (WakaTimeTab) to the include-other total, which would have left WakaTimeSummaryCard on the Overview page showing the old classified-only figure, so the card and the drill-in it opens disagreed. WakaTimeSummaryCard now reads total_seconds_including_other_language with the same classified fallback, so both surfaces show the same total. Covered by a new OverviewPage test (classified 30m vs include-other 2h; the card must render 2h). The Windows backend shard failure on the prior run was test_cancelled_descendant_scan_terminates_only_failed_session, a timing-sensitive session-lifecycle test unrelated to this frontend-only diff; the fresh run re-triggered it. |
WakaTime's classified total_seconds drops the "Other" bucket (heartbeats that arrive without a recognised language), so an account that dumps most of its time there shows a headline a fraction of the real total while the Languages breakdown stays correct. The dashboard's own Languages bars and WakaTime.com's headline both read the *_including_other_language variants. The Overview WakaTime drill-in (WakaTimeTab) and the Overview summary card (WakaTimeSummaryCard) now read total_seconds_including_other_language and daily_average_including_other_language, falling back to the classified field when the include-other variant is null (free accounts do not report it). Fixing only the drill-in would leave the summary card and the drill-in it opens disagreeing, so both move together. Two fields added to the WakaTimeStats type; the backend already forwards the WakaTime payload verbatim, so this is a frontend read-site change. Covered by tests pinning the include-other preference and the null fallback on both the drill-in headline and the summary card.
cec657b to
9ea7158
Compare
|
Thank you @Behordeun for this fix and the clear write-up of the root cause. To get it landed, we carried your commit unchanged into same-repo PR #21522 (cherry-picked with Closing this one in favour of #21522. Your branch is left as is. Thanks again! |
Problem / Motivation
Goal: make the WakaTime overview headline report the same coding time the user sees on WakaTime.com and in the Languages bars right below it, instead of a figure that is only a fraction of the real total.
The headline reads far lower than it should. On one account the "This range" stat showed 6h 31m while the Languages breakdown beneath it summed to roughly 95h and WakaTime.com reported 78h 5m for the same range; the daily average showed 56m against WakaTime's 13h. A total that is smaller than the Languages bars it sits above is structurally impossible for a true total, which is the tell that the headline is reading the wrong field.
Why it matters
The headline is the first number a user looks at to judge how much time was recorded. Reading it low makes the integration look broken or makes real coding time look like it was lost, and the discrepancy is largest for exactly the users this integration serves most: heavy agent users, whose coding turns send heartbeats without a recognised language and so land in WakaTime's "Other" bucket. The Languages bars and WakaTime.com both count that bucket; the headline did not.
Not a goal
What changed (motivation → approach → change)
Observed symptom: the headline "This range" and "Daily average" read a small fraction of the Languages bars and of WakaTime.com for the same range.
Root cause: both surfaces that show a WakaTime total bound it to the classified-only field.
WakaTimeTab(the Overview drill-in) bound "This range" and "Daily average" tostats.total_seconds/stats.daily_average, andWakaTimeSummaryCard(the Overview summary card that opens the drill-in) bound its total tostats.total_seconds. Those exclude time in the uncategorised "Other" language bucket. WakaTime.com's own headline and the Languages bars use the*_including_other_languagevariants, so on an account that sends most of its time without a recognised language the classified-only figure collapses to a fraction of the real total.Change: both the drill-in headline and the summary card now prefer
total_seconds_including_other_language/daily_average_including_other_language, falling back to the classified field when the include-other variant is absent or null (free WakaTime accounts can return null there). Fixing only the drill-in would leave the summary card and the drill-in it opens disagreeing, which the UX review flagged, so both move together. The two fields are added to theWakaTimeStatstype. The backend already returns the WakaTimedatadict verbatim (handlers/wakatime.pyreturns{"stats": data};client.fetch_statsreturnsdataunchanged), so both fields were already arriving at the client; this is a frontend-only field-choice fix.Backwards compatibility
Compatible: the change only reads two additional optional fields and keeps the existing fields as a fallback, so an account whose payload lacks the include-other variants renders exactly as before. The two new type fields are optional and nullable, adding no required field and narrowing nothing.
Removes nothing: no field, route, type member or capability is removed, renamed or hidden; two optional reads are added and the prior reads are retained as the fallback.
Tests
website/src/test/WakaTimeTab.test.tsx(the drill-in):headline reads the include-other total so it matches WakaTime.com and the Languages bars— payload carriestotal_seconds=3600(1h) andtotal_seconds_including_other_language=10800(3h); the headline must render 3h, not 1h.falls back to the classified total when the include-other field is null (free account)— include-other field isnull, classifiedtotal_seconds=7200(2h); the headline must render 2h, not zero.website/src/test/OverviewPage.test.tsx(the summary card):shows the WakaTime summary total from the include-other field, not the classified-only total— fixturetotal_seconds=1800(30m),total_seconds_including_other_language=7200(2h); the card must render 2h, not 30m, so it matches the drill-in it opens.The existing WakaTimeTab and OverviewPage tests continue to pass.
Manual verification
N/A — unit coverage sufficient. The change is a field-selection expression in two existing components, fully exercised by the three new tests plus the existing render tests. The symptom was a wrong numeric value in an existing, unchanged layout.
Screenshots / video
Why no screenshot: the only rendered change is the numeric value inside the existing, unchanged "This range" / "Daily average" stats and the Overview WakaTime summary card (the components, layout, styling and i18n labels are untouched), and this is a fork PR without GitHub attachment write access, so the before/after is given numerically in What changed rather than as media. A maintainer may apply the
no-screenshotslabel.Related Issues
Related to #11336 and #13177 (the separate duration-accrual work); this PR fixes the independent display-field half of the same user-visible symptom. No single issue tracks this display bug.
Pattern harvest
Rule candidate: review-prompt
Pattern: a UI headline/summary stat binds to a provider's partial/classified total (e.g.
total_seconds) while the detail breakdown beside it uses the provider's grand total (*_including_other_language), so the summary reads smaller than the detail it summarises. When a total sits above its own breakdown, or two surfaces show the same provider total, they must read the same source field.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)