Skip to content

fix(drill-to-detail): align table headers with body columns - #44819

Closed
Krush1019 wants to merge 8 commits into
apache:masterfrom
Krush1019:fix/drill-detail-table-header-align
Closed

Krush1019 wants to merge 8 commits into
apache:masterfrom
Krush1019:fix/drill-detail-table-header-align

Conversation

@Krush1019

Copy link
Copy Markdown

SUMMARY

Fixes #43383

Drill to detail rendered its results with VirtualTable (Ant Design header plus a react-window body). The vertical scrollbar took width from the body only, so headers drifted from their cells, and long labels were clipped by ellipsis. Sticky-header fixes in the table chart do not apply here; this path does not use useSticky.

DrillDetailPane now uses the standard Table with sticky instead of virtualize and experimental resizable. Page size is small enough that virtualization is unnecessary, and a single table keeps headers and cells on the same column widths. The table fills the modal with a flex layout (min-height: 0, overflow hidden) and a measured body height, with a 400px fallback until the modal has been measured, so it does not grow to content height and then shrink.

Related table behavior:

  • Non-virtual tables with a body height scroll on both axes (scroll.y from the measured height, scroll.x: true).
  • VirtualTable still subtracts scrollbarSize from the last column so other callers stay aligned, hides header overflow, and no longer stretches the last column when the column list is empty. Virtual scroll width is true instead of 100vw, which broke alignment inside modals.
  • Temporal headers use HeaderWithRadioGroup with ellipsis and a title tooltip, and those columns are 200px wide so the formatting control fits.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: in the Drill to detail modal, column headers are offset from the cells beneath them. Long headers look cut off, and horizontal or vertical scrolling makes the mismatch worse. Row values still render correctly.

After: each header lines up with its column. Long labels ellipsize and show the full name on hover. Headers stay aligned while scrolling.

TESTING INSTRUCTIONS

  1. Open a dashboard or Explore view with a chart that supports Drill to detail.
  2. Right-click a data point (or use the chart menu) and choose Drill to detail.
  3. Confirm each column header lines up with the cells below it.
  4. Use a dataset with many columns and scroll horizontally. Headers and body should stay in sync.
  5. Use a result set that overflows the modal vertically and scroll the table body. The header row should stay visible and aligned.
  6. Include a temporal column. Confirm the formatting control is visible, the label ellipsizes when it is long, and hovering shows the full name. Switch between original and formatted values and confirm the column still aligns.
  7. Paginate and change page size. Confirm the table does not jump in height and headers stay aligned after each page change.
  8. Confirm CSV and Excel export still work when the user has download permission.

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

@netlify

netlify Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

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

Comment on lines +207 to +214
if (
isTemporal &&
timeFormatting[column] !== TimeFormatting.Original &&
(typeof value === "number" || value instanceof Date)
) {
return <TimeCell value={value} />;
}
return String(value);

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.

Suggestion: Temporal JSON values are usually strings, so formatted temporal cells bypass TimeCell and display the unformatted timestamp.

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Type error

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx
**Line:** 207:214
**Comment:**
	*Type Error: Temporal JSON values are usually strings, so formatted temporal cells bypass `TimeCell` and display the unformatted timestamp.

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.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Numeric and Date temporal cells already return TimeCell when formatted mode is on (DrillDetailPane.tsx around the column render). A string timestamp still goes through String(value), which is the same behavior as before this change. I am not changing that path in this pull request.

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.

✅ Customized review instruction saved!

Instruction:

Do not flag string temporal values bypassing TimeCell in DrillDetailPane; this existing behavior is intentionally unchanged.

Applied to:

  • superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx

💡 To manage or update this instruction, visit: CodeAnt AI Settings

Comment on lines 346 to 359
setResultsPages(
new Map([
...[...resultsPages.entries()].slice(-cachePageLimit + 1),
[
pageIndex,
{
total: response.total_count,
data: response.data,
colNames: ensureIsArray(response.colnames),
colTypes: ensureIsArray(response.coltypes),
},
],
]),
);

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.

Suggestion: An earlier request can populate the cleared cache after filters, page, or reload changes, showing stale rows and columns for the new query.

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Race condition

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx
**Line:** 346:359
**Comment:**
	*Race Condition: An earlier request can populate the cleared cache after filters, page, or reload changes, showing stale rows and columns for the new query.

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.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@bito-code-review bito-code-review Bot 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.

Code Review Agent Run #f84b36

Actionable Suggestions - 6
  • superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx - 1
  • superset-frontend/packages/superset-ui-core/src/components/Table/Table.test.tsx - 1
  • superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx - 1
  • superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx - 3
    • Double-quote imports violate formatter config · Line 19-30
    • Double-quote literals violate formatter config · Line 32-32
    • Quote style violates formatter · Line 245-261
