Skip to content

Dialog focus #1472

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

Merged
merged 3 commits into from
Sep 29, 2022
Merged

Dialog focus #1472

merged 3 commits into from
Sep 29, 2022

Conversation

AlbyIanna
Copy link
Contributor

Motivation

Some dialogs, when being opened, don't set the focus on the controls (inputs, button, etc)

Change description

Fixed the focus in the following dialogs:

  • Configure and Upload
  • Firmware Uploader
  • Certificate Uploader

Also changed "Configure And Upload" label to "Configure and Upload".

Other information

Fixes #1373

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@AlbyIanna AlbyIanna requested a review from kittaakos September 20, 2022 16:00
@kittaakos kittaakos added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Sep 20, 2022
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

It's not working for me. When I try to upload the dialog opens but the <input> does not have the focus.

dialog-focus.mp4

@AlbyIanna
Copy link
Contributor Author

@kittaakos Thank you for spotting it. Please try it again, it should work correctly now.

@AlbyIanna AlbyIanna requested a review from kittaakos September 22, 2022 06:55
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

It does not work for me. Once the focus is removed, IDE2 does not put back the focus back to the <input> on dialog open.

focus.mp4

I have not checked the button focus changes yet.

@AlbyIanna
Copy link
Contributor Author

It does not work for me. Once the focus is removed, IDE2 does not put back the focus back to the on dialog open.

You're right, it works only the first time. I've fixed it now, thanks for spotting it!

@AlbyIanna AlbyIanna requested a review from kittaakos September 27, 2022 11:10
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

Setting the focus on the <input> field works great in the user field dialog. Thank you!

I have noticed this difference between 2.0.0 and build from this PR. The first button has a bold border for the firmware updater and the SSL certificate dialogs.

2.0.0:
Screen Shot 2022-09-29 at 13 27 22

Build from PR:
Screen Shot 2022-09-29 at 13 27 32

2.0.0:
Screen Shot 2022-09-29 at 13 27 47

Build from PR:
Screen Shot 2022-09-29 at 13 28 05

#1373 is not mentioning this change, If this is what we want, please proceed with the merge.

@AlbyIanna
Copy link
Contributor Author

@kittaakos those borders are bold because the focus goes on them when the dialog shows up. #1373 only mentions the user fields dialog, but I wanted to solve the issue more broadly. Thanks for the review!

@AlbyIanna AlbyIanna merged commit 6f07717 into main Sep 29, 2022
@AlbyIanna AlbyIanna deleted the dialog-focus branch September 29, 2022 13:16
@kittaakos
Copy link
Contributor

but I wanted to solve the issue more broadly.

Can you explain why did you decide to set the focus on the buttons only in these two dialogs and not on the others?

@AlbyIanna
Copy link
Contributor Author

Can you explain why did you decide to set the focus on the buttons only in these two dialogs and not on the others?

My reasoning was to try to set the focus on the most appropriate UI element in the dialog. Of course, the definition of most appropriate is arbitrary, so I did what I thought it was best.

Here's the reasoning I've applied on each dialog:

  • the user fields one needs to have the focus on the first input element because when the user opens it, the will need to fill them in in order to upload
  • with the firmware updater one, the first action the user would like to take is to press the button (if a board is found) because a board is automatically selected
  • when the user opens the SSL root certificate one, it's usually not possible to click on the UPLOAD button because if you don't add a certificate before it will be disabled, so I've set the focus on the first button

So, generally I guess my rationale was to set the focus on the UI element that lets the user do what they want to do with a dialog as quickly as possible.

Of course, all of this is questionable, so if you have suggestions or if you disagree with these decisions, please let me know!

@kittaakos
Copy link
Contributor

So, generally I guess my rationale was to set the focus on the UI element that lets the user do what they want to do with a dialog as quickly as possible.

Thank you for writing down the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User fields dialog improvements
2 participants