Skip to content

feat(uploadDataModel): add data preview and guided tour to the file upload modal - #37791

Open
LuisSanchez wants to merge 6 commits into
apache:masterfrom
LuisSanchez:feat/improve-ux-upload-file
Open

LuisSanchez wants to merge 6 commits into
apache:masterfrom
LuisSanchez:feat/improve-ux-upload-file

Conversation

@LuisSanchez

@LuisSanchez LuisSanchez commented Feb 8, 2026 •

Copy link
Copy Markdown
Contributor

SUMMARY

Improve file uploader UI and UX

Added the following:

  • Onboarding tour: 5-step tour (file drop zone → preview → database → table name → Upload) built on antd's Tour, exposed through a new Tour wrapper in @superset-ui/core/components (with a Storybook story). Targets use type-specific data-tour IDs (csv, excel, columnar). No new dependencies.
  • Tour trigger: “?” icon next to the modal title starts the tour.
  • Data preview: “Preview data” button for CSV/Excel opens a modal with client-side parsing (no Parquet preview). The CSV parser handles quoted fields, the preview applies the header row / skip rows settings, and decoding follows the uploader's UTF-8 → windows-1252 fallback.
  • 5MB preview limit: For files > 5MB:
    • Disables “Preview data”.
    • Skips column metadata API calls.
    • Shows “Preview is not available for files larger than 5MB” in the columns section.
  • Fixed “Uploading a file is required” after selecting a file (correct validation via fileListRef).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

AFTER

preset-hackathon-after-1.mov

TESTING INSTRUCTIONS

  1. Go to "+" icon.
  2. Click on Upload CSV or Excel to database.
  3. For the Tour, click on the "?" icon.
  4. To add a new file drag and drop it into the section for uploading files.
  5. To preview the data, click on the "Preview data" button.

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

@bito-code-review

bito-code-review Bot commented Feb 8, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #3aee67

Actionable Suggestions - 0
Review Details
  • Files reviewed - 7 · Commit Range: c752309..c752309
    • superset-frontend/src/features/databases/UploadDataModel/ColumnsPreview.tsx
    • superset-frontend/src/features/databases/UploadDataModel/DataPreviewModal.test.tsx
    • superset-frontend/src/features/databases/UploadDataModel/DataPreviewModal.tsx
    • superset-frontend/src/features/databases/UploadDataModel/index.tsx
    • superset-frontend/src/features/databases/UploadDataModel/styles.ts
    • superset-frontend/src/features/databases/UploadDataModel/uploadDataModalTour.test.ts
    • superset-frontend/src/features/databases/UploadDataModel/uploadDataModalTour.ts
  • Files skipped - 2
    • superset-frontend/package-lock.json - Reason: Filter setting
    • superset-frontend/package.json - Reason: Filter setting
  • 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added change:frontend Requires changing the frontend data:csv Related to import/export of CSVs labels Feb 8, 2026
@sadpandajoe
sadpandajoe requested review from Copilot and geido February 10, 2026 22:17
@sadpandajoe sadpandajoe added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Feb 10, 2026
@github-actions github-actions Bot added 🎪 c752309 🚦 building 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Feb 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for c752309

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

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

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for c752309

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

rusackas pushed a commit that referenced this pull request Apr 17, 2026
- 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]>
rusackas pushed a commit that referenced this pull request Apr 22, 2026
- 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]>
@rusackas

Copy link
Copy Markdown
Member

Thanks @LuisSanchez! Is this something we're going to be following through on? It's gone conflicting, so it'll need a rebase on master. I'm also wondering about pulling in driver.js as a new dependency for the tour... is that the direction we want for sure or are there alternatives (maybe something we have already?)

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Aug 1, 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.

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.

@LuisSanchez

Copy link
Copy Markdown
Contributor Author

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.

@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; the CSV preview handles BOMs, encodings, quoting, and import row settings, with tests covering these cases.
  • The preview and upload metadata ignore stale results, and replacing a workbook clears its previous sheet selection.

Assessed commit: b4f4baadc4bb