Additional Suggestions - 4
  • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx - 1
    • any-typed rc-table info param · Line 247-247
      Line 247 types the rc-table info param as `any`, re-affirming the pattern the repo standard prohibits ('NO `any` types'). The looseness is deliberate (see the line-246 comment) for the `ref.current = connectObject` assignment, but a minimal inline type (`scrollbarSize?: number; ref: { current: unknown }; onScroll?: (...)`) preserves that compatibility while restoring real checking. Consider antd's exported `CustomizeScrollBody` info type if available.
  • superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.test.tsx - 1
    • Formatter standard violated · Line 19-19
      This diff converts the whole test file from single to double quotes and adds arrow parens (e.g. `.map((el) => ...)`), but the repo's enforced formatter `.oxfmtrc.json` sets `singleQuote: true` and `arrowParens: "avoid"`. The `oxfmt-frontend` pre-commit hook will auto-revert these, so the PR as-submitted fails the formatting gate and creates diff churn. Run `npx oxfmt --write` on the file.
  • superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx - 2
    • Duplicated scroll config · Line 442-442
      The non-virtual `StyledTable` now gets `scroll={bodyHeight ? { y: bodyHeight, x: true } : { x: true }}` while the virtual branch builds the same shape inline at lines 449-458. The two can silently diverge (the virtual branch already carries the WEBPACK_MODE test override). Extracting one shared `scroll` value keeps both table modes consistent.
    • Magic fallback height literal · Line 452-452
      The fallback `y: bodyHeight || 300` keeps a bare 300px literal. The file already names its other layout metrics (`HEADER_HEIGHT`, `PAGINATION_HEIGHT` at lines 163-164); a named constant here documents that 300 is the virtual-table fallback height and keeps the sizing knobs discoverable.
Review Details
  • Files reviewed - 7 · Commit Range: fbbb330..fbbb330
    • superset-frontend/packages/superset-ui-core/src/components/Table/Table.test.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx
    • superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx
    • superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.test.tsx
    • superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.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 an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@mattmc3

mattmc3 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

What does this offer over #44807?

@Krush1019

Copy link
Copy Markdown
Author

What does this offer over #44807?

#44807 keeps the virtual table and sizes the header scroll.x to the sum of the numeric column widths, so the header matches the react-window body.

This pull request takes the drill-to-detail modal off that path. DrillDetailPane renders the standard sticky Table instead of VirtualTable, so the header and body are one Ant Design table and share the same column widths. The page size is 50, so virtualization is unnecessary there. VirtualTable stays for other callers: its scroll width is true rather than 100vw, and the last column still accounts for the scrollbar gutter.

So #44807 fixes alignment inside the virtual table. This pull request removes the virtual table from the drill modal, which is where the header drift showed up.

…ss Table components

This commit updates the Table component and its related files to use single quotes consistently for string literals, enhancing code readability and maintainability. Additionally, minor adjustments were made to ensure uniformity in the formatting of props and comments throughout the codebase.
@pull-request-size pull-request-size Bot added size/L and removed size/XL labels Oct 1, 2026
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.72%. Comparing base (4cdd680) to head (73d5e74).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
superset/tags/models.py 85.71% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #44819   +/-   ##
=======================================
  Coverage   81.71%   81.72%           
=======================================
  Files        2978     2978           
  Lines      181613   181574   -39     
  Branches    41983    41965   -18     
=======================================
- Hits       148402   148386   -16     
+ Misses      30489    30469   -20     
+ Partials     2722     2719    -3     
Flag Coverage Δ
hive 36.66% <7.14%> (-0.01%) ⬇️
mysql 55.81% <64.28%> (-0.01%) ⬇️
postgres 55.81% <64.28%> (?)
presto 38.58% <64.28%> (+<0.01%) ⬆️
python 85.90% <85.71%> (+0.01%) ⬆️
sqlite 55.54% <64.28%> (-0.01%) ⬇️
unit 78.81% <85.71%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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

AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).

Bito Usage Guide

Commands

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

  • /review - Manually triggers an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

pkrushang and others added 2 commits October 1, 2026 14:40
…le component

This commit updates the Table component to use double quotes for string literals, enhancing code consistency. Minor adjustments were also made to improve formatting of props and comments throughout the codebase.

@bito-code-review bito-code-review Bot 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.

Code Review Agent Run #b8b5d9

Actionable Suggestions - 1
  • superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx - 1
