Skip to content

Home page: no "since last scan" delta across a wheelgap upgrade - #84

Merged
patrickballard merged 1 commit into
wheelgap:mainfrom
sarankumar1325:fix/platform-delta-wheelgap-upgrade
Nov 16, 2026
Merged

patrickballard merged 1 commit into
wheelgap:mainfrom
sarankumar1325:fix/platform-delta-wheelgap-upgrade

Conversation

@sarankumar1325

Copy link
Copy Markdown
Contributor

Closes #58.

What changes

  • platformStats in site/logic.js takes two more arguments: the previous history entry's wheelgap and the current scan's wheelgap. When they differ, delta is 0. The existing Pyodide "not like for like" rule stays.
  • An older history entry with no wheelgap field also gives delta: 0. Without a version we can't tell whether the two nights are comparable, and update_changes.py and the campaign trend also skip nights they can't compare. The current data/history.json has wheelgap on every entry, so nothing changes on today's page.
  • site/app.js: previousSummary(label) becomes previousScan(), which returns the whole previous entry, so renderPlatforms can pass its summary cell and its wheelgap along with state.data.wheelgap.

Tests

In tests/site/logic.test.js:

  • Same version gives the delta (4), and a 0.7.0 to 0.9.0 upgrade gives 0. ok and percent are unchanged.
  • No version on the previous entry (undefined or empty), or none on the current scan, gives 0.
  • The existing platformStats tests now pass matching versions.

The two new tests fail on main. node --test tests/site/logic.test.js tests/site/scripts.test.js tests/site/check-logic.test.mjs passes 29/29, node --check is clean on logic.js and app.js, and uvx --python 3.14 [email protected] gives 325 passed, 1 skipped.

platformStats compared each platform bar with the previous history entry
whatever wheelgap version produced it, so the night the scan moved from
0.7.0 to 0.9.0 showed +1 to +5 on bars where changes.json rightly had
nothing. Pass the previous entry's and this scan's wheelgap versions and
return delta 0 when they differ or the previous entry has none.

Closes wheelgap#58

Signed-off-by: sarankumar1325 <[email protected]>
@patrickballard
patrickballard merged commit 8a58e4c into wheelgap:main Nov 16, 2026
1 check passed
@patrickballard

Copy link
Copy Markdown
Contributor

Merged, thanks @sarankumar1325! Treating a history entry with no wheelgap version as not comparable, and explaining that choice in the PR, was a careful call. The tests for both the upgrade and the missing version pin it down nicely.

If you'd like another one, #75 (notice the day a top package's release drops a platform's wheels, with a feed) follows on from this: it's the same "what changed since last night" question, applied to individual packages, and nobody has picked it up yet.

(Review assisted by Claude.)

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.

Home page: "+N since last scan" shouldn't compare across a wheelgap upgrade

2 participants