Skip to content

fix(table): align group headers correctly when filtering time compari… - #37236

Merged
rusackas merged 1 commit into
apache:masterfrom
nitishagar:fix-37074
Jan 21, 2026
Merged

rusackas merged 1 commit into
apache:masterfrom
nitishagar:fix-37074

Conversation

@nitishagar

Copy link
Copy Markdown
Contributor

SUMMARY

When using Table charts with Time Comparison and filtering columns (showing only % diff, collapsing groups, etc.), the group headers would become misaligned with the actual data columns.

Root cause: Two issues in header rendering logic:

  1. groupHeaderColumns was computed from filteredColumnsMeta while getColumnConfigs used visibleColumnsMeta (which also filters out config.visible === false)
  2. Object.entries iteration didn't ensure correct visual column order

Fix:

  • Move visibleColumnsMeta definition earlier and use it for groupHeaderColumns
  • Sort Object.entries by startPosition before rendering headers
  • Update renderGroupingHeaders lookup to use visibleColumnsMeta for consistency

Added test case to verify header alignment when columns are hidden via config.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A - This is a logic fix. The visual result is that group headers now correctly align with their respective data columns when filtering time comparison columns.

TESTING INSTRUCTIONS

  1. Create a Table chart with 3+ metrics and Time Comparison enabled
  2. Filter to show only "%" columns - verify headers align correctly with data
  3. Collapse first metric group - verify remaining headers align correctly
  4. Try various combinations of filtering and collapsing groups

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Wrong group names in Table Time Comparison when not showing all columns #37074
  • 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

Fixes #37074

…son columns

When using Table charts with Time Comparison and filtering columns (showing only
% diff, collapsing groups, etc.), the group headers would become misaligned with
the actual data columns.

Root cause: Two issues in header rendering logic:
1. groupHeaderColumns was computed from filteredColumnsMeta while getColumnConfigs
   used visibleColumnsMeta (which also filters out config.visible === false)
2. Object.entries iteration didn't ensure correct visual column order

Fix:
- Move visibleColumnsMeta definition earlier and use it for groupHeaderColumns
- Sort Object.entries by startPosition before rendering headers
- Update renderGroupingHeaders lookup to use visibleColumnsMeta for consistency

Added test case to verify header alignment when columns are hidden via config.

Fixes apache#37074
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

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 ·
Reddit ·
LinkedIn

@bito-code-review

bito-code-review Bot commented Jan 19, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #141e04

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: e068057..e068057
    • superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
    • superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx
    • superset-frontend/plugins/plugin-chart-table/test/testData.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • 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

@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt AI finished reviewing your PR.

@netlify

netlify Bot commented Jan 19, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit e068057
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/696dc0de01039d0008000c04
😎 Deploy Preview https://deploy-preview-37236--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

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.

Pull request overview

This PR fixes a bug where group headers in Table charts with Time Comparison would become misaligned with data columns when filtering or hiding specific comparison columns.

Changes:

  • Moved visibleColumnsMeta computation earlier in the code to ensure consistent column indexing
  • Updated groupHeaderColumns to use visibleColumnsMeta instead of filteredColumnsMeta for accurate header positioning
  • Added sorting of group header entries by column position to maintain correct left-to-right order
  • Added comprehensive test case to verify header alignment with hidden columns

Reviewed changes

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

File Description
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx Fixed header alignment logic by using visibleColumnsMeta consistently and sorting header entries by position
superset-frontend/plugins/plugin-chart-table/test/testData.ts Added test data with hidden comparison columns to reproduce issue #37074
superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx Added test case validating correct group header alignment and colSpan values when columns are hidden

@SBIN2010 SBIN2010 added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Jan 21, 2026
@github-actions github-actions Bot added 🎪 e068057 🚦 building 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Jan 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for e068057

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for e068057

• Environment: http://54.201.231.61:8080 (admin/admin)
• Lifetime: 48h auto-cleanup
• Updates: New commits create fresh environments automatically

@SBIN2010 SBIN2010 left a comment

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.

LGTM! Thank you for the contribution!

@rusackas
rusackas merged commit 17d6f4e into apache:master Jan 21, 2026
83 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong group names in Table Time Comparison when not showing all columns

6 participants