@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.72932% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.01%. Comparing base (2911058) to head (df97a0e).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...d/src/features/databases/UploadDataModel/index.tsx 83.33% 20 Missing ⚠️
...tures/databases/UploadDataModel/ColumnsPreview.tsx 75.00% 1 Missing ⚠️
...res/databases/UploadDataModel/DataPreviewModal.tsx 98.41% 1 Missing ⚠️
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     
Flag Coverage Δ
hive 33.80% <ø> (ø)
javascript 82.84% <91.72%> (+0.02%) ⬆️
mysql 51.61% <ø> (?)
postgres 51.64% <ø> (?)
presto 35.50% <ø> (ø)
python 88.50% <ø> (+52.92%) ⬆️
sqlite 51.32% <ø> (?)
unit 84.03% <ø> (?)

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.

@github-actions github-actions Bot added the i18n Namespace | Anything related to localization label Nov 25, 2026
@LuisSanchez

Copy link
Copy Markdown
Contributor Author

Rebased onto current master and adapted to the lint rules added since this was opened (a11y fix for the dropzone "Select" control, Superset component wrappers instead of inline styles/direct antd imports), plus a regenerated messages.pot.

The only remaining CI failure is test-postgres → tests/integration_tests/datasets/api_tests.py::TestDatasetApi::test_duplicate_virtual_dataset (assert 'name' == 'id'). This PR only touches frontend files and the translation template; that test indexes new_dataset.columns[0]/[1] without an ordering guarantee, so it looks flaky, and the same workflow is green on master. Could a maintainer please re-run the failed jobs? I don't have rights to: https://github.com/apache/superset/actions/runs/45523084589

🤖 Generated with Claude Code

LuisSanchez and others added 5 commits November 24, 2026 23:00
- 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]>
…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]>
@LuisSanchez
LuisSanchez force-pushed the feat/improve-ux-upload-file branch from f54edee to b4f4baa Compare November 25, 2026 02:02
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Nov 25, 2026
… 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]>
@LuisSanchez

Copy link
Copy Markdown
Contributor Author

@rusackas thanks for both reviews. An update:

driver.js is gone. antd 6 (already a dependency) has a built-in Tour, so I added a thin Tour wrapper to @superset-ui/core/components (with a Storybook story and tests) and rebuilt the upload tour on it (df97a0e). The PR no longer changes package.json or the lockfile. Since the tour now renders inside the React tree, it follows the Superset theme and uses antd's localized button labels.

Your October review (b4f4baa):

  • CSV parsing: replaced the split-based logic with a quote-aware parser (filePreviewParsing.ts) that handles delimiters, line breaks and ""-escaped quotes inside quoted fields. I went with a small in-house parser rather than a library because no CSV parser is a dependency today, and it only has to read the first ~100 rows for the preview. If you'd prefer papaparse, I'm happy to switch.
  • Races: the preview parse is cancelled on cleanup, and stale file-metadata responses are ignored via a request id. Both have regression tests, and I checked that each test fails without its fix.
  • BOM and Excel coverage: the BOM is stripped, and the Excel preview (sheet selection, header handling) is tested with a mocked xlsx.
  • Also from the bot threads: the preview now applies header_row / skip_rows the way pandas does, decodes non-UTF-8 files the same way the uploader does, and clears a stale sheet_name when the workbook is replaced.

All review threads are answered and resolved. One note on CI: lint-frontend fails on src/pages/UsersList/UsersList.columnSizing.test.tsx, which is unrelated to this PR. It is also failing on master since #46317 made import/no-named-as-default an error.

🤖 Generated with Claude Code

@LuisSanchez LuisSanchez changed the title feat(uploadDataModel): add DataPreviewModal for file upload preview and integrate driver.js for guided tours feat(uploadDataModel): add data preview and guided tour to the file upload modal Nov 25, 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.

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,

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.

Without raw: false, date cells show up as Excel serial numbers (e.g. 45231) in the preview rather than dates.

Suggested change
blankrows: true,
blankrows: true,
raw: false,

Comment on lines +346 to +349
const startTour = () => {
setTourStep(0);
setTourOpen(true);
};

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.

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?

Suggested change
const startTour = () => {
setTourStep(0);
setTourOpen(true);
};
const startTour = () => {
setActiveKey('general');
setTourStep(0);
setTourOpen(true);
};

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend data:csv Related to import/export of CSVs i18n Namespace | Anything related to localization packages 🎪 🔒 showtime-blocked size/XXL 🎪 ⌛ 48h Environment expires after 48 hours (default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants