You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "vighneshtule (via GitHub)" <gi...@apache.org> on 2026/01/04 17:05:48 UTC
[PR] fix#31033: add 20px default padding to match other charts [superset]
vighneshtule opened a new pull request, #36895:
URL: https://github.com/apache/superset/pull/36895
### SUMMARY
This PR resolves an inconsistency in the default padding of Table charts compared to other chart types (like ECharts). Previously, Table charts rendered edge-to-edge within their containers (0px padding), causing visual misalignment when placed alongside other charts which typically have a default 20px padding.
**Changes:**
- Added `20px` (via `theme.sizeUnit * 5`) padding to the Table chart container in [Styles.tsx](cci:7://file:///d:/V/superset/superset-frontend/plugins/plugin-chart-table/src/Styles.tsx:0:0-0:0).
- Updated [TableChart.tsx](cci:7://file:///d:/V/superset/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:0:0-0:0) to subtract this 40px total horizontal/vertical padding from the width and height passed to the virtualized [DataTable](cci:2://file:///d:/V/superset/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx:58:0-93:1) component. This ensures the table renders correctly within the new padded area without overflowing or causing unnecessary scrollbars.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
**After (Verified Padding):**
<img width="1885" height="918" alt="Screenshot 2026-01-04 221644" src="https://github.com/user-attachments/assets/0d4db460-61af-4335-a4c4-1ab38f427fb9" />
### TESTING INSTRUCTIONS
1. Open a Dashboard in Superset.
2. Add a **Table** chart.
3. Add a **Bar** chart (or any ECharts chart) next to it for comparison.
4. **Verify**: The Table chart should now have ~20px padding between the card edge and the table content, visually matching the spacing of the Bar chart.
5. **Verify**: Ensure the table fits within the container and no unexpected scrollbars appear unless the data actually overflows.
### ADDITIONAL INFORMATION
- [ ] Has associated issue: Fixes #31033
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix#31033: add 20px default padding to match other charts [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-3708256626
## Nitpicks π
<table>
<tr><td>π <strong>No security issues identified</strong></td></tr>
<tr><td>β‘ <strong>Recommended areas for review</strong><br><br>
- [ ] <a href='https://github.com/apache/superset/pull/36895/files#diff-d987d4addee4ccb4cccae5bb4376bdf7915776d6e8631f9a777abfa98c08c9a0R1413-R1414'><strong>Negative size risk</strong></a><br>Subtracting padding from measured table sizes can produce negative/very small width or height values (table initial state is 0). Passing negative sizes to the virtualized DataTable may cause layout glitches or unexpected behavior. Clamp computed sizes to >= 0 before passing to child components.<br>
- [ ] <a href='https://github.com/apache/superset/pull/36895/files#diff-d987d4addee4ccb4cccae5bb4376bdf7915776d6e8631f9a777abfa98c08c9a0R1413-R1422'><strong>Inconsistent layout inputs</strong></a><br>The DataTable dimensions now use adjusted content size (widthFromState - padding) while other layout decisions (e.g., maxPageItemCount) still use the original `width` prop. This can cause inconsistent behavior/line-wrapping between the table body and controls. Consider computing a single adjusted content width/height and reuse it across layout logic.<br>
- [ ] <a href='https://github.com/apache/superset/pull/36895/files#diff-3a1680cdfe4669587cb7013f1f21b93a0ea2d049aa110e2e34bd16aa733c7607R24-R24'><strong>Layout / overflow</strong></a><br>Adding padding to the top-level chart container increases the element's total size; if the container or table children use width: 100% and the box-sizing is content-box (default), the padding will cause overflow and can produce horizontal/vertical scrollbars. Verify the table rendering and the JS sizing logic consider padding (or set box-sizing to border-box) so the table fits reliably without visual regressions.<br>
</td></tr>
</table>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix#31033: add 20px default padding to match other charts [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-3708254892
CodeAnt AI is reviewing your PR.
---
### Thanks for using CodeAnt! π
We're free for open-source projects. if you're enjoying it, help us grow by sharing.
[Share on X](https://twitter.com/intent/tweet?text=Just%20tried%20%40CodeAntAI%20for%20automated%20code%20review%20and%20I%27m%20impressed%21%20Free%20for%20open%20source%20with%20a%20free%20trial%20for%20private%20repos.%20Worth%20checking%20out%3A&url=https%3A//codeant.ai) Β·
[Reddit](https://www.reddit.com/submit?title=Check%20out%20CodeAnt%20for%20automated%20code%20review&text=Just%20tried%20CodeAnt%20for%20automated%20code%20review%20and%20I%27m%20impressed%21%20Free%20for%20open%20source%20with%20a%20free%20trial%20for%20private%20repos.%20Worth%20checking%20out%3A%20https%3A//codeant.ai) Β·
[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcodeant.ai&mini=true&title=Check%20out%20CodeAnt%20for%20automated%20code%20review&summary=Just%20tried%20CodeAnt%20for%20automated%20code%20review%20and%20I%27m%20impressed%21%20Free%20for%20open%20source%20with%20a%20free%20trial%20for%20private%20repos)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): add default padding to match other charts [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-4699013814
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/36895?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 64.28%. Comparing base ([`b05fe48`](https://app.codecov.io/gh/apache/superset/commit/b05fe4857e50bd28332f80ab8e881bd92b7b3fd1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`fde07c0`](https://app.codecov.io/gh/apache/superset/commit/fde07c0eb925cabd8b67771d13a24f4255d64f93?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #36895 +/- ##
=======================================
Coverage 64.28% 64.28%
=======================================
Files 2659 2659
Lines 144304 144304
Branches 33260 33260
=======================================
Hits 92773 92773
Misses 49902 49902
Partials 1629 1629
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/36895/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/36895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `68.25% <ΓΈ> (ΓΈ)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/36895?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix#31033: add 20px default padding to match other charts [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-3708254950
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): add default padding to match other charts [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-4699442294
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix#31033: add 20px default padding to match other charts [superset]
Posted by "vighneshtule (via GitHub)" <gi...@apache.org>.
vighneshtule commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-3716584667
@rusackas this is the before ss where the table was not center aligned as mentioned in issue #31033
<img width="1074" height="473" alt="389122560-a7ccb4a3-04e4-43ec-9fcd-42d91f05174a" src="https://github.com/user-attachments/assets/5cd95dbf-6523-4af2-8934-78848263f603" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix#31033: add 20px default padding to match other charts [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-3708320012
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): add default padding to match other charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-4698985494
Thanks @vighneshtule, but this one still needs some tweaks.
The PR Lint lint-check and sharded-jest-tests are failing (likely a snapshot/test affected by the new padding)
Per CodeAnt please clamp the width/height passed to DataTable to >= 0, since subtracting padding from the 0 initial table size can yield negative dimensions.
Ping us once it's green, and we'll come review again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix#31033: add 20px default padding to match other charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-3711415260
running CI π€ Do you have a "before" pic by any chance?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix#31033: add 20px default padding to match other charts [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #36895:
URL: https://github.com/apache/superset/pull/36895#discussion_r2659800591
##########
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:
##########
@@ -1410,8 +1410,8 @@ export default function TableChart<D extends DataRecord = DataRecord>(
pageSize={pageSize}
serverPaginationData={serverPaginationData}
pageSizeOptions={pageSizeOptions}
- width={widthFromState}
- height={heightFromState}
+ width={widthFromState - theme.sizeUnit * 10}
+ height={heightFromState - theme.sizeUnit * 10}
Review Comment:
**Suggestion:** Passing potentially negative width/height to `DataTable` can produce invalid layout or runtime assumptions; clamp the computed size to zero so negative values are never passed. Use Math.max(0, ...) when subtracting padding. [logic error]
**Severity Level:** Minor β οΈ
```suggestion
width={Math.max(0, widthFromState - theme.sizeUnit * 10)}
height={Math.max(0, heightFromState - theme.sizeUnit * 10)}
```
<details>
<summary><b>Why it matters? β </b></summary>
This is a valid and pragmatic safety improvement β tableSize initializes at 0 so subtracting theme.sizeUnit * 10 can produce negative values on first render. Clamping to Math.max(0, ...) prevents passing negative sizes to DataTable which could produce invalid layout or runtime issues. It's a small, safe change that doesn't require broader refactors.
</details>
<details>
<summary><b>Prompt for AI Agent π€ </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
**Line:** 1413:1414
**Comment:**
*Logic Error: Passing potentially negative width/height to `DataTable` can produce invalid layout or runtime assumptions; clamp the computed size to zero so negative values are never passed. Use Math.max(0, ...) when subtracting padding.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix#31033: add 20px default padding to match other charts [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #36895:
URL: https://github.com/apache/superset/pull/36895#issuecomment-3708256663
CodeAnt AI finished reviewing your PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): add default padding to match other charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #36895:
URL: https://github.com/apache/superset/pull/36895
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org