Problem/Motivation

New version of field creation adds unnecessary clutter to the form and increases cognitive load for using the form. ThIs version also breaks conventions on basic html elements. With some changes the form's usability can be easily improved.

Cognitive (gestalt) principles involved are similarity, proximity and same container. The principles are known to take precedence by similarity being overridden by proximity and proximity overridden by same container.

Radio buttons

Radio buttons are based on similarity and proximity. When a radio buttons are placed far away from each other and especially if separated into visual containers the brain will not understand them to be related. Thus here they add visual clutter and cognitive strain by not matching familiar patterns.

First step before

Second step before

Overlapping options to be addressed in a follow-up #3410851: "Selection list" should be removed from field types and given as an option for "number" and "plain text"

Field types are not well defined and hiding the options details makes user unable to select the correct type without toggling between types to read the options descriptions. Especially selection list overlaps with plain text and number. For end user "selection list" is a display widget for contend that is either text, number or reference.

Field dialog GUI highlighting overlap of selectable items

Steps to reproduce

Proposed resolution

  1. Radio buttons should never be used unless they are aligned vertically.
    • Just visually hide the radio buttons and use the whole box to highlight the hover or selected item.
    • Instead of using input for field type, consider using HTML summary or html_tag for type and details containing radiobuttons for options. If we must have input value for type, then consider using hidden and set the correct one based on selected option. This should be logically possible because of the hierarchy/cadinality of types vs options.
  2. Increase the attention value of selected type and its option to form a group that is recognized as strongly connected items. This could be achieved by proximity (display options next to the selected type) or strong similarity (shape, color), this is eliminated with the use of the two step form as the second step makes a focused sub option approach.
  3. "Selection list" should be removed from field types and given as an option for "number" and "plain text" (would be addressed later in a follow up #3410851: "Selection list" should be removed from field types and given as an option for "number" and "plain text" )

Text content for descriptions should be reviewed in a separate task.

Remaining tasks

  1. Reduce the distance between related options which was partially addressed by #3408326: Make field selection a two-step form , as we moved to a two step form.
  2. Convert the first step into using cards as clickable items to navigate to the sub-options.
  3. Vertically align all the options on the second step so they are easier to understand.
  4. Adjust the tests for the new UI experience.
  5. Accessibility review

User interface changes

First step after
Now uses clickable cards which navigate to the sub-options/field storage options.

Second step after
Now Vertically aligned for easier scanning.

API changes

Data model changes

Release notes snippet

Issue fork drupal-3389200

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

simohell created an issue. See original summary.

simohell’s picture

Title: Field selection breaks conventions and add cognitive load » Field selection breaks conventions and increases cognitive load
simohell’s picture

Issue summary: View changes
simohell’s picture

StatusFileSize
new241.66 KB

Here is a rough example how to use proximity to connect type and options (the extra large "boolean" is an unintended side product)
mockup

simohell’s picture

Issue summary: View changes
simohell’s picture

Issue summary: View changes
simohell’s picture

Issue summary: View changes
benjifisher’s picture

simohell’s picture

lauriii’s picture

Status: Active » Closed (duplicate)

Let's mark this as a duplicate to #3386762: Use modals in field creation and field edit flow. We can reopen this if this doesn't get addressed by that issue.

benjifisher’s picture

Status: Closed (duplicate) » Active

I think that #3386762: Use modals in field creation and field edit flow was poorly scoped, and trying to address these points in that issue was a mistake. I am re-opening this issue and adding it to the issue summary of #3346539: [Plan] Improve field creation experience.

omkar.podey’s picture

Issue summary: View changes
StatusFileSize
new216.2 KB

So going for something similar on #3386762: Use modals in field creation and field edit flow, without the modal for now.

omkar.podey changed the visibility of the branch 3389200-field-selection-breaks to hidden.

omkar.podey changed the visibility of the branch 3389200-field-selection-breaks to active.

omkar.podey’s picture

Assigned: Unassigned » omkar.podey

kunal.sachdev made their first commit to this issue’s fork.

omkar.podey’s picture

Assigned: omkar.podey » Unassigned
Status: Active » Needs review
smustgrave’s picture

Is this ticket still valid after #3408326: Make field selection a two-step form?

lauriii’s picture

I think we should update the issue summary to remove the parts that have been addressed by #3408326: Make field selection a two-step form.

smustgrave’s picture

Status: Needs review » Needs work

Just for issue summary,

Side note all the work being done around the fields has been fantastic!

kunal.sachdev’s picture

Tested it locally and works as expected. The screenshots needs to be updated in IS as the field selection is a two step form now.

omkar.podey’s picture

Issue summary: View changes
StatusFileSize
new296.17 KB
new181.17 KB
new274.08 KB
new197.5 KB
omkar.podey’s picture

Status: Needs work » Needs review
omkar.podey’s picture

Issue summary: View changes
smustgrave’s picture

Issue tags: +Needs usability review

Think this will need usability review

But I find it very odd/annoying that clicking on any item auto takes me to the 2nd form. So I have to continuous click back if I clicked the wrong field.

But will leave for others to review.

dishakatariya’s picture

Assigned: Unassigned » dishakatariya
dishakatariya’s picture

Assigned: dishakatariya » Unassigned
StatusFileSize
new137.56 KB
new85.3 KB
new121.79 KB
new88.72 KB

Hi, Verified and tested the current changes on Branch 11.x version.
Followed the below testing steps:
1. Install the Drupal version 11.x
2. Fetch current branch
3. Create content type as landing page
4. Create a new field
5. select any field
6. Observe the changes on next page
Taking reference from #26 comment,
Usability i have observed here:
1. In this form (first step)select/choose field option should be there on each fields, user might get confuse here: admin/structure/types/manage/test_landing_page/fields/add-field
2. Its better to have one step form.
Attaching screenshot for reference:
keeping it to Needs review state.
Thanks!

narendrar’s picture

Status: Needs review » Needs work

After selecting a field when user goes to next page and clicks `back` button, user goes to field section page which is correct, but if now user refresh the page by submitting the url again, it goes to next page, which does not seems correct to me.

Also IS can be updated as per implemented functionality.

omkar.podey’s picture

Issue summary: View changes
omkar.podey’s picture

Issue summary: View changes
omkar.podey’s picture

Status: Needs work » Needs review
Issue tags: -Needs issue summary update
narendrar’s picture

Status: Needs review » Needs work

Last commit will only work for node entity, but it will throw exception in case of other entities like block, taxonomy etc.

omkar.podey’s picture

Status: Needs work » Needs review
prashant.c’s picture

The incorporation of a "Back" button in step 2 has enhanced usability. I have tested it for various content types, and it appears to be functioning as anticipated.

narendrar’s picture

Status: Needs review » Needs work

Overall looks good to me. I think unnecessary changes can be reverted.

omkar.podey’s picture

Status: Needs work » Needs review
prashant.c’s picture

During my local testing, I observed that when adding a new field and being redirected to the field form after selecting the field type, the URL includes a query parameter, for example ?entity_type=node , in case of the content types. This query parameter is actually necessary ?

Thank you.

omkar.podey’s picture

It is not passed explicitly if you look at the route $path/fields/add-field/{new_storage_type} in core/modules/field_ui/src/Routing/RouteSubscriber.php I think it's just visible now because of passing the extra parameter while calling this route, easy fix just pushing now.

narendrar’s picture

Status: Needs review » Reviewed & tested by the community

The changes look good to me. Marking as RTBC. However, a usability review might still be required.

simohell’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs usability review +Needs accessibility review

Usability review

We discussed this issue at #3411359: Drupal Usability Meeting 2024-01-05. That issue will have a link to a recording of the meeting.

For the record, the attendees at today's usability meeting were @benjifisher, @Emma Horrell, @rkoller, @shaal and @simohell.

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

The MR addresses the main points of the issue. Visual presentation has been improved. Some of the usability problems present in the current MR are being addressed by other issues and seen as out of scope for this issue. Keyboard navigation was tested roughly and the MR improves it's usability.

This issue would benefit from separate accessibility review.

Requested change

A small change request is to make description texts in both form steps visually consistent. At selecting the field type description is smaller that the label and in a dark grey colour. Selecting the option for field type uses same style for both the option text and the description. It is recommended to use same styles for text in both steps: larger text for label/option and a bit smaller maybe dark grey for description (like in the first step).

omkar.podey’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new106.23 KB

Grayed out and reduced font as suggested.

kanchan bhogade’s picture

Assigned: Unassigned » kanchan bhogade
kanchan bhogade’s picture

Assigned: kanchan bhogade » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new121.76 KB
new95.32 KB
new120.46 KB
new87.26 KB

Hi,
Verified and tested the MR 5869 on the Drupal 11.x version.

Testing steps:

  1. Install the Drupal version 11.x
  2. Go to the Structure->content types-> manage any content type
  3. Create a new field
  4. select any field
  5. Observed Add field for state 1 and step 2
  6. Apply Patch, and checked

Test Result:
Add field's step two font is updated as mentioned in #41; Label text and description text font is as same form step one.

Attaching screenshots for reference

Moving to RTBC

benjifisher’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs issue summary update

@Kanchan Bhogade:

Thanks for the new screenshots, and for explicitly reviewing the changes made in response to Comment #41.

It would help to add the new screenshots to the issue summary. I am adding the issue tag for that.

This issue still needs an accessibility review, so it is too early for RTBC. I am adding an item to the "Remaining tasks" section of the issue summary to remind people of that.

omkar.podey’s picture

Issue summary: View changes
StatusFileSize
new145.89 KB
omkar.podey’s picture

bnjmnm’s picture

Status: Needs review » Needs work

So the changes here turn the radio elements into links. In order to make that change accessible it would be necessary to:

  • Remove the <form> element. By changing these to links, it is now semantically incorrect as it is a form with no form elements (but in issue #3386762, these would open modals and could be buttons instead... and could still live inside a form)
  • The links need to be styled as links. If clicking something takes you to a new page, the appearance should be consistent with the other elements that would take the user to another page. (but....... in issue #3386762, these would open modals and could be buttons and retain their styling)

The changes needed to make the changes in THIS issue accessible would effectively be unnecessary once #3386762 lands. Those same changes would also make #3386762 more difficult to land as it would require undoing much of that work to get back to where HEAD is. I can think of three possible approaches to navigating this:

  • Include modal support in this issue instead of #3386762. However, I think that was the originally intended approach and there were objections to it so I'm not sure how feasible that is.
  • Make the changes listed above to make THIS issue accessible, and accept that it will add complexity to #3386762 (open in modals)
  • Approach this issue as if #3386762 will land (make the options buttons within a fieldset), but commit to reverting the changes here before the next release if it turns out #3386762 can't make it in. I'm not opposed to this approach... but I'm concerned that there's no formal policy in place to ensure the revert happens. What is here is acceptable as an intermediate step, but is not acceptable to release. (maybe there's a way to only commit to 11.x and disallow addition to 10.x until #3386762 is there as well?)
omkar.podey’s picture

Okay so it does not make much sense to get this in and not the modals , @benjifisher what do you think?, can we merge #3409379: Move the first two steps of field creation into a modal. ((which was rebased on top of this issue hence might seem like a lot of changes but it's not)), here it won't be too much to review or too many changes in one MR and it seems to be the fastest and the most efficient way forward.

omkar.podey’s picture

StatusFileSize
new4.45 MB

It still dictates the links and the content inside, is it still an accessibility issue ? Uploaded a sample video voiceover_field_selection.mov

bnjmnm’s picture

It still dictates the links and the content inside, is it still an accessibility issue ?

Afraid so, just because a screenreader can see it does not mean it's correctly categorized/conveyed. Two issues is that they are contained in a <form> with no form elements, and they are not logicially grouped - they're just seen as individual links where it's not immediately clear that they represent a single choice within a group of options.

omkar.podey’s picture

Status: Needs work » Needs review

I am trying to get them in quick succession instead the modals issue is mostly sorted out #3409379: Move the first two steps of field creation into a modal..

bnjmnm’s picture

Status: Needs review » Needs work

I think it's reasonable to complete this issue with the intent to complete #3409379: Move the first two steps of field creation into a modal. before the next minor release, otherwise we revert. Doing this successfully will demonstrate that we can be a bit more incremental than our current cadence, and my hope is that can increase innovation momentum in Drupal. If the followup doesn't make it in it will demonstrate that such an approach is unwise to do in the future, so lets be sure to avoid that and show we can handle a bit more flexibility.

omkar.podey’s picture

Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new8.51 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

sakthi_dev made their first commit to this issue’s fork.

omkar.podey’s picture

Status: Needs work » Needs review

Split into controller and form. So we have no forms without form elements.

bnjmnm’s picture

Split into controller and form. So we have no forms without form elements.

Nice work @omkar.podey. While this won't be fully accessible until we land #3386762: Use modals in field creation and field edit flow, the changes that are best done within this issue's scope are addressed so I'll remove the tag. This will still require a broader code review but unless there are major changes the A11y is all set.

omkar.podey’s picture

HitchShock made their first commit to this issue’s fork.

hitchshock’s picture

FYI. The function field_ui_form_field_ui_field_storage_add_form_alter() still exists in the code after #3356894: Make field selection less overwhelming by introducing groups.
Atm this is a dead code cuz the behaviour/logic was changed.
Since this ticket is in fact a continuation of that epic, it is the best candidate to remove this useless function.

Updated MR.

smustgrave’s picture

Status: Needs review » Needs work

May need a rebase but Unit and Javascript tests failed.

omkar.podey’s picture

Status: Needs work » Needs review
bnjmnm’s picture

Status: Needs review » Needs work

Left feedback on MR

ifrik’s picture

This looks much cleaner, but the order of the fields still has no recognizable structure, thereby making it difficult to find the right field type.

For example, if you install Commerce module in addition to core. In the previous dropdown all Commerce fields were grouped together but now they are random scattered over the grid.

Also even with the decluttered cards, the grid is difficult to scan especially when you have contrib modules (like Commerce) installed and you end up with some 30 field types, spread over 3 or 4 columns

Changes that would make it easier to find field types could be
- to add a filter field (similar to on the modules page),
- grouping fields by again (at least if they are provided by a contrib module),
- and allowing users to switch to displaying the fields in a list rather then an a grid, because that's easier to scan.

ifrik’s picture

StatusFileSize
new165.98 KB

Screenshot of a site with Commerce module installed.
Screenshot of 25 field types

plopesc’s picture

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.