feat(brainbar): add sparkline hover tooltips#334
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
@codex review |
|
@macroscope-app review |
|
@coderabbitai review |
|
Warning Review limit reached
More reviews will be available in 13 minutes and 55 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
You need to increase your spend limit or enable usage-based billing to run background agents. Go to Cursor |
✅ Actions performedReview triggered.
|
|
Review in progress. Results will be posted as check runs when complete. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 092c866. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 092c866c08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let bucketWidth = max(1, Int(ceil(Double(activityWindowMinutes) / Double(values.count)))) | ||
| let newerMinutesAgo = max(values.count - 1 - clampedBucket, 0) * bucketWidth | ||
| let olderMinutesAgo = min(newerMinutesAgo + bucketWidth, activityWindowMinutes) |
There was a problem hiding this comment.
Derive tooltip ranges from true bucket width
Use of ceil(activityWindowMinutes / values.count) can generate impossible time ranges for older buckets, so tooltip labels no longer match the buckets being charted. With the default dashboard settings (activityWindowMinutes = 30, values.count = 12), bucketWidth becomes 3, which yields labels like 30-33m ago for bucket 0 even though the window is only 30 minutes. This is user-visible and contradicts the actual bucketing logic in BrainDatabase (which uses fractional bucket widths via Double(activityWindowMinutes * 60) / Double(bucketCount)), so the hover tooltip can report incorrect intervals on normal production data.
Useful? React with 👍 / 👎.
ApprovabilityVerdict: Would Approve Self-contained UI feature adding hover tooltips to sparkline charts. All files are owned by the PR author, includes unit tests, and the unresolved review comment references code that doesn't match the actual implementation (which correctly uses fractional bucket widths). Macroscope would have approved this PR. Enable approvability here. |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
@macroscope-app review |
|
@codex review |
|
@coderabbitai review |
|
You need to increase your spend limit or enable usage-based billing to run background agents. Go to Cursor |
✅ Actions performedReview triggered.
|
|
Review in progress. Results will be posted as check runs when complete. |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

Summary
Mandate / Evidence
Test Plan
Note
Low Risk
Dashboard sparkline labeling and tooltip presentation only; no data pipeline or persistence changes.
Overview
Refines sparkline hover tooltips so bucket time ranges match how the dashboard divides the activity window across buckets, including uneven splits (e.g. 31 minutes into 12 buckets).
SparklineChartPresentationnow computes bucket boundaries in seconds (window × 60 ÷ bucket count) instead of rounding to whole minutes per bucket. Labels use a newdurationLabel(seconds:)helper so ranges can show minutes only, seconds only, or mixed values (e.g.31m-28m 25s ago,last 2m 35s).tooltipText(forBucket:)takes a bucket index and reads the count fromvaluesrather than a chart point struct.SparklineCharthover state tracks a bucket index (hoveredBucket) end-to-end;nearestBucketreturns that index for the tooltip overlay.Tests update expectations for the new label format and add
testSparklineChartPresentationLabelsPartialMinuteBucketsLikeDatabasefor the partial-minute case.Reviewed by Cursor Bugbot for commit 63afc1a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add hover tooltips to BrainBar sparkline charts
SparklineChart(non-compact mode) showing the time range and value for the bucket nearest the pointer, tracked via a chart overlay.SparklineChartPresentationwithactivityWindowMinutes,bucketLabel(for:), andtooltipText(forBucket:)to compute human-readable time-range labels per bucket.activityWindowMinutesfromDashboardFlowLanethroughBrainBarHeroSparklineandStatusPopoverViewso tooltips reflect the actual configured activity window.Macroscope summarized 63afc1a.