Skip to content

feat(reports): configure bar chart display limits - #500

Open
grootbro wants to merge 1 commit into
Openpanel-dev:mainfrom
grootbro:feat/chart-display-limit-397
Open

feat(reports): configure bar chart display limits#500
grootbro wants to merge 1 commit into
Openpanel-dev:mainfrom
grootbro:feat/chart-display-limit-397

Conversation

@grootbro

@grootbro grootbro commented Sep 11, 2026

Copy link
Copy Markdown

Bar reports gain a “Rows to display” setting (1–500). The value is stored in the existing report options, so saved dashboard and shared reports retain it. Reports without the option keep their existing display behavior; query limits are unchanged.

Closes #397.

Validation: eight option-validation tests pass, the frontend typecheck passes after Prisma generation, and git diff --check passes. Existing create/update/share report paths already persist and return options, so no database migration is required. Full-file Biome reports existing filename, inferred-array and bar-interaction warnings in the touched components; this change is limited to the new setting.

Summary by CodeRabbit

  • New Features

    • Added a configurable display limit for bar charts.
    • Report settings now allow users to choose between 1 and 500 displayed rows.
    • Bar charts default to displaying 10 rows when no limit is specified.
  • Bug Fixes

    • Bar charts now consistently apply their configured display limit.
  • Tests

    • Added validation coverage for accepted, default, and invalid display-limit values.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ca23645a-3fb7-4da5-81b6-c2e5ec752fc7

📥 Commits

Reviewing files that changed from the base of the PR and between 3060ca1 and 17edfd1.

📒 Files selected for processing (4)
  • apps/start/src/components/report-chart/bar/chart.tsx
  • apps/start/src/components/report/sidebar/ReportSettings.tsx
  • packages/validation/src/index.ts
  • packages/validation/src/report-options.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The report options schema now supports a configurable bar-chart display limit. Report settings validate and dispatch values from 1 through 500. The bar chart uses the configured limit and defaults to 10 when no bar option is available.

Changes

Bar chart display limit

Layer / File(s) Summary
Bar options contract and validation
packages/validation/src/index.ts, packages/validation/src/report-options.test.ts
Adds zBarOptions with a default displayLimit of 10 and bounds of 1 through 500. Tests cover valid, default, and invalid values.
Bar display limit setting
apps/start/src/components/report/sidebar/ReportSettings.tsx
Adds a “Rows to display” numeric control for bar charts. Valid integer values are dispatched through changeOptions.
Bar chart limit consumption
apps/start/src/components/report-chart/bar/chart.tsx
Uses options.displayLimit for bar charts and updates the memoized series when options change.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature · Severity of issue fixed: Medium

Suggested reviewers: lindesvard

Sequence Diagram(s)

sequenceDiagram
  participant ReportSettings
  participant ReportSlice
  participant BarChart
  ReportSettings->>ReportSlice: dispatch changeOptions with displayLimit
  ReportSlice->>BarChart: provide updated report options
  BarChart->>BarChart: use options.displayLimit for bar series
Loading

Merge Risk: ⚪ Minimal · up to 17edf

The configurable bar-chart row limit is validated, saved through report options, and applied by the chart while preserving the default behavior for reports without a configured value.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: configurable display limits for bar charts.
Linked Issues check ✅ Passed The changes satisfy the coding requirements in issue #397. ReportSettings.tsx adds a bar-report displayLimit setting for integer values from 1 through 500 and updates report options in edit mode. …
Out of Scope Changes check ✅ Passed The reported changes stay within issue #397. They add the bar-chart display setting, apply it to bar-chart rendering, add option validation, and add focused validation tests. The changes do not alter …
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

Dashboard widges have max 10 levels

1 participant