Page MenuHomePhabricator

FunctionEditor: Make name and input labels mandatory on function creation (at least main language)
Open, MediumPublic

Description

Description

All multilingual labels are optional by default. However, it is quite important to make Functions searchable and their inputs understandable.
As defined during the work on About widget re-design T360610: [25Q1] Improve About widget experience for translators and multi-lingual contributors, we decide to use the FunctionEditor special page to encourage users to submit functions with names and input labels.

More details to be added as we approach this task later on.

Desired behavior/Acceptance criteria

  • ...

Devices and Design (URLs or screenshots)

  • Desktop: ...
  • Small screens/mobile: ...

Completion checklist

Event Timeline

Some thoughts and input out of a slack thread:
Proposed acceptance criteria:

Input name

  • Users must provide a name in the users main language[1] when creating a function. The function cannot be saved without the name.
  • Multilingual labels remain optional, with clear UI indications that these are not required.

Input labels:

  • Users must provide at least 1 input label when adding an input type in the users main language [1] when creating a function . The function cannot be saved without this labels.[2]

General

  • If mandatory labels are missing on 'submit'[3] a validation error should be shown, indicating the specific fields that need to be completed. [4]
  • Validation should happen on frontend only and only when creating a new object, not when editing an existing one.

Open questions:

  1. We can do 2 things; making the user language mandatory or making at least 1 random language mandatory. The last option is a lot harder from a frontend perspective, but also for the user. The error message might appear lower on the page etc etc. What do we mark invalid for each field?
  2. The rules for input labels are as follows:
    • if an input has empty type and empty label: it's considered blank and deleted
    • if an input has set label, but empty type: it's considered error, and marked as incomplete field (the type selector) when clicking 'submit'
    • if an input has set type, but empty label: it should be marked as invalid when clicking 'submit'.
  3. do we want to validate label and input label field on blur/change or on submit in the frontend? For now filled in 'submit', because this is also the easiest wa
  4. what should the copy text be of the error: 'Name is required' 'Input label is required' and display under the form field?