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

Dropdown for Move Generator after selecting Move in Context menu #1273

Closed
ZackDeRose opened this issue Apr 20, 2022 · 9 comments
Closed

Dropdown for Move Generator after selecting Move in Context menu #1273

ZackDeRose opened this issue Apr 20, 2022 · 9 comments
Assignees
Labels
good first issue Good for newcomers type: feature New feature or request

Comments

@ZackDeRose
Copy link
Member

Description

Capturing @AgentEnder's comment to #1256:

In regards to the @nrwl/angular:move vs @nrwl/workspace:move point, there's also the case of community plugin projects which may require their move generator. e.g., I'm about to add a move generator to nx-dotnet to handle updating .csproj file paths in addition to moving the files ( see nx-dotnet/nx-dotnet#406 ).

Do you think we could check for all installed plugins that have a generator called move, and prompt the user to choose between them?

A dropdown seems like the correct path forward after talking it over with @Cammisuli. We'll look to add this in the future for support for 3rd party plugins and orgs with their own move implementations.

@ZackDeRose ZackDeRose added the type: feature New feature or request label Apr 20, 2022
@ZackDeRose ZackDeRose self-assigned this Apr 22, 2022
@AgentEnder
Copy link
Member

@MaxKless this may be a good one to bump up in priority, although I'm a bit biased. What do you think?

@MaxKless
Copy link
Collaborator

Yeah it sounds useful. I'm not sure what a "dropdown" means for context menus, though.
I think we should consider a nested context menu here, where you can select any of the installed plugins with move generators.

I'm just wondering if there isn't a smart way to figure out which generator is the right one based on the selected project...

@AgentEnder
Copy link
Member

There's not a good way to tell which generator is correct, because idealistically it would be provided by the plugin which scaffolded the project. But there's no way to know what that generator was after generation.

For the common ones, you could theoretically check between things like if it uses @nrwl/angular for build since the only options we provide are @nrwl/angular or @nrwl/workspace, but when you consider community plugins as a need you wouldn't be able to reliably detect it imho. Consider a plugin like @nx-community/vue (made up) that has its own move generator but uses our vite or webpack plugin for its targets. No real way to trace it back.

I'm not sure what a "dropdown" means for context menus

I think the context menu would just open a prompt which contains an autocomplete style dropdown, similar to how the generate button works in the nx-console tab.

@MaxKless
Copy link
Collaborator

Makes sense on the first part.

Concerning the prompt, I don't really like the idea of having a prompt because it forces you to switch between the context menu and the top of the screen even though it's such a tightly coupled relationship between the menus. I'll see how it feels and whether dynamic context menus are even a thing :)

@MaxKless MaxKless added the good first issue Good for newcomers label Jan 16, 2023
@MaxKless
Copy link
Collaborator

Turns out dynamic submenus don't exist :)
microsoft/vscode#110218 it's been on the vscode backlog for two years... let's see how that issue evolves. For now I'll go ahead and solve it with a quickpick and corresponding setting.

@MaxKless MaxKless assigned MaxKless and unassigned ZackDeRose Feb 15, 2023
@AgentEnder
Copy link
Member

Sure, I think a quickpick will work for the time being and if the vscode issue ever makes progress it should be an easy swap.

@MaxKless
Copy link
Collaborator

Hey @AgentEnder I made a PR addressing this: #1534

Running remove/move from the context menu now lets you select the generator.
Additionally there's a setting through which you can define wildcard patterns and the corresponding collections.
I assume many workspaces will have their @nx-dotnet and frontend isolated spatially so it should be easy to provide some values here that let nx console infer the correct generators.

I'd be glad if you could try it out or provide some feedback from real-life @nx-dotnet workspaces. Maybe there's some details I haven't taken into consideration.

@MaxKless
Copy link
Collaborator

merged :)

@AgentEnder
Copy link
Member

Awesome, once its released I'll do a quick double check on if it picks up the move generator for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants