Repository navigation
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| if ( | ||
| isTemporal && | ||
| timeFormatting[column] !== TimeFormatting.Original && | ||
| (typeof value === "number" || value instanceof Date) | ||
| ) { | ||
| return <TimeCell value={value} />; | ||
| } | ||
| return String(value); |
There was a problem hiding this comment.
Suggestion: Temporal JSON values are usually strings, so formatted temporal cells bypass TimeCell and display the unformatted timestamp.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Type error
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 fixThere was a problem hiding this comment.
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.
There was a problem hiding this comment.
✅ 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
| setResultsPages( | ||
| new Map([ | ||
| ...[...resultsPages.entries()].slice(-cachePageLimit + 1), | ||
| [ | ||
| pageIndex, | ||
| { | ||
| total: response.total_count, | ||
| data: response.data, | ||
| colNames: ensureIsArray(response.colnames), | ||
| colTypes: ensureIsArray(response.coltypes), | ||
| }, | ||
| ], | ||
| ]), | ||
| ); |
There was a problem hiding this comment.
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
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…ix/drill-detail-table-header-align
There was a problem hiding this comment.
Code Review Agent Run #f84b36
Actionable Suggestions - 6
-
superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx - 1
- Quote style inconsistency · Line 19-21
-
superset-frontend/packages/superset-ui-core/src/components/Table/Table.test.tsx - 1
- Quote style violates formatter · Line 19-21
-
superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx - 1
- Quote style violates formatter · Line 20-21
-
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-247Line 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-19This 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-442The 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-452The 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
|
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.
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR). Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…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.
There was a problem hiding this comment.
Code Review Agent Run #b8b5d9
Actionable Suggestions - 1
-
superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx - 1
- Removes horizontal scroll for consumers · Line 444-444
Additional Suggestions - 2
-
superset/tags/models.py - 1
-
MySQL snapshot hides recovered tag · Line 168-168The 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-183New 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
| 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} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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?
rusackas
left a comment
There was a problem hiding this comment.
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.
|
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. |
|
Thanks for working on this, @Krush1019! #43472 landed the drill-to-detail header alignment fix on |
SUMMARY
Fixes #43383
Drill to detail rendered its results with
VirtualTable(Ant Design header plus areact-windowbody). 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 useuseSticky.DrillDetailPanenow uses the standardTablewithstickyinstead ofvirtualizeand experimentalresizable. 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:
scroll.yfrom the measured height,scroll.x: true).VirtualTablestill subtractsscrollbarSizefrom 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 istrueinstead of100vw, which broke alignment inside modals.HeaderWithRadioGroupwith ellipsis and atitletooltip, 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
ADDITIONAL INFORMATION