Fix trailing 7-day stats and add 14-day totals legend#188
Merged
Conversation
The dashboard's "Last 7 days" chart was querying a 14-day window and slicing to the 7 most-recent non-empty buckets, so days with zero orders were dropped and older orders ended up counted in their place. Switch to a true rolling 7-day window: the MQL $match uses `time_received >= now - 7d` so an order at 9:30am last Monday is no longer counted when the page is loaded at 11am this Monday, and the chart pads missing days from today's local midnight back through today minus 7. Add `loadRobotTotalsLastNDays` and render a second legend beside the chart so the dashboard shows both 7-day and 14-day per-robot totals. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
now - 7 daysare no longer counted, and days with zero orders are no longer silently dropped).today - 7 days, padding missing days with empty buckets.loadRobotTotalsLastNDayshelper.Test plan
today - 7 daysthrough today, with empty groups rendered for days with no orders.🤖 Generated with Claude Code