Skip to content

feat: collapse bar charts beyond N rows with expand-to-view-all#2345

Merged
alx-xo merged 5 commits intomainfrom
alexm/age-1906-feat-bar-charts-should-collapse
Apr 22, 2026
Merged

feat: collapse bar charts beyond N rows with expand-to-view-all#2345
alx-xo merged 5 commits intomainfrom
alexm/age-1906-feat-bar-charts-should-collapse

Conversation

@alx-xo
Copy link
Copy Markdown
Contributor

@alx-xo alx-xo commented Apr 22, 2026

Summary

  • Bar charts (Users per Server, User Event Counts, Errors per Server) now cap at COLLAPSED_BAR_CHART_MAX_ROWS (6) rows in the default
    view, with a "Show N more" link that triggers the existing full-expand
  • Time series chart height increased to 250px collapsed / 600px expanded for better data density
  • Extracted BAR_THICKNESS, BAR_ROW_HEIGHT, BAR_ROW_SPACER, and LINE_CHART_HEIGHT constants so all chart dimensions are
    controlled from a single place

Root cause

Bar charts with large datasets (50+ servers or users) made the dashboard cards very tall and hard to scan. The existing expand
mechanism was already in place but wasn't being leveraged to hide excess rows — charts simply rendered everything at full height
regardless of how many entries there were.

Test plan

  • Charts with ≤6 rows show no "Show N more" link and render as before
  • Charts with >6 rows show the top 6 entries and a "Show N more" link at the bottom
  • Clicking "Show N more" triggers full-expand (other charts hide, all rows visible)
  • Minimizing the expanded chart returns it to the collapsed 6-row view
  • All bar charts have visually consistent row heights
  • Time series charts render at the new 250px / 600px heights

Visual

hooks-chart-cutoff.mp4

@linear
Copy link
Copy Markdown

linear Bot commented Apr 22, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment Apr 22, 2026 6:49am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

🦋 Changeset detected

Latest commit: b44cda6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the preview Spawn a preview environment label Apr 22, 2026
@alx-xo alx-xo changed the base branch from main to alexm/age-1882-allow-charts-to-be-expanded April 22, 2026 01:45
@alx-xo alx-xo self-assigned this Apr 22, 2026
@alx-xo alx-xo marked this pull request as ready for review April 22, 2026 01:47
@alx-xo alx-xo requested review from a team as code owners April 22, 2026 01:47
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Base automatically changed from alexm/age-1882-allow-charts-to-be-expanded to main April 22, 2026 06:24
@speakeasybot
Copy link
Copy Markdown
Collaborator

speakeasybot commented Apr 22, 2026

🚀 Preview Environment (PR #2345)

Preview URL: https://pr-2345.dev.getgram.ai

Component Status Details Updated (UTC)
✅ Database Ready Created and validated 2026-04-22 07:08:22.
✅ Images Available Container images ready 2026-04-22 07:08:05.

Gram Preview Bot

@alx-xo alx-xo force-pushed the alexm/age-1906-feat-bar-charts-should-collapse branch from 342c7dc to b44cda6 Compare April 22, 2026 06:49
@alx-xo alx-xo merged commit 8b698a3 into main Apr 22, 2026
26 checks passed
@alx-xo alx-xo deleted the alexm/age-1906-feat-bar-charts-should-collapse branch April 22, 2026 06:58
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants