Skip to content

fix(dashboard): add top padding to "Create new chart" button in builder pane#40033

Merged
sadpandajoe merged 2 commits into
masterfrom
fix/dashboard-create-chart-button-spacing
May 23, 2026
Merged

fix(dashboard): add top padding to "Create new chart" button in builder pane#40033
sadpandajoe merged 2 commits into
masterfrom
fix/dashboard-create-chart-button-spacing

Conversation

@yousoph
Copy link
Copy Markdown
Member

@yousoph yousoph commented May 11, 2026

SUMMARY

The NewChartButtonContainer had no top padding, causing the "+ Create new chart" button in the dashboard builder pane to sit flush against the tab bar divider. Adds sizeUnit * 3 (12px) top padding for proper visual separation.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
Screenshot 2026-05-11 at 9 46 20 AM
After:
image

TESTING INSTRUCTIONS

  1. Open a dashboard in edit mode
  2. Open the chart builder pane (right sidebar)
  3. Verify the "+ Create new chart" button has 12px of top padding above it, separating it from the tab bar

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot Bot added dashboard:design Related to the Dashboard UI/UX dashboard:editmode Related to te Dashboard edit mode labels May 11, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 11, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 13a1f99
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a0602450d8c190008068a2b
😎 Deploy Preview https://deploy-preview-40033--superset-docs-preview.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.

Copy link
Copy Markdown
Contributor

@bito-code-review bito-code-review Bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #4ef44b

Actionable Suggestions - 1
  • superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts - 1
    • CWE-1321: Generic Object Injection Sink vulnerability · Line 385-398
Review Details
  • Files reviewed - 3 · Commit Range: c131dd2..567a12b
    • superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/Heatmap/transformProps.test.ts
    • superset-frontend/src/dashboard/components/SliceAdder.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines 385 to 398
let suffix = 'heatmap';
if (typeof value === 'number') {
if (normalizeAcross === 'x') {
percentage = value / totals.x[String(xValue)];
// Convert xValue to a key type (string or number) for totals lookup
const xKey = xValue as string | number;
percentage = value / totals.x[xKey];
suffix = formattedX;
} else if (normalizeAcross === 'y') {
percentage = value / totals.y[String(yValue)];
// Convert yValue to a key type (string or number) for totals lookup
const yKey = yValue as string | number;
percentage = value / totals.y[yKey];
suffix = formattedY;
} else {
percentage = value / totals.total;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CWE-1321: Generic Object Injection Sink vulnerability

Two instances of unsafe object property access using unsanitized keys (xKey and yKey) at lines 390 and 395. This creates a Generic Object Injection Sink vulnerability (CWE-1321). Validate or sanitize keys before using them for object property access.

Code suggestion
Check the AI-generated fix before applying
Suggested change
let suffix = 'heatmap';
if (typeof value === 'number') {
if (normalizeAcross === 'x') {
percentage = value / totals.x[String(xValue)];
// Convert xValue to a key type (string or number) for totals lookup
const xKey = xValue as string | number;
percentage = value / totals.x[xKey];
suffix = formattedX;
} else if (normalizeAcross === 'y') {
percentage = value / totals.y[String(yValue)];
// Convert yValue to a key type (string or number) for totals lookup
const yKey = yValue as string | number;
percentage = value / totals.y[yKey];
suffix = formattedY;
} else {
percentage = value / totals.total;
let suffix = 'heatmap';
if (typeof value === 'number') {
if (normalizeAcross === 'x') {
// Convert xValue to a key type (string or number) for totals lookup
const xKey = xValue as string | number;
if (Object.prototype.hasOwnProperty.call(totals.x, xKey)) {
percentage = value / totals.x[xKey];
}
suffix = formattedX;
} else if (normalizeAcross === 'y') {
// Convert yValue to a key type (string or number) for totals lookup
const yKey = yValue as string | number;
if (Object.prototype.hasOwnProperty.call(totals.y, yKey)) {
percentage = value / totals.y[yKey];
}
suffix = formattedY;
} else {
percentage = value / totals.total;

Code Review Run #4ef44b


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

The PR title and description indicate a small CSS fix to add top padding to the "Create new chart" button in the dashboard builder pane. However, the diff also contains substantial unrelated changes to the Heatmap chart's transformProps.ts and its test file.

Changes:

  • Adds sizeUnit * 3 top padding to NewChartButtonContainer in SliceAdder.tsx.
  • Refactors Heatmap transformProps to use xAxisColumnName/yAxisColumnName (from colnames) instead of getColumnLabel(xAxis/groupby) for tooltip totals lookup, removing related imports/destructuring.
  • Adds five new tests covering tooltip formatter behavior with various sort orders, percentage calculations, and numeric axes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
superset-frontend/src/dashboard/components/SliceAdder.tsx Adds top/bottom padding to the new-chart button container.
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts Switches tooltip totals lookup keys from form-data column labels to query colnames.
superset-frontend/plugins/plugin-chart-echarts/test/Heatmap/transformProps.test.ts Adds tooltip formatter tests across sort orders, normalization modes, and numeric axes.

Comment on lines +361 to +362
xAxisColumnName,
yAxisColumnName,
Comment on lines +386 to +389
expect(tooltipHtml).toContain('11');
// Should not contain raw indices
expect(tooltipHtml).not.toMatch(/\b1\s*\(/);
expect(tooltipHtml).not.toMatch(/\(\s*2\b/);
Comment on lines +526 to +527
expect(tooltipHtml).toContain('2021');
expect(tooltipHtml).toContain('2');
…er pane

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yousoph yousoph force-pushed the fix/dashboard-create-chart-button-spacing branch from 56e85a0 to 6cfb10d Compare May 14, 2026 00:29
@github-actions github-actions Bot removed the plugins label May 14, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.15%. Comparing base (62dc237) to head (13a1f99).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #40033   +/-   ##
=======================================
  Coverage   64.14%   64.15%           
=======================================
  Files        2590     2590           
  Lines      138104   138044   -60     
  Branches    32039    32028   -11     
=======================================
- Hits        88593    88560   -33     
+ Misses      47990    47966   -24     
+ Partials     1521     1518    -3     
Flag Coverage Δ
javascript 67.01% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 14, 2026

Code Review Agent Run #062977

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 6cfb10d..6cfb10d
    • superset-frontend/src/dashboard/components/SliceAdder.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@sadpandajoe sadpandajoe merged commit f8e1377 into master May 23, 2026
72 checks passed
@sadpandajoe sadpandajoe deleted the fix/dashboard-create-chart-button-spacing branch May 23, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard:design Related to the Dashboard UI/UX dashboard:editmode Related to te Dashboard edit mode preset-io size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants