urbit / urbit

An operating function
https://urbit.org
MIT License
3.43k stars 358 forks source link

Publish: edge case while trying to add writers to restrict when creating notebook #4218

Closed ynx0 closed 3 years ago

ynx0 commented 3 years ago

Describe the bug While creating a notebook and trying to restrict writers, one can make the UI fall into an invalid state where there are no entries in the writer field yet the form does not validate and erroneously stops the user from creating an unrestricted notebook.

To Reproduce Steps to reproduce the behavior: In a group you have permissions to create:

  1. click new channel
  2. select notebook
  3. fill out title and description
  4. enter some text in the "writers" field
  5. remove the text completely
  6. click out of the form field
  7. observe bug

Expected behavior I expect to be able to try to restrict the writers then change my mind and leave it unrestricted.

Screenshots

Main bug: urbit_landscape_bug 2


Adding someone seems to be a workaround:

urbit_landscape_bug_2_part2

While we're at it, the writer's field also accepts invalid writers (i.e. the string "asdf" is accepted and silently ignored and the notebook is created) but that's pretty minor.

Not the end of the world.

(apologies if this has already been filed. I looked through issues as best as I could)

matildepark commented 3 years ago

I can do, just some form validation stuff. It only validates on blur and it only submits the request with the candidates that are in the list — anything in the input box itself isn't submitted. But we could be clearer about how that works.

ynx0 commented 3 years ago

@matildepark I was thinking about it and I think that taking inspiration from gmail could be one option. The way they do it is to first allow invalid input but then highlight it as such. Then, when the submit button is clicked, it pops up with an error.

urbit gmail example

matildepark commented 3 years ago

Validation “on submit” as opposed to on blur is needed in a few areas I think, yes. Presumably just using Formik instead of FormikOnBlur might do this.

— ~haddef-sigwen https://urbit.org

On Jan 6, 2021, at 9:10 PM, Yaseen notifications@github.com wrote:

@matildepark I was thinking about it and I think that taking inspiration from gmail could be one option. The way they do it is to first allow invalid input but then highlight it as such. Then, when the submit button is clicked, it pops up with an error.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.