Repository navigation
Conversation
…-clawbot#2193) Months of hours should roll up to daily bars with a handful of labels, missing hours count as zero, and the chart should start where the data does rather than at the few old packets a short store keeps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
…t#2193) A long history now rolls up to coarser bars (hourly, 6-hourly, daily or weekly; at most 180) with about 10 labels on round UTC times, missing hours count as zero, and the title follows the bucket (Packets / Day). The chart starts where the data does: a short store also keeps a few old packets that were heard again, weeks before the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
A13xB0
force-pushed
the
fix/packets-per-hour-long-span
branch
from
October 12, 2026 20:06
8097f97 to
350fd8c
Compare
Every load fires a theme-refresh about 300ms after the theme resolves, and the page re-rendered the current tab on it. On a slow or just-restarted server the analytics answers land later, so the Overview was drawn from the empty data object and threw (reading 'totalTransmissions'). loadAnalytics() renders the tab, with the current theme, once the answers land, so the early refresh has nothing to do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
A13xB0
force-pushed
the
fix/packets-per-hour-long-span
branch
from
October 12, 2026 20:21
350fd8c to
9878913
Compare
Owner
Author
|
Submitted upstream as Kpa-clawbot#2194. |
… alone Regression test for 9878913. Drives init() with answers that never land, fires the captured theme-refresh handler, and checks that nothing throws and the tab is not re-rendered. Without the guard it fails with the production error (reading 'totalTransmissions'). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
…d says so Review on Kpa-clawbot#2194: the start crop also cut a genuinely quieter early stretch inside a window the user picked (90 days, the first 30 quiet: 30 days hidden), and nothing on the card said so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
In a picked window the server has already cut the data to it, so a quieter early stretch is real: the chart now starts at the window's first hour. Under "All data" the straggler crop stays, and the card title says "since MM-DD" when it applies. The renderer gets the window the data was fetched with from _analyticsData. Also corrects the comment on which seven days set the floor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
Owner
Author
|
Merged upstream as Kpa-clawbot#2194; closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Kpa-clawbot#2193 (in the fork for review; not submitted upstream).
Problem
On an instance that keeps months of packets, the Overview tab's Packets / Hour chart becomes unreadable: 2,932 hourly bars in 720 units of plot, a date label every day, and the hours with no packets (which the server leaves out) squeezed off the axis.
Before and after
Both use the real
/api/analytics/rfanswer from the instance in the issue (2,933 hourly buckets over 124 days), served to the page in place of the fixture's own.Before (master, page on "All data"):
After, same data:
Phone:
A short store (pre-prod, 7 days in memory, plus a few old packets a day for weeks before that because they were heard again). The chart starts where the real data does:
Change
All in
public/analytics.js; no API change.packetsPerHourCard()replaces the inline block:theme-refreshabout 300 ms after the theme resolves, and the page re-rendered the current tab on it. When the analytics answers came later (a busy or just-restarted server), the Overview was drawn from an empty object and threwCannot read properties of undefined (reading 'totalTransmissions'). It now skips that refresh until the data has landed;loadAnalytics()renders the tab with the current theme when it does.The span is still picked by the page's time window.
Tests
tests/unit/test-issue-2193-packets-per-hour.js(intest-all.sh, red then green): 122 days gives 123 daily bars with 4 to 12 labels; 7 days gives 168 hourly bars; missing hours are drawn as zero; the chart starts at the data, not at the stragglers, and not after an outage; no data says so.sh test-all.shpasses; the Neighbor-graph filter E2E fails under CI load: skip-message transition is undone by a later re-render (#1758 lifecycle) Kpa-clawbot/CoreScope#1925 neighbour-graph theme-refresh test and the analytics chart test still pass; the screenshots show no page errors and no sideways scroll at 1280 px or 390 px.🤖 Generated with Claude Code
https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H