Skip to content

Conversation

@keaton22
Copy link

@keaton22 keaton22 commented Jul 16, 2025

Problem

  • As far as I can tell, when opening a ZAP project from the CLI, if a value is provided for --output/--out/--o, that value does not get used as the default path for the Generate directory. I believe it should.

Solution

  • This PR makes the value of --output/--out/--o query-able from the front-end by passing it as a parameter in the uiFunction() in startup.js.

Notes

  • In Windows, the path value passed to --output/--out/--o must use escaped backslashes (e.g. C:\\Users\\username\\zap-projects)

@CLAassistant
Copy link

CLAassistant commented Jul 16, 2025

CLA assistant check
All committers have signed the CLA.

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.

Summary of Changes

Hello @keaton22, 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 addresses a usability issue where the CLI --output parameter was not being utilized as the default path for the 'Generate' directory within the application's user interface. My changes ensure that this CLI-provided path is properly propagated through the Electron main and UI processes, allowing the frontend to use it as the default, thereby improving the consistency and user experience when interacting with the application via the command line.

Highlights

  • CLI Output Path Propagation: I've updated the application's startup process to ensure that the --output value provided via the command line interface (CLI) is correctly passed from the main Electron process down to the UI components. This involves modifying several functions in src-electron/main-process/startup.js, src-electron/ui/main-ui.js, src-electron/ui/ui-util.js, and src-electron/ui/window.js to accept and forward this new parameter.
  • Default Generation Directory in UI: The UI component ZCLToolbar.vue now leverages the propagated --output value. Specifically, the generationDirectory property is initialized with this CLI-provided path. Furthermore, when a new generation directory is reported (e.g., via a file dialog), the UI will now fall back to the CLI --output value if the reported path is null or undefined, ensuring a consistent default.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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 correctly implements the feature to use the --output CLI argument as the default generation directory in the UI. The value is plumbed from the main process to the renderer process via a query string parameter, which is a reasonable approach. The changes are consistent across the affected files.

My main feedback is to update the JSDoc comments for the functions whose signatures have been changed to include the new output parameter. This is important for maintaining code clarity and documentation consistency.

Comment on lines +158 to +169
function enableUi(
port,
zapFiles,
uiMode,
standalone,
zapFileExtensions,
output
) {

Choose a reason for hiding this comment

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

medium

The JSDoc for enableUi is missing documentation for the new output parameter. Please add @param {*} output to the documentation block to keep it up-to-date with the function signature and improve maintainability.

Copy link
Author

Choose a reason for hiding this comment

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

I've updated the commit to fix this

* @param {*} port
*/
export function windowCreateIfNotThere(port) {
export function windowCreateIfNotThere(port, output) {

Choose a reason for hiding this comment

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

medium

The JSDoc for windowCreateIfNotThere should be updated to include the new output parameter. This will help maintain code clarity and ensure the documentation matches the implementation.

Copy link
Author

Choose a reason for hiding this comment

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

I've updated the commit to fix this

restPort,
zapFileExtensions
zapFileExtensions,
output

Choose a reason for hiding this comment

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

medium

The JSDoc for createQueryString should be updated to include the new output parameter. The existing JSDoc appears to be out of sync with other parameters as well, but at a minimum, the new parameter should be documented.

Copy link
Author

Choose a reason for hiding this comment

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

I've updated the commit to fix this

@keaton22 keaton22 force-pushed the use-output-value-as-path-of-generate-directory-if-provided branch from 4646345 to a6d7bb6 Compare July 16, 2025 20:46
@keaton22 keaton22 force-pushed the use-output-value-as-path-of-generate-directory-if-provided branch from 96b1592 to 263d2ce Compare July 18, 2025 19:05
@keaton22
Copy link
Author

keaton22 commented Sep 4, 2025

@paulr34 @tecimovic @brdandu I want to be respectful of your time and availability, but I would be very appreciative if I could get some feedback on this pull request. Thank you!

@paulr34
Copy link
Collaborator

paulr34 commented Sep 4, 2025

@keaton22 the workflow is not running. That needs to pass.

@keaton22
Copy link
Author

keaton22 commented Sep 4, 2025

@keaton22 the workflow is not running. That needs to pass.

Thank you @paulr34! I've merged the latest changes from main into this branch, which I believe triggered the Summary workflow to run. I still see Build ZAP, Prepare Zap and regenerate Zigbee, and Test matter sdk codegen changes workflows as pending (specifically, they're marked as Expected — Waiting for status to be reported). Do you know of any additional actions I should take to facilitate running the remaining workflows, or are those triggered manually / later?

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.

3 participants