Skip to content

fix: limit chart data to last 90 days#140

Merged
MatteoGabriele merged 2 commits into
MatteoGabriele:mainfrom
graphieros:account-timeline-limit
May 21, 2026
Merged

fix: limit chart data to last 90 days#140
MatteoGabriele merged 2 commits into
MatteoGabriele:mainfrom
graphieros:account-timeline-limit

Conversation

@graphieros
Copy link
Copy Markdown
Contributor

@graphieros graphieros commented May 20, 2026

This limits the chart dataset to the last 90 days, to avoid long streaks of empty days when a set contains a very old date.

Before After
image image

Summary by CodeRabbit

  • New Features
    • Account events timeline now shows only the most recent 90 days of activity.
    • Timeline labels and chart data use hourly granularity within that 90-day window for clearer recent activity trends.
    • Events are filtered to active event types so the chart focuses on relevant activity.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2026

Deploy Preview for agentscan ready!

Name Link
🔨 Latest commit a8b74d2
🔍 Latest deploy log https://app.netlify.com/projects/agentscan/deploys/6a0d3ad78ae65b00086c42e6
😎 Deploy Preview https://deploy-preview-140--agentscan.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a84a76f8-3fdc-4f5f-a87b-5a64e93f997f

📥 Commits

Reviewing files that changed from the base of the PR and between a3bc51f and a8b74d2.

📒 Files selected for processing (1)
  • app/components/Chart/AccountEventsTimeline.vue

📝 Walkthrough

Walkthrough

AccountEventsTimeline now computes a UTC-based 90-day rolling window (dayRangeLimit = 90) from qualifying GitHub events, filters events to that window (limitedEvents), and uses limitedEvents for hourly time labels and building the per-event chart dataset via a constant activeGitHubEventTypes list.

Changes

Event days rolling window & dataset

Layer / File(s) Summary
Compute rolling 90-day window and limitedEvents
app/components/Chart/AccountEventsTimeline.vue
Adds dayRangeLimit = 90, defines activeGitHubEventTypes and isActiveGitHubEventType, rewrites eventDays to a UTC rolling window ending on the latest qualifying event day, derives limitedEvents from that window, and removes the old computed activeGitHubEventTypes.
Hourly labels and dataset from limitedEvents
app/components/Chart/AccountEventsTimeline.vue
Changes timeLabels to use limitedEvents for the complete hour range, iterates the constant activeGitHubEventTypes when building per-event series in createLineDataset, and computes datasetLine from limitedEvents.value.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • MatteoGabriele

Poem

🐰 I counted days in ninety-wide bands,
Rolled them up neat with careful hands,
Events trimmed to a recent parade,
Hours aligned from the window we made,
Charts hop lighter — rabbit-approved plans.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing a 90-day limit on chart data to prevent empty date ranges, which directly addresses the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/components/Chart/AccountEventsTimeline.vue`:
- Around line 98-113: The hourly labels are still generated from all events by
getCompleteHourRange(props.events), bypassing the 90-day/eventDays window;
update the hourly-label generation to use the same filtered range: either pass
the computed startDay/lastDay (from the eventDays computation that derives
startDay) into getCompleteHourRange or, after calling getCompleteHourRange,
filter its returned hours to only include timestamps between startDay
(inclusive) and lastDay (inclusive). Reference the computed that builds
days/startDay (lines with variables days, lastDay, startDate, startDay) and
getCompleteHourRange so the hourly mode cannot expand beyond the same
constrained eventDays.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b47d6b45-c6a9-4380-8b55-81c4ec821685

📥 Commits

Reviewing files that changed from the base of the PR and between 113c2a0 and a3bc51f.

📒 Files selected for processing (1)
  • app/components/Chart/AccountEventsTimeline.vue

Comment thread app/components/Chart/AccountEventsTimeline.vue
@MatteoGabriele MatteoGabriele merged commit dfefd9a into MatteoGabriele:main May 21, 2026
5 checks passed
@MatteoGabriele
Copy link
Copy Markdown
Owner

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.

2 participants