Description
Related to Required Fields
Problem
There are quite few problems and bad UX behavior when we try to create Entities where formula is used to generate name:
Solution
Solution covers cases where Entities are created from Views, Collections (Link or Create), Global Search and Context Views (Selects) and both cases, where user needs to provide Field values and where everything is ready. See description of behavior below, and all mock-ups with states in Figma.
Case 1: no user input needed
When Entities are created, and their names are generated with formula, where no field values are needed to be input:
There are two sub-cases:
In context menu (selects)
When user opens context relation view, where Entity names are created via formula and types something in search:
Creation row (last option after search results) is slightly changed to match our newly designed creation row from Search
Text of that row says: Create (name will be generated by formula)
After user clicks on it, we create entity straight away and set it to where it was opened from
Case 2: user input needed
Required fields in inline mode should be marked as required, otherwise users can be confused what field is required and what not (since fields will be visible from formula).
When Entities are created, where their names are generated with formula and there are fields that a user can/should fill for that formula:
In Views
As user clicks on + New we show an Entity placeholder with f (formula) icon and following text: Provide values to generate name
Next to this text we show all units required for formula to properly work
User can ignore providing values to those units and still click Create since those fields are not required (just yet), but the name will be generated with errors (or not generated at all)
f icon in the beginning can be hovered, tooltip will show Formula description and it's value
Entity placeholder is in focused state and +New button is in pressed
Same logic applies to most Views (except Grid) but the difference is in Entity placeholder sizes/dimensions. It should be adapted to other cards on a View (see Figma)
In Grid View, we show units inside the "creation" cell (if possible) and there's no Create button. It is created the way it works on Grid
In global Search
When searching for an Entity in Global search, and select a DB where name is formula generated, we show + Create row with different text:
Create (provide values to generate name) is displayed instead text that user typed in search input
We show units required for formula next to this text
We show Create button afterwards
If user switches DB to any other where Names are not generated via formula, we change this text to our current Create <name typed in input>
We show read-only Entity name field with text Provide values to generate name
We show required-for-formula fields as units below
Hovering on f icon shows tooltip with formula description and value
In Buttons :question-block:
Maybe it is better to re-write button execution UI and make it look like Quick Add. Now it is super ugly:
🦄 Minor improvements
Let's remove relation icon from empty unit
Let's fix paddings in Select menu container (it seems there is a container inside a container, which is unnecessary)
Figma
https://www.figma.com/design/JRmd7B9p7MPXFojD2fZuD1/PA---Views-%26-Search?node-id=10614-59623&t=9lp3lGGVVD28ypIN-1