Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preselect dropdown values in the New Project Wizard #2730

Merged
merged 9 commits into from
Apr 11, 2024

Conversation

sharon-wang
Copy link
Member

@sharon-wang sharon-wang commented Apr 10, 2024

Intent

This PR pre-selects a default value in the dropdowns, so the user can click through to create the project without having to select anything (as long as they're happy with the defaults!)

Before (dropdowns not preselected)

image

This PR (dropdowns preselected with reasonable defaults)

image

Demo Vid

  • this is more up-to-date than the above screenshot...and has dropdown styling! ✨
newprojwiz_dropdown.mp4

Approach

  • Store the user's environment setup type (new env or existing env) in the new project wizard state
  • Store the user's environment type (Venv or Conda) in the new project wizard state
  • If the user navigates to the previous step and then to the Python environment step, the selections are persisted
    • Conda interpreters don't yet get persisted because their runtime IDs are placeholders
  • Updates the Conda dropdown items to return PythonInterpreterInfo as their values
  • Creates DropdownEntry which creates a consistent dropdown entry style/layout in the wizard

QA Notes

  • The Python Environment dropdown should be pre-selected to Venv for now (hardcoded default)
  • The Python Interpreter should be pre-selected to:
    • If Venv is selected: the user's preferred Global version of python
    • If Conda is selected: currently, we have hardcoded python versions for conda, so there is no default.
    • If Existing Python is selected: the user's preferred version of python

- store the python environment setup type in the project config
- move all project wizard related enums to newProjectWizardEnums.ts
- store the envSetupType, envType and selectedInterpreter in the pythonEnvironmentStep state and update accordingly
- define the PythonEnvironmentType enum in newProjectWizardEnums.ts
- set the interpreter drop down to disabled while the interpreters are still being loaded
- ensure the env setup type, env type and selected interpreter configs are persisted and restored when navigating back and forth between steps
@sharon-wang sharon-wang requested review from petetronic and removed request for softwarenerd April 11, 2024 14:42
@sharon-wang sharon-wang merged commit d3d99ae into main Apr 11, 2024
1 check passed
@sharon-wang sharon-wang deleted the feature/project-wizard-preselect-dropdowns branch April 11, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants