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

feat(intellij): autofocus first empty text field in re/move dialog #2131

Conversation

mkapal
Copy link
Contributor

@mkapal mkapal commented May 9, 2024

The project text field is focused by default when the re/move project dialog is opened. This improves UX because the user doesn't have to move the focus to the project field manually.

Before:
Screenshot 2024-05-09 at 20 35 03

After:
Screenshot 2024-05-09 at 20 35 51

When the project is prefilled then the destination text box is focused instead:
image

The project text field is focused by default when the re/move project dialog is opened
@MaxKless
Copy link
Collaborator

I like it, thanks for the PR!
What do you think about the following: If the project field is prefilled (for example when you right click on a folder & run it via the refactoring menu there), the destination field should be focused instead.

@MaxKless MaxKless self-requested a review May 10, 2024 08:50
@mkapal
Copy link
Contributor Author

mkapal commented May 10, 2024

Ah, I have missed that use case, thanks. I will try to update it.

@mkapal mkapal changed the title feat(intellij): autofocus project text field in re/move dialog feat(intellij): autofocus first empty text field in re/move dialog May 10, 2024
@mkapal mkapal force-pushed the feature/intellij-remove-project-dialog-autofocus-project-field branch from 4b59fa0 to 80d96e7 Compare May 10, 2024 09:58
@mkapal
Copy link
Contributor Author

mkapal commented May 10, 2024

I just noticed that I import the applyIf function from ai.grazie.utils.applyIf - somehow that doesn't look like the right way to do it.

Is there a better standard way to apply such properties based on a condition?

@mkapal mkapal force-pushed the feature/intellij-remove-project-dialog-autofocus-project-field branch from 80d96e7 to f77afc7 Compare May 10, 2024 10:06
@mkapal
Copy link
Contributor Author

mkapal commented May 10, 2024

Never mind, now I see that it is also available in com.intellij.util.applyIf. That's fixed now.

@MaxKless
Copy link
Collaborator

looks & works great!
Can you run ./gradlew ktfmtFormat to make sure linting passes @mkapal ?

… project field is prefilled

If the project field is prefilled (for example when you right-click on a folder & run it via the refactoring menu there), the destination field is focused instead
@mkapal mkapal force-pushed the feature/intellij-remove-project-dialog-autofocus-project-field branch from f77afc7 to 7418192 Compare May 10, 2024 12:31
@MaxKless MaxKless merged commit ac804b0 into nrwl:master May 10, 2024
4 checks passed
@mkapal mkapal deleted the feature/intellij-remove-project-dialog-autofocus-project-field branch May 10, 2024 13:53
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.

None yet

2 participants