Skip to content

Conversation

@Hahihula
Copy link
Collaborator

@Hahihula Hahihula commented Nov 5, 2025

CLI selection of features:
2025-11-85T120955 703314+0808 - INFO - Running IDF Installer Wizard
and GUI:
image

@gemini-code-assist
Copy link

Summary of Changes

Hello @Hahihula, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the CLI wizard's functionality by integrating a feature selection mechanism for ESP-IDF installations. The primary goal is to provide users with greater control over which components of ESP-IDF are installed, thereby optimizing the setup process and allowing for more tailored development environments. This change introduces new core logic for handling feature metadata and refactors existing network-related utilities to support this new capability.

Highlights

  • CLI Feature Selection: The CLI wizard now includes an interactive feature selection step, allowing users to choose specific ESP-IDF features to install during the setup process. This enhances customization and can reduce the installation footprint.
  • New idf_features Module: A new module, idf_features, has been introduced to handle the parsing and management of ESP-IDF feature metadata, including fetching requirements.json from a URL and providing structured access to feature information.
  • Dependency Updates and Refactoring: The reqwest dependency has been updated to explicitly use the blocking feature, and futures-channel has been added. Common URL construction logic for repositories and raw files has been refactored into reusable functions within src-tauri/src/lib/mod.rs.
  • Localization Update: A new localization string wizard.idf.submodule_finish has been added to app.yml for both English and Chinese, indicating when an IDF submodule has been correctly downloaded.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a feature selection wizard to the CLI, allowing users to choose which ESP-IDF features to install. The changes include adding new UI prompts, logic for fetching and parsing feature metadata from a URL, and refactoring URL generation logic. My review focuses on improving code maintainability by reducing duplication and ensuring the correct use of asynchronous functions in the async runtime.

