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

keyboard navigation for field selection #6969

Closed
wants to merge 16 commits into from

Conversation

ehconitin
Copy link
Contributor

Adressing #6954
@Bonapara

How about this behaviour? The field wont be selected initially and then it is persistent once selected?

2024-09-10.18-16-32.mp4

Key navigation -
I couldnt show key strokes on screen like u do :)

2024-09-10.18-09-55.mp4

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request implements keyboard navigation for field type selection in the data model settings, addressing issue #6954. Key changes include:

  • Added keyboard navigation using Tab, Shift+Tab, and Enter keys in SettingsDataModelFieldTypeSelect component
  • Introduced new SettingsDataModelHotkeyScope enum for managing hotkey scopes
  • Created SettingsDataModelFieldConfigurationForm component for improved field configuration UI
  • Updated SettingsObjectNewFieldStep2 to support toggling between field type selection and configuration steps
  • Implemented styling updates for focused and active states to improve visual feedback

These changes enhance user experience and accessibility in the custom field creation process, aligning with the desired behavior outlined in the issue.

4 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings

@Bonapara
Copy link
Member

As discussed in the video call, let's deactivate the navigation in the breadcrumb step selector when no field type has been selected. Additionally, disable the Cancel and Save buttons on step one!

@ehconitin
Copy link
Contributor Author

@Bonapara
Thanks for the help, this looks much cleaner! :)

2024-09-11.13-58-00.mp4

@ehconitin
Copy link
Contributor Author

@lucasbordeau could you please review this one?

Thanks

@lucasbordeau
Copy link
Contributor

Could you please add a story so the coverage gets above 50 % ?

@ehconitin
Copy link
Contributor Author

@lucasbordeau These already have their corresponding stories!
Not sure if you are asking for something else.

@Bonapara
Copy link
Member

@ehconitin, can the Cancel button on step-2 redirect to the Settings > objects > object page and not to step-1?

@ehconitin
Copy link
Contributor Author

@Bonapara ofcourse!

@bosiraphael
Copy link
Contributor

Enregistrement.de.l.ecran.2024-09-24.a.18.13.41.mov

I find it weird that the field type stays selected when you go back on the field type form even when you hit tab.

@ehconitin
Copy link
Contributor Author

Enregistrement.de.l.ecran.2024-09-24.a.18.13.41.mov
I find it weird that the field type stays selected when you go back on the field type form even when you hit tab.

Isn't it supposed to stay selected?

 background: ${({ theme, isActive, isFocused }) =>
    isActive
      ? theme.background.quaternary
      : isFocused
        ? theme.background.tertiary
        : theme.background.secondary};

The selected or 'isActive' field uses a quaternary background, while 'isFocused' or hovered fields have a tertiary background. Now that you mention it, it does feel a bit odd, especially since the tertiary and quaternary backgrounds are visually similar in grayscale.
Do you think we should style focused fields differently?

Any thoughts on how we can improve this?

@bosiraphael
Copy link
Contributor

Enregistrement.de.l.ecran.2024-09-24.a.18.13.41.mov
I find it weird that the field type stays selected when you go back on the field type form even when you hit tab.

Isn't it supposed to stay selected?

 background: ${({ theme, isActive, isFocused }) =>
    isActive
      ? theme.background.quaternary
      : isFocused
        ? theme.background.tertiary
        : theme.background.secondary};

The selected or 'isActive' field uses a quaternary background, while 'isFocused' or hovered fields have a tertiary background. Now that you mention it, it does feel a bit odd, especially since the tertiary and quaternary backgrounds are visually similar in grayscale. Do you think we should style focused fields differently?

Any thoughts on how we can improve this?

@Bonapara, what are your thoughts on this?

@ehconitin
Copy link
Contributor Author

ehconitin commented Sep 25, 2024

Enregistrement.de.l.ecran.2024-09-24.a.18.13.41.mov
I find it weird that the field type stays selected when you go back on the field type form even when you hit tab.

Isn't it supposed to stay selected?

 background: ${({ theme, isActive, isFocused }) =>
    isActive
      ? theme.background.quaternary
      : isFocused
        ? theme.background.tertiary
        : theme.background.secondary};

The selected or 'isActive' field uses a quaternary background, while 'isFocused' or hovered fields have a tertiary background. Now that you mention it, it does feel a bit odd, especially since the tertiary and quaternary backgrounds are visually similar in grayscale. Do you think we should style focused fields differently?
Any thoughts on how we can improve this?

@Bonapara, what are your thoughts on this?

@Bonapara and I had discussed this earlier - #6969 (comment)

@bosiraphael
Copy link
Contributor

Once we hit tab inside the data model we are stuck inside it and can't reach the menu nor the exit buttons, I'm not sure that it's great for accessibility. What are your thoughts on this @Bonapara?

@ehconitin
Copy link
Contributor Author

ehconitin commented Sep 26, 2024

Once we hit tab inside the data model we are stuck inside it and can't reach the menu nor the exit buttons, I'm not sure that it's great for accessibility. What are your thoughts on this @Bonapara?

You mean not accessible through keystrokes right? Yep I agree! I guess its the same reason hotscope was removed from serverless functions in #7235

Could we do something like on pressing esc the hotscope is removed?

@Bonapara
Copy link
Member

Once we hit tab inside the data model we are stuck inside it and can't reach the menu nor the exit buttons, I'm not sure that it's great for accessibility. What are your thoughts on this @Bonapara?

Nothing happens if we press Escape?

@ehconitin
Copy link
Contributor Author

Once we hit tab inside the data model we are stuck inside it and can't reach the menu nor the exit buttons, I'm not sure that it's great for accessibility. What are your thoughts on this @Bonapara?

You mean not accessible through keystrokes right? Yep I agree! I guess its the same reason hotscope was removed from serverless functions in #7235

Could we do something like on pressing esc the hotscope is removed?

I don’t think this would work :( Even if we unscope on Esc, pressing Tab would re-enable the hotkey scope!
@Bonapara, the main issue here is that using Tab becomes restrictive when hotkey scoping is active.

Once we hit tab inside the data model we are stuck inside it and can't reach the menu nor the exit buttons, I'm not sure that it's great for accessibility. What are your thoughts on this @Bonapara?

Nothing happens if we press Escape?

Nope!

@Bonapara
Copy link
Member

What do you think is the best option @ehconitin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants