Default names in forms#306
Conversation
…based on existing notebooks
…otebooks into notebook creation flow
…to new experiment modal
…to prediction modal and table
…and update imports
…eGenerator module
… merging in useFormSchema hook
…ate name generation imports
… validation in modals
…ctModelStep component
…sistent dataset naming
…nsistent notebook naming
…consistent experiment naming
…stent model naming
…consistent prediction naming
…iments, models, notebooks, and predictions to consolidate naming logic
…optional run_id parameter
…inerModal and NewLocalExplainerModal
…in NewPipeline and PipelineToolbar
… handle requests correctly
…ponents for improved clarity and consistency Remove state NewDataset in UploadDatasetSteps and manage state locally in SelectDataloaderStep and ConfigureAndUploadDatasetStep Other small tweaks: remove unused params and variables
…otebookSteps component
There was a problem hiding this comment.
Pull Request Overview
This PR implements automatic sequential name generation across multiple modules in the DashAI front-end application to enhance user experience. The implementation adds a centralized utility function and updates dataset, notebook, experiment, prediction, pipeline, and generative modules to provide meaningful default names that automatically avoid naming conflicts.
- New
nameGenerator.jsutility: Creates a reusablegenerateSequentialName()function for consistent naming patterns - Module-wide default naming: Implements auto-naming in datasets, notebooks, experiments, predictions, pipelines, and generative sessions
- Enhanced validation: Adds proper name validation with error messages and conflict prevention across all modules
Reviewed Changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| DashAI/front/src/utils/nameGenerator.js | New utility function for sequential name generation |
| DashAI/front/src/pages/predictions/PredictionPage.jsx | Adds prediction data fetching and passes existing predictions to modal |
| DashAI/front/src/pages/pipelines/NewPipeline.jsx | Integrates name validation props for pipeline creation |
| DashAI/front/src/pages/generative/Generative.jsx | Passes existing sessions to model selection menu |
| DashAI/front/src/pages/experiments/Experiments.jsx | Updates to fetch and manage experiments data for name generation |
| DashAI/front/src/pages/datasets/Datasets.jsx | Passes existing datasets/notebooks to creation components |
| DashAI/front/src/hooks/usePipelineState.js | Implements pipeline name generation and validation logic |
| DashAI/front/src/hooks/useFormSchema.js | Merges default values with initial values for better form handling |
| DashAI/front/src/components/shared/FormSchemaRenderFields.jsx | Removes unused React import |
| DashAI/front/src/components/shared/FormSchemaButtonGroup.jsx | Removes unused imports |
| DashAI/front/src/components/shared/FormSchema.jsx | Removes unused React import and cleans formatting |
| DashAI/front/src/components/predictions/SelectModelStep.jsx | Adds default prediction name handling and validation |
| DashAI/front/src/components/predictions/PredictionTable.jsx | Refactors to use predictions prop instead of internal state |
| DashAI/front/src/components/predictions/PredictionModal.jsx | Implements default prediction name generation |
| DashAI/front/src/components/pipelines/PipelineToolbar.jsx | Adds name validation error display |
| Multiple notebook components | Add default name generation for notebook creation flows |
| Multiple experiment components | Implement default experiment and model naming |
| Multiple dataset components | Add default dataset naming in creation flows |
| DashAI/front/src/components/generative/SelectModelMenu.jsx | Adds default session name generation |
| DashAI/back/dataloaders/classes/*.py | Updates schema to make name field required instead of optional |
| DashAI/back/api/api_v1/endpoints/explainers.py | Makes run_id parameter optional for explainer endpoints |
Comments suppressed due to low confidence (1)
DashAI/front/src/hooks/usePipelineState.js:1
- The dependency
formSubmitRef.currentin the useCallback will cause the callback to recreate whenever the ref changes, but refs don't trigger re-renders. This should beformSubmitRefinstead, or the dependency should be removed since refs are stable.
import { useState, useEffect, useMemo } from "react";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 38 out of 38 changed files in this pull request and generated 8 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 38 out of 38 changed files in this pull request and generated 5 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
generateSequentialNameutility function for consistent naming patternsType of change
Changes
Core Functionality
nameGenerator.jsutility: Created a reusable functiongenerateSequentialName()that generates sequential names (e.g., "Dataset_1", "Dataset_2") based on existing items to avoid naming conflicts.Module Updates
DataloaderConfigurationandSaveDatasetModalcomponentsCreateNotebookModalandUploadNotebookStepscomponentsNewExperimentModaland model configuration stepsSelectModelStepwith default prediction names and validationNewPipelinewith validation and error handlingSelectModelMenucomponentEnhanced User Experience
How to Test
Dataset Module
Notebook Module
Experiment Module
Prediction Module
Pipeline Module
Generative Module
Notes
generateSequentialNamefunction is highly configurable with options for: