Guided tours for the Datafile Hub, and a --no-tours flag - #896
Open
Felipedino wants to merge 2 commits into
Open
Felipedino wants to merge 2 commits into
Felipedino wants to merge 2 commits into
Conversation
- Introduced new tours for the hub and hub import functionalities, including their respective steps and configurations. - Created tests for the hub tours to ensure proper registration, localization, and functionality. - Updated the tour context in HubContent and HubImportPage to integrate the new tours. - Added localization files for English, Spanish, Portuguese, German, and Chinese for the hub tour. - Implemented caching behavior in the dataset source API tests to ensure loader cache is managed correctly during datafile imports.
On a fresh machine every section opens its guided tour on first visit, which gets in the way of demos. `python -m DashAI --no-tours` (or DASHAI_NO_TOURS=1) now keeps them closed app-wide; the navbar help button still starts any tour on demand. - CLI: --no-tours / -nt sets DASHAI_NO_TOURS. - Backend: GET /api/v1/app-config exposes tours_autostart. - Frontend: useTour checks it once per load before auto-starting, falling back to the usual behaviour if the backend can't be reached. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Datafile Hub (
/app/data/hub) was the only part of the Data module without a guided tour. This PR adds two interactive tours. The user does the real clicks and the tour advances on its own:hub(9 steps,/app/data/hub): pick a source, search, select a dataset, download it and add it to dashAI.hubImport(10 steps,/app/data/hub/import/:id): pick the file, the DataLoader, review the preview and import it as a dataset.Both walk through a fixed example: HuggingFace →
scikit-learn/iris→Iris.csv→ CSV Data Loader. It needs no credentials and downloads in seconds. OpenML was the first choice, but its API was returning 503 during testing, so relying on it would make the tour fragile.While testing the tours end to end, three more things came up and are fixed here:
temp_path.CSVDataLoaderuses it as the HuggingFacedatasetscache_dir, so after one import the file picker listedcsv\default-…\csv-train.arrowanddataset_info.jsonnext toIris.csv. Both paths now use a temporary directory.zIndexas the X and comes later in the DOM, so it covered the button's centre. Only its corners were clickable.python -m DashAI --no-tours(orDASHAI_NO_TOURS=1) now stops them from opening automatically. The navbar help button still starts any tour on demand.Type of Change
Changes (by file)
Tour infrastructure
front/src/components/tour/tourUtils.js(new): helpers for multi-screen tours.isTourAtTargetguards asynchronous advances (search results, downloads) so they only move the tour from the step they belong to.useTourStageSync: steps can declare astage. When the user changes screen (route or wizard step), or relaunches the tour from a later screen, the tour jumps to the first step of that stage once its target renders. This replaces ad-hocMutationObservers.front/src/hooks/useTour.js,front/src/components/tour/TourProvider.jsx: exposemarkTourAsCompletedin the tour context. Both new tours end with a click that navigates away, so without it they would never be marked as seen and would reopen.front/src/components/tour/CustomTooltip.jsx: raise the close button above the step counter and content, and pad the counter so they don't overlap.Hub tours
front/src/constants/tours/hubTour.js,hubImportTour.js(new),index.js: step definitions, registered asTOUR_KEYS.HUBandTOUR_KEYS.HUB_IMPORT.front/src/pages/hub/HubContent.jsx:hubTourProviderand advances the tour on source, dataset and download actions.front/src/pages/hub/HubImportPage.jsx: mounts thehubImportprovider only once the datafile is ready, so the tour doesn't auto-start over the loading spinner.front/src/components/hub/HubImportPanel.jsx: tour anchors, and advances on file and DataLoader selection. It marks the tour as completed after a successful import.front/src/components/hub/DatasetGrid.jsx,DatasetCard.jsx,DatasetDetail.jsx,DatafileInfoPanel.jsx:data-touranchors. The search step spotlights both the search and tag fields.front/src/components/custom/ComponentDetailsPanel.jsx,threeSectionLayout/CollapsibleList.jsx,notebooks/DatasetNotebookLeftBar.jsx: optionaldataTourprop / anchor.front/src/utils/i18n/locales/{en,es,pt,de,zh}/hubTour.json(new),utils/i18n/index.js: tour texts, which use the same button and loader labels shown in the UI.Loader cache fix
back/job/dataset_job.py: the hub import path loads into atempfile.mkdtemp()directory. The existingfinallyremoves it after the dataset is saved; the loaded dataset is backed by that cache until then.back/api/api_v1/endpoints/dataset_source.py: the preview fallback loads inside aTemporaryDirectory.--no-toursflagDashAI/__main__.py: new--no-tours/-ntoption that setsDASHAI_NO_TOURS=1.back/api/api_v1/endpoints/app_config.py(new),api.py:GET /api/v1/app-configreturns{"tours_autostart": bool}.front/src/api/appConfig.ts(new): fetches the config once per page load. If the backend can't be reached, tours keep the usual behaviour.front/src/hooks/useTour.js: checkstours_autostartbefore auto-starting a tour.Tests
front/src/constants/tours/hubTours.test.js: every step has a valid target, and its text exists in all five locales. Also covers thetourUtilshelpers.front/src/hooks/useTour.test.js: a tour auto-starts, stays closed with--no-tours, can still be started manually, and stays closed once completed.tests/back/api/test_dataset_source_api.py: preview and import with a loader that writes cache intotemp_pathleave the datafile folder untouched. Both tests fail without the fix.tests/back/api/test_app_config_api.py:DASHAI_NO_TOURSparsing.Testing
Automated: frontend 256/256 tests pass; backend dataset-source, dataset-job and app-config tests pass; ruff, eslint and prettier are clean.
Both tours were also run end to end in the browser. To try them:
hubandhubImportfromlocalStorage["dashai_tours_completed"](or use a fresh profile)./app/data/hub. Thehubtour starts.scikit-learn/iris→ select the card → Download to dashAI → Add to dashAI.hubImporttour starts on the import page:Iris.csv→ CSV Data Loader → preview → Import Datafile.irisdataset is created (150 rows);Iris.csvanddatabase.sqlite, with no cache files;For the flag, start the app with
uv run python -m DashAI --no-toursand open a section you haven't visited: no tour should open, and the navbar help button should still start it.Notes
80877c021), so these tours only run when the Hub is reached directly. Nothing in this PR re-enables it.scikit-learn/irisbeing reachable. If the search returns nothing, the user can skip the tour with the usual button.--no-toursonly affects auto-start. It doesn't mark tours as seen, so starting without the flag later behaves as before.🤖 Generated with Claude Code