Repository navigation
feat(uploadDataModel): add data preview and guided tour to the file upload modal - #37791
LuisSanchez wants to merge 6 commits into
Conversation
Code Review Agent Run #3aee67Actionable Suggestions - 0Review Details
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 |
There was a problem hiding this comment.
Pull request overview
Improves the Upload Data Model modal UX by adding an onboarding tour (driver.js), a client-side “data preview” modal for CSV/Excel uploads, and additional UX safeguards (5MB preview limit + validation fix).
Changes:
- Add a driver.js guided tour for CSV/Excel/Columnar upload flows and a “?” trigger in the modal header.
- Add a DataPreviewModal with client-side parsing for CSV/Excel (row-limited), and disable preview/metadata fetch for files > 5MB.
- Update the uploader UI to use a drag-and-drop dropzone and fix file-required validation using a fileList ref.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| superset-frontend/src/features/databases/UploadDataModel/uploadDataModalTour.ts | Adds driver.js tour step definitions + tour start helper. |
| superset-frontend/src/features/databases/UploadDataModel/uploadDataModalTour.test.ts | Unit tests for tour configuration and selectors. |
| superset-frontend/src/features/databases/UploadDataModel/styles.ts | Adds styled wrapper for the new Upload.Dragger dropzone styling. |
| superset-frontend/src/features/databases/UploadDataModel/index.tsx | Integrates tour trigger/auto-start, preview modal, 5MB gating, drag-and-drop upload UI, and validation fix. |
| superset-frontend/src/features/databases/UploadDataModel/DataPreviewModal.tsx | Implements CSV/Excel client-side parsing and renders preview table in a modal. |
| superset-frontend/src/features/databases/UploadDataModel/DataPreviewModal.test.tsx | Adds unit tests for the preview modal (primarily CSV). |
| superset-frontend/src/features/databases/UploadDataModel/ColumnsPreview.tsx | Adds “file too large” messaging support for column preview section. |
| superset-frontend/package.json | Adds driver.js dependency. |
| superset-frontend/package-lock.json | Locks driver.js dependency. |
Files not reviewed (1)
- superset-frontend/package-lock.json: Language not supported
|
🎪 Showtime deployed environment on GHA for c752309 • Environment: http://52.12.205.9:8080 (admin/admin) |
- theming.mdx: document brandAppName theme token (PR #37370) — controls app name in browser title/nav/emails, takes precedence over APP_NAME config - cache.mdx: document SUPERSET_CACHE_WARMUP_USER config key (PR #38449) — controls the user account Selenium WebDriver authenticates as for thumbnail rendering and cache warmup; update selenium → Selenium capitalization - security.mdx: document missing SQL Lab RBAC permissions (PR #36263) — can_estimate_query_cost and can_format_sql must be explicitly granted - sql-templating.mdx: document Jinja support in calculated columns (PR #37791) with examples; add tip that "Format SQL" is Jinja-aware and dialect-specific (PRs #36277, #39393) - creating-your-first-dashboard.mdx: document dashboard tab URLs (#38660), auto-refresh (#37459), "Last queried at" timestamp (#36934), and tab selection when saving charts to dashboards (#36332) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- theming.mdx: document brandAppName theme token (PR #37370) — controls app name in browser title/nav/emails, takes precedence over APP_NAME config - cache.mdx: document SUPERSET_CACHE_WARMUP_USER config key (PR #38449) — controls the user account Selenium WebDriver authenticates as for thumbnail rendering and cache warmup; update selenium → Selenium capitalization - security.mdx: document missing SQL Lab RBAC permissions (PR #36263) — can_estimate_query_cost and can_format_sql must be explicitly granted - sql-templating.mdx: document Jinja support in calculated columns (PR #37791) with examples; add tip that "Format SQL" is Jinja-aware and dialect-specific (PRs #36277, #39393) - creating-your-first-dashboard.mdx: document dashboard tab URLs (#38660), auto-refresh (#37459), "Last queried at" timestamp (#36934), and tab selection when saving charts to dashboards (#36332) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Thanks @LuisSanchez! Is this something we're going to be following through on? It's gone conflicting, so it'll need a rebase on |
There was a problem hiding this comment.
Checked parseCSV directly since it's central to what this feature does, and the bot's right to flag it: text.split(/\r?\n/) splits on every newline including ones inside a quoted field, and row.split(delimiter) does the same for the delimiter, so any real-world CSV with a quoted field containing a comma or an embedded newline (extremely common in exports from Excel/Sheets/databases) will mis-parse into the wrong number of columns. Worth switching to a real CSV parser rather than hand-rolled splitting, especially since this is a preview meant to build user trust before they commit to the upload.
The race-condition point (stale async parse/metadata response overwriting newer state after a fast file swap or modal close) showed up independently across three different threads with the same mechanism each time, which is a good sign it's real. Worth an effect cleanup/abort guard.
No human review yet after 8 months and 7 open threads. The BOM-stripping and Excel-test-coverage ones are also fair asks, just didn't verify those myself.
Hey! Sorry that I missed the previous comment, I can rebase and verify if this is still worth the new dependency or if there is something already in the repo. |
c752309 to
615b4eb
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #37791 +/- ##
===========================================
+ Coverage 56.67% 86.01% +29.34%
===========================================
Files 3130 3133 +3
Lines 217962 218179 +217
Branches 51682 51753 +71
===========================================
+ Hits 123528 187671 +64143
+ Misses 93238 27086 -66152
- Partials 1196 3422 +2226
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:
|
|
Rebased onto current The only remaining CI failure is 🤖 Generated with Claude Code |
…nd integrate driver.js for guided tours
- Use a Button for the "Select" link inside the dropzone instead of a label/span with click handlers (jsx-a11y) - Import ColumnsType from @superset-ui/core/components instead of antd - Build the modal title as an element instead of a component recreated on every render Co-Authored-By: Claude Opus 5.5 <[email protected]>
…styles in preview Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eads Address review feedback on the client-side preview and file metadata flow: - Parse CSV with quote support (delimiters, line breaks and escaped quotes inside quoted fields) instead of splitting on the delimiter - Decode CSV as UTF-8, falling back to windows-1252 like the uploader's encoding detection, and strip a UTF-8 byte order mark - Apply header_row and skip_rows to the preview the way pandas does - Ignore preview parses superseded by a newer file, option or close - Ignore file metadata responses for a file that has since been replaced - Clear sheet names and the selected sheet when a new file is chosen, so a stale sheet_name is never submitted - Key preview rows by column position so duplicate headers don't collide - Cover Excel preview, parsing edge cases and both races with tests Co-Authored-By: Claude Opus 5.5 <[email protected]>
f54edee to
b4f4baa
Compare
… of driver.js Drop the driver.js dependency and use antd's built-in Tour, exposed through a new Tour wrapper in @superset-ui/core/components (with a story and tests). The tour now renders inside the React tree, follows the Superset theme and uses antd's localized button labels. The modal owns the tour's open state and current step, so reopening the tour always starts from the first step, and closing the modal closes it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@rusackas thanks for both reviews. An update:
Your October review (b4f4baa):
All review threads are answered and resolved. One note on CI: 🤖 Generated with Claude Code |
rusackas
left a comment
There was a problem hiding this comment.
Thanks @LuisSanchez, appreciate you sticking with this one. I don't feel strongly on the parser question... the in-house one seems OK for a 100-row preview, but @michael-s-molina @villebro @eschutho @sadpandajoe, any opinions on papaparse vs. rolling our own here?
One thing before approving: the 5MB check also skips the /upload_metadata/ call, so a large Excel file loses its sheet names and column dropdowns, which work today. Since that part is server-side, I think the limit should only gate the preview. Thoughts?
Also, messages.pot picked up some python-format flag churn on unrelated strings, probably from a different babel version. Mind regenerating it from current master?
| const rows = XLSX.utils.sheet_to_json<PreviewCell[]>(sheet, { | ||
| header: 1, | ||
| defval: '', | ||
| blankrows: true, |
There was a problem hiding this comment.
Without raw: false, date cells show up as Excel serial numbers (e.g. 45231) in the preview rather than dates.
| blankrows: true, | |
| blankrows: true, | |
| raw: false, |
| const startTour = () => { | ||
| setTourStep(0); | ||
| setTourOpen(true); | ||
| }; |
There was a problem hiding this comment.
The Collapse is an accordion, so if someone has File settings open when they hit the "?", the general panel is hidden and the first four steps point at nothing. Maybe reopen it here?
| const startTour = () => { | |
| setTourStep(0); | |
| setTourOpen(true); | |
| }; | |
| const startTour = () => { | |
| setActiveKey('general'); | |
| setTourStep(0); | |
| setTourOpen(true); | |
| }; |
SUMMARY
Improve file uploader UI and UX
Added the following:
Tour, exposed through a newTourwrapper in@superset-ui/core/components(with a Storybook story). Targets use type-specific data-tour IDs (csv, excel, columnar). No new dependencies.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
AFTER
preset-hackathon-after-1.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION