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

auto-suggestion of username done differently #112

Closed
lkocman opened this issue Apr 1, 2022 · 11 comments · Fixed by #1022
Closed

auto-suggestion of username done differently #112

lkocman opened this issue Apr 1, 2022 · 11 comments · Fixed by #1022
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@lkocman
Copy link
Contributor

lkocman commented Apr 1, 2022

I love freedom (unlike in windows user generation) where I'm stuck initially with what they decide. However I was quite unhappy about the username generation in the old installer which usually generated luboskocman and I have to always do a correction otherwise I'd have to extensively use .ssh/config to override user etc.

This auto-suggestion feature is something I missed in the first-time user experience with the installer.

Fedora and other distros would suggest lkocman. Which would be my personal preference as well.

I think this should be our preferred generation as 99% of SUSE employees have such account anyway.
I'm not sure what the rules is for complex names like "Homer Jay Simpson" etc.

@lkocman lkocman changed the title auto-suggestion of username done differently. auto-suggestion of username done differently Apr 1, 2022
@imobachgs imobachgs added the enhancement New feature or request label Apr 1, 2022
@imobachgs imobachgs added the good first issue Good for newcomers label Oct 26, 2022
@michaela559
Copy link

hello, can you specify what you mean? Do you not want the auto-suggestion, or make it in a way where it doesn't actually generate your username, only writes it somewhere for you to "get inspired by"...?

@imobachgs
Copy link
Contributor

I guess @lkocman wants autosuggestion, but a different one, isn't it? So for "Lubos Kocman" the suggestion should be lkocman instead of luboskocman. For long names, I am unsure. In SUSE I am igonzalezsosa (from Imobach González Sosa) which is rather long but works.

@kobliha
Copy link
Contributor

kobliha commented Dec 14, 2022

And when creating a new user name, I always use "lukas". So, not so simple :D

@dgdavid
Copy link
Contributor

dgdavid commented Nov 17, 2023

I think this is now kind of stale good-first-issue. So let me try to move it on 😉

About which one should be the right suggestion, I believe that Agama is the perfect excuse for trying to think a bit different and do not fill the username input text automatically.

Firstly, if the input gets filled with a suggestion the user does not like it, we are just adding a not needed extra step: remove it before writing the desired one. Not a big deal, though, but completely avoidable.

Second, autofilling the input limits the suggestion to only one. A bit poor considering how cheap would be for us, as developers, to provide a few suggestions instead. For me, the question is how to provide them to the user through the UI. Good news is that I have two ideas 😄

  • Using actionable badgets for choosing, if wanted, a suggestion.

    This can be done using the PF/Label. The idea is to show a few suggestions once the users finish writing their name (not sure now on which event, honestly; matter of testing which works better, the onBlur or a delay after the last keystroke)

    These labels can be placed BEFORE the username input. As a result, the keyboard focus will land there after leaving the name input field. If users don't like any of the suggestions, this may be an unnecessary "trap": they have to loop over all of them before reaching the input to type the desired one.

    Screenshot from 2023-11-17 08-26-24

    But it is also possible to place them after the username input. By doing so, we give users the option to type their preferred username or to simply pick one from the suggestions. You can think that the user could be trapped in a similar way to the above when trying to reach the password input. In reality, they will not, because suggestions must disappear once they begin typing.

    Screenshot from 2023-11-16 20-01-50

  • Borrowing the autocompletion from PatternFly auto generated password example.

    The idea is to display the suggestions in a dropdown once the user reach the username input. Suggestions will remain until selecting one or start typing.

    Screenshot from 2023-11-17 08-42-47


Please, don't think too much about wording or styling in the screenshots above, but rather focus on your feedback about which one might be better. Try to keep the A11y in mind when thinking about them: not everyone uses a mouse, and some users need screen readers that must announce these options.

Wording and styling something we can discuss once we have a plan for introducing the username suggestions features.

@balsa-asanovic
Copy link
Contributor

I like the most your first suggestion, where the suggestion badges are placed below the username input field

  • Using actionable badgets for choosing, if wanted, a suggestion.

So, this one:

image

My second choice would be this:

While I like the least the option where suggestions are placed above the username input field.
Somehow, it just feels wrong (possibly due to usually encountering this sort of suggestion below the field in question, not sure)

However, when addressing accessibility maybe the least intrusive and at the same time the most familiar way of doing this is - Borrowing the autocompletion from [PatternFly auto generated password example]

For example, if the user decides to type the password after typing the Full name, she/he would get stuck in the suggestion badges in both cases (being above or below the input field), this wouldn't be the issue for the dropdown solution.

This is probably an unlikely scenario 😄 , but maybe something to consider.

@dgdavid
Copy link
Contributor

dgdavid commented Nov 17, 2023

Thanks for your quick feedback, appreciated.

I you ask me, although I put the three options my preferred is the last one. I think it is the less intrusive not only because the "focus trap" but also because it does not involve "moving fields" when appears or dissappesrs. I.e., the form height doesn't change and everything still in the same place since the suggestions would be in a fly-out menu that is shown/announced automatically when the input gets the focus and would disappear as soon as the user start typing (i.e., ignoring the suggestions).

BTW,

  • the three suggestions in the screenshots are just an example. Of course, we can agree in which suggestions make sense. What is more, they can be added or removed as long as we collect feedback. I.e., not needed to come with the final suggestions before start working on this.
  • the repeated "Use suggested username" sentenced in the screenshot above is just s reminder for myself about A11y and screen readers. As said, these screenshots were just for illustrating the idea that going for more than one suggestion is "easily" possible.

@balsa-asanovic
Copy link
Contributor

I you ask me, although I put the three options my preferred is the last one. I think it is the less intrusive not only because the "focus trap" but also because it does not involve "moving fields" when appears or dissappesrs. I.e., the form height doesn't change and everything still in the same place since the suggestions would be in a fly-out menu that is shown/announced automatically when the input gets the focus and would disappear as soon as the user start typing (i.e., ignoring the suggestions).

Agreed.

I do like the look of those badges, but the dropdown seems to be a smart choice 😄

@dgdavid
Copy link
Contributor

dgdavid commented Nov 18, 2023

I do like the look of those badges

I like it too. We could reserve the space forthem in attempt to avoid the other elements changing their position. But,

  • At first sight the gap will feel weird, as if something were missing there.
  • How many rows should be reserved? It's to early for start thinking in horizontal scroll for a feature like this.

but the dropdown seems to be a smart choice 😄

Definitely, I'd give it a try. I believe it could help to ship the feature in an almost "transparent" way at the same time that avoids all the mentioned "inconvenients".

@balsa-asanovic
Copy link
Contributor

If you haven't already done some work on this, I could take this on as well?

However, judging by those screenshots you did 😄

@dgdavid
Copy link
Contributor

dgdavid commented Nov 20, 2023

No, I haven't useful code. These screenshots are just in place mockups I did for illustrating the ideas I had in mind. But you wouldn't like to see how dirty the code is. And I wouldn't show it 😜 In any case, displayed suggestions were hardcoded text, so it's needed

  • the code for creating suggestions based on the value of name input
  • the code for displaying them in the UI considering all the things discussed
  • automated tests for the above

So, you can go ahead if you wish. But my personal recommendation is to address issues one by one instead of working simultaneously in them. But that's just my opinion :)

@balsa-asanovic
Copy link
Contributor

So, you can go ahead if you wish. But my personal recommendation is to address issues one by one instead of working simultaneously in them. But that's just my opinion :)

Agreed. I'd work on this after #872 is done.

So, I am just making a reservation 😄.

Of course, if there is some need for speed 🚀 here, I can give it up.

dgdavid added a commit that referenced this issue Feb 29, 2024
## Problem

As described in issue #112 this PR addresses the suggestion of username
for user account creation based on full name input.

## Solution

Usernames are suggested based on the given full name in the following
manner:

- Just the first word of the given name
- The first letter of the first word + all other full words
- The full first word + first letters of all other words
- First letters of all words except last + full last word
- All words of a name joined without white spaces

Also, all suggestions with less than 3 characters are filtered out.

This PR fixes #112

## Testing

- Manually tested
- Added unit tests in `web/src/components/users/utils.test.js`

## Screenshots


![image](https://github.com/openSUSE/agama/assets/112288843/e018d7f5-ef5a-4709-9154-6b05a63e481b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants