Skip to content

update chart selection logic and conditionally render display name fi…#346

Open
NaveenCode wants to merge 4 commits into
mainfrom
fix/dashboard-charts-fixes
Open

update chart selection logic and conditionally render display name fi…#346
NaveenCode wants to merge 4 commits into
mainfrom
fix/dashboard-charts-fixes

Conversation

@NaveenCode

@NaveenCode NaveenCode commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

update chart selection logic and conditionally render display name field for number chart

Summary by CodeRabbit

  • New Features

    • Refined chart multi-selection so entering selection mode immediately selects the chosen chart.
    • Updated per-chart selection controls with checkboxes shown only during selection mode, plus “Select/Deselect” actions that reflect current state.
    • Hid the “Display Name In Charts” setting for number chart types (shown for other types).
  • Bug Fixes

    • Improved consistency between checkbox selection and dropdown “Select/Deselect” actions.
  • Tests

    • Added tests covering conditional rendering of “Display Name In Charts” by chart type.
  • Refactor

    • Simplified dashboard lock UI to rely only on save status indicators.

@NaveenCode NaveenCode self-assigned this Jul 16, 2026
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
webapp-v2 Ready Ready Preview, Comment Jul 24, 2026 10:18am

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@NaveenCode, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6476eba9-34a0-474b-8243-2e005ae7a1ac

📥 Commits

Reviewing files that changed from the base of the PR and between fca78d9 and 2bd3300.

📒 Files selected for processing (5)
  • app/charts/page.tsx
  • components/dashboard/dashboard-list-v2.tsx
  • hooks/api/useChart.ts
  • hooks/api/useCharts.ts
  • hooks/api/useDashboards.ts

Walkthrough

Chart selection now preselects the initiating chart and provides row-level controls. The metric accordion hides display names for number charts with test coverage. Dashboard lock indicators are removed while lock-token handling remains.

Changes

Chart Selection Behavior

Layer / File(s) Summary
Chart selection flow
app/charts/page.tsx
Selection mode starts with the initiating chart selected, row checkboxes reflect selection state, and the actions menu toggles the current chart with dynamic Select/Deselect labels.

Display-Name Field Visibility

Layer / File(s) Summary
Chart-type display-name condition
components/charts/MetricAccordionItem.tsx, components/charts/__tests__/MetricAccordionItem.test.tsx
The display-name field is rendered for non-number charts and hidden for number charts, with tests covering bar and number chart types.

Dashboard Lock Indicators

Layer / File(s) Summary
Lock state and status UI
components/dashboard/dashboard-builder-v2.tsx
Lock-token management no longer updates lock-status state, and mobile and desktop indicators now show save status without lock information.

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

Possibly related PRs

Suggested reviewers: pradnk, himanshudube97

🚥 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%. 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 reflects the chart selection and display-name rendering changes, which are major parts of the PR.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dashboard-charts-fixes

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/charts/page.tsx (1)

801-802: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Leverage the TableRow selected state for better visual feedback.

Consider passing data-state to <TableRow> so that it automatically applies the built-in selection background color (data-[state=selected]:bg-muted) defined in your components/ui/table.tsx.

🎨 Proposed refactor
-      <TableRow key={chart.id} className="hover:bg-gray-50">
+      <TableRow 
+        key={chart.id} 
+        className="hover:bg-gray-50"
+        data-state={isChartSelected ? 'selected' : undefined}
+      >
🤖 Prompt for 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.

In `@app/charts/page.tsx` around lines 801 - 802, Update the TableRow rendered in
the chart row mapping to pass its selected state through the data-state
attribute, using the row’s existing selection value so the table’s built-in
data-[state=selected]:bg-muted styling applies.
🤖 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/charts/page.tsx`:
- Around line 806-813: Add an aria-label to the Checkbox rendered in the
isSelectionMode branch, using the current chart identity so screen readers
announce which chart the control selects. Preserve the existing checked state,
test identifier, and toggleChartSelection behavior.

---

Nitpick comments:
In `@app/charts/page.tsx`:
- Around line 801-802: Update the TableRow rendered in the chart row mapping to
pass its selected state through the data-state attribute, using the row’s
existing selection value so the table’s built-in data-[state=selected]:bg-muted
styling applies.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7b15d7f7-cd0c-4ea9-9220-07329e111553

📥 Commits

Reviewing files that changed from the base of the PR and between e6eb775 and 05a3ca3.

📒 Files selected for processing (3)
  • app/charts/page.tsx
  • components/charts/MetricAccordionItem.tsx
  • components/charts/__tests__/MetricAccordionItem.test.tsx

Comment thread app/charts/page.tsx
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.

1 participant