Additional Suggestions - 2
  • superset/tags/models.py - 1
    • MySQL snapshot hides recovered tag · Line 168-168
      The recovery re-SELECT at line 169 is a consistent (non-locking) read. On MySQL, a supported metadata backend (`mysql` extra in pyproject.toml) whose default isolation is REPEATABLE READ, this session's read view was established earlier in the transaction (e.g. the target-object flush in `ObjectUpdater.after_insert`), so the row the concurrent request just committed may be invisible: the query returns None and line 171 re-raises `IntegrityError`, reintroducing exactly the failure this change fixes. The docstring's "the row the other request wrote is reloaded" only holds on READ COMMITTED backends like PostgreSQL. A locking read (`with_for_update()`) reads the latest committed version on both backends. ([CWE-754](https://cwe.mitre.org/data/definitions/754.html))
  • tests/unit_tests/tags/models_test.py - 1
    • Missing type annotations · Line 176-183
      New locals `mock_session`, `mock_query`, and `existing_tag` rely on inference, but BITO.md rules 12787/13153 require explicit annotations on test-file mocks and locals (e.g. `mock_session: MagicMock = MagicMock(spec=Session)`, `existing_tag: Tag`). Sibling tests share the gap, but this hunk introduces these declarations, so annotating here keeps the new code compliant.
Review Details
  • Files reviewed - 11 · Commit Range: fbbb330..acfd339
    • superset-frontend/playwright/components/modals/DrillDetailModal.ts
    • superset-frontend/playwright/tests/dashboard/drill-to-detail.spec.ts
    • superset/tags/models.py
    • tests/unit_tests/tags/models_test.py
    • superset-frontend/packages/superset-ui-core/src/components/Table/Table.test.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx
    • superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx
    • superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.test.tsx
    • superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • 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 an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

sticky={sticky}
// scroll.x splits the table into header and body copies. Only do that
// when a measured height needs an internal scroller (drill-to-detail).
scroll={bodyHeight ? { y: bodyHeight, x: true } : undefined}

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.

Removes horizontal scroll for consumers

Changing the no-height branch from { x: true } to undefined removes horizontal scrolling for every non-virtualized Table consumer that doesn't pass height — e.g. DatasetPanel, SemanticViewEditModal, and CollectionTable (verified: none pass height). Wide tables that previously scrolled horizontally will now overflow/clip. Consider keeping x: true or adding an explicit opt-in for the drill-to-detail behavior.

Code Review Run #b8b5d9


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

  • Yes, avoid them

}}
resizable
virtualize
sticky

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Switching to the non-virtual table makes HTML values display as literal markup even when allow_render_html is enabled: Table consumes allowHTML, but only VirtualTable applies safeHtmlSpan. Could the standard-table path preserve the conditional sanitized rendering so drill-detail links still work?

// count pill and the virtualized body both come from the loaded page.
const tableBody = modal.locator('.virtual-grid');
// Wait for the samples request to resolve into a rendered table body.
const tableBody = modal.locator('.ant-table-body');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Misaligned headers can still pass this test because it only checks body height and visible data. Could we use a fixture that overflows both axes and compare corresponding header/cell edges before and after scrolling, so the reported alignment regression is actually caught?

mock_session = MagicMock(spec=Session)
mock_query = MagicMock()
mock_session.query.return_value = mock_query
mock_session.begin_nested.return_value = nullcontext()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With nullcontext() and a mocked session, removing the savepoint while retaining the catch/reload would still pass, even though a real duplicate insert would leave the transaction unusable. Could a real-session regression interleave two creators of the same tag and assert that the losing session returns the existing tag, can commit its association, and preserves earlier outer-transaction work?

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 2, 2026

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Heya @Krush1019, thanks for digging into this one, and sorry for the slow turnaround. Since this was opened, #44807 landed on master and sorted out the header alignment inside VirtualTable (#43383 is closed now), and get_tag picked up its own savepoint handling on master too. GitHub shows conflicts here, so I'm wondering what's left in this PR that master doesn't already cover?

If you still think moving drill to detail off VirtualTable is worth doing, +1 to @sadpandajoe's point above about allow_render_html, as the standard table path never runs safeHtmlSpan. That would need sorting out before this could go in.

Otherwise, tempted to close this as superseded, but curious your thoughts.

@sadpandajoe

Copy link
Copy Markdown
Member

Thanks for working on this, @Krush1019! This PR is no longer needed: #43472 (merged 2026-11-19) made the same change on master. This PR can be closed.

@sadpandajoe sadpandajoe added the close:obsolete Obsolete: already fixed in master; a maintainer can close label Nov 19, 2026
@rusackas

Copy link
Copy Markdown
Member

Thanks for working on this, @Krush1019! #43472 landed the drill-to-detail header alignment fix on master, so I’m closing this one as superseded.

@rusackas rusackas closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

close:obsolete Obsolete: already fixed in master; a maintainer can close packages requires:rebase Requires rebasing on top of current master size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drill to detail: column headers misaligned with table body (headers truncated)

5 participants