Comment on lines +419 to +426
let requirements_files = match RequirementsMetadata::from_url(&req_url) {
Ok(files) => files,
Err(err) => {
warn!("{}: {}. {}", t!("wizard.requirements.read_failure"), err, t!("wizard.features.selection_unavailable"));
return Err(err.to_string());
}
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The run_wizzard_run function is async, but it's using the blocking RequirementsMetadata::from_url to fetch the requirements file. This will block the async runtime. The idf_im_lib::idf_features module provides an async version, from_url_async, which should be used here with .await.

Suggested change
let requirements_files = match RequirementsMetadata::from_url(&req_url) {
Ok(files) => files,
Err(err) => {
warn!("{}: {}. {}", t!("wizard.requirements.read_failure"), err, t!("wizard.features.selection_unavailable"));
return Err(err.to_string());
}
};
let requirements_files = match RequirementsMetadata::from_url_async(&req_url).await {
Ok(files) => files,
Err(err) => {
warn!("{}: {}. {}", t!("wizard.requirements.read_failure"), err, t!("wizard.features.selection_unavailable"));
return Err(err.to_string());
}
};

Comment on lines +412 to +457
// Interactive selection from filtered features
let items: Vec<String> = filtered_features
.iter()
.map(|f| {
format!(
"{} {} - {}",
if f.optional { "[ ]" } else { "[*]" },
f.name,
f.description.as_deref().unwrap_or("No description")
)
})
.collect();

let defaults: Vec<bool> = filtered_features.iter().map(|f| !f.optional).collect();

let selections = MultiSelect::with_theme(&ColorfulTheme::default())
.with_prompt("Select ESP-IDF features (Space to toggle, Enter to confirm)")
.items(&items)
.defaults(&defaults)
.interact()
.map_err(|e| format!("Selection failed: {}", e))?;

if selections.is_empty() {
return Err("No features selected".to_string());
}

Ok(selections
.into_iter()
.map(|idx| filtered_features[idx].clone())
.collect())
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The interactive selection logic in this function is very similar to the logic in select_features_interactive. To avoid code duplication and improve maintainability, consider extracting the common parts into a private helper function. This helper could handle building the MultiSelect prompt, interacting with the user, and returning the selected features.

For example, you could create a function like this:

fn prompt_user_for_features(
    features: &[&FeatureInfo],
    prompt_message: &str,
) -> Result<Vec<FeatureInfo>, String> {
    // ... implementation of the MultiSelect dialog ...
}

Both select_features_interactive and select_features_advanced could then call this helper with the appropriate list of features and prompt message.

Comment on lines +1820 to +1829
let repo_name = match repository {
Some(repo) => repo.to_string(),
None => {
if mirror.map_or(false, |m| m.contains("https://gitee.com/")) {
"EspressifSystems/esp-idf".to_string()
} else {
"espressif/esp-idf".to_string()
}
}
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic to determine repo_name is duplicated from get_repo_url. To avoid code duplication and improve maintainability, this logic could be extracted into a private helper function, for example get_repo_name(repository: Option<&str>, mirror: Option<&str>) -> String. Both get_repo_url and get_raw_file_url could then use this helper function.

@Fabricio-ESP
Copy link
Collaborator

Fabricio-ESP commented Nov 6, 2025

We need to add the translations for the GUI on this new screen.
image

On the CLI the selection squares and the parentheses makes it unclear what is the actual selection. Note that you can actually deselect the "core", should we allow installation without the core?
image

@Hahihula
Copy link
Collaborator Author

Hahihula commented Nov 10, 2025

We need to add the translations for the GUI on this new screen. image

we can hardly do that, as the texts come from this file: https://github.com/espressif/esp-idf/blob/master/tools/requirements.json

@Hahihula
Copy link
Collaborator Author

On the CLI the selection squares and the parentheses makes it unclear what is the actual selection. Note that you can actually deselect the "core", should we allow installation without the core?
image

should be better now:
image

@Hahihula Hahihula force-pushed the EIM-250-get-features-from-idf branch 3 times, most recently from e0e1a7e to 83432ac Compare November 11, 2025 13:37
@AndriiFilippov
Copy link
Collaborator

@Hahihula hi !
please, take a look
I have tested latest PR binaries in the context of IDE package support:
image

CLI version: install all necessary packages on all platforms ✅
GUI version: Linux / Mac ✅

But the Windows_GUI version does not install websocket-client:

(venv) PS C:\Users\andri\Desktop> pip list
Package                   Version
------------------------- ----------
annotated-types           0.7.0
bitarray                  3.8.0
bitstring                 4.3.1
certifi                   2025.11.12
cffi                      2.0.0
charset-normalizer        3.4.4
click                     8.1.8
colorama                  0.4.6
construct                 2.10.70
cryptography              44.0.3
ecdsa                     0.19.1
esp-coredump              1.14.0
esp-idf-diag              0.2.0
esp-idf-kconfig           2.5.0
esp-idf-monitor           1.8.0
esp_idf_nvs_partition_gen 0.1.9
esp_idf_panic_decoder     1.4.2
esp-idf-size              1.7.1
esptool                   4.10.0
freertos-gdb              1.0.4
idf-component-manager     2.4.2
idna                      3.11
intelhex                  2.3.0
jsonref                   1.1.0
markdown-it-py            4.0.0
mdurl                     0.1.2
packaging                 25.0
pip                       25.2
psutil                    7.1.3
pyclang                   0.6.3
pycparser                 2.23
pydantic                  2.12.4
pydantic_core             2.41.5
pydantic-settings         2.12.0
pyelftools                0.32
pygdbmi                   0.11.0.0
Pygments                  2.19.2
pyparsing                 3.2.5
pyserial                  3.5
python-dotenv             1.2.1
PyYAML                    6.0.3
reedsolo                  1.7.0
requests                  2.32.5
requests-file             3.0.1
requests-toolbelt         1.0.0
rich                      14.2.0
ruamel.yaml               0.18.16
ruamel.yaml.clib          0.2.14
setuptools                80.9.0
six                       1.17.0
tqdm                      4.67.1
truststore                0.10.4
typing_extensions         4.15.0
typing-inspection         0.4.2
urllib3                   1.26.20
windows-curses            2.4.1

eim_gui_log 1.log
eim 6.log

@AndriiFilippov
Copy link
Collaborator

We need to add the translations for the GUI on this new screen. image

On the CLI the selection squares and the parentheses makes it unclear what is the actual selection. Note that you can actually deselect the "core", should we allow installation without the core? image

btw, the issue related to deselection of the "core" packages in CLI version still persist.

image

@Hahihula Hahihula force-pushed the EIM-250-get-features-from-idf branch 5 times, most recently from 8ce8e25 to e921067 Compare November 28, 2025 11:10
Added the features selection to the GUI wizard

fixed store wizard total step count

updated error handling

windows gui installation now locks the mutex

update the logic of reading config from the file and overriding it with cli args
@Hahihula Hahihula force-pushed the EIM-250-get-features-from-idf branch from e921067 to ef96956 Compare November 28, 2025 13:22
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.

4 participants