openpassphrase/opp-web

Enable auto-generate password feature on item create

Closed this issue · 10 comments

This is a feature request.

The create-item endpoint allows users to let the API generate a password instead of specifying it in the request. See http://openpassphrase.com/api_ref.html#create-item. Let's enable the UI to allow that feature to be utilized. For initial implementation, I think it's good enough to leave all options as default and only allow to specify the number of words in the generated password. The way I see this working on the UI is to have a checkbox next to the password field in the "Add Item" dialog. When check, it would hide the the password input box and instead present the auto-generation options (again just "numwords" for now).

Let's collaborate on this (somehow).

how would you like to collaborate on this?

So what inputs user sees when auto generated is on? You also should account for if multiple customization options are available

Rather, the 2nd screen should look something like this:

2

There are other customizations available from the api such as min/max word length, delimiter and valid chars regex. But I think they can be left for a more advanced UI implementation. For the current version, it should be enough to provide a number of words integer input, which should be validated in the range [1-6]

even having only one input for the number of words feels clunky.
You and I know what "auto-generate" means. A new user will ask "Auto-generate what?". This checkbox feels like a separate input. It does not really belong to the password field.

Let's say user clicks on that "Auto-generate" checkbox. Suddenly he sees input labeled "number of words". What words? Again, you and I know, but the user will be confused.

What if we use 2 columns for this layout instead of 3?

Name User Name
URL x Auto-generate password
Account Password or any inputs needed for autogenerate
Blob

In this case, if auto-generate is checked, we can show a nice header explaining what the new fields mean.

I should have been more explicit in the picture. The checkbox is a separate field next to the password field. And yes, it should be titled 'auto-generate password' for clarity. When checked, the password input should be replaced with another input with hint text: 'number of words to generate'

Alternatively, if we want to show more options, we can either pop up another dialog or extend the existing one?

Also, I want to keep the existing layout, it's good to have username/password next to each other. The one you proposed is not as intuitive.

update item api needs to return updated items. Otherwise, I cannot know what password was generated by the server and update client with that info. Pulling data after update action is inefficient.

Both update and create need to return back the new data.

I see, create item is already returning the data. Just need to update the "update"