Problem/Motivation
The /admin/structure/display-modes/view page has multiple ways to add view modes. Some users were confused about what's the difference between the two options. This wasn't a major challenge but something along the lines of "Hmm, I'm not sure what's the difference between these two buttons, I'll try to click both of them to see how they are different", concluding that they probably do the same thing.

Proposed resolution
In usability testing, vast majority of users navigate to this page from "Manage Display" and "Manage Form Display". From this perspective, we could remove the buttons that are specific to an entity type after #2721727: Allow user to add display modes from respective field UI's. has been done.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | drupal-remove-add-view-mode-specific-link-3365095-5.patch | 4.65 KB | vbouchet |
| #3 | drupal-remove-add-view-mode-specific-link-3365095-3.patch | 2.5 KB | vbouchet |
| Screenshot 2023-06-06 at 9.20.54.png | 287.21 KB | lauriii |
Comments
Comment #2
vbouchetRemoving the "Add view mode" local action seems not a valid option to me as in case an entity type does not have yet a display mode configured, it would become impossible to add a display mode for this entity type as not listed here.
As only removing the buttons specific is an option, please find a patch to do so.
I will search (and open a new issue if it does not exist yet) for the Form Modes UI which follows the exact same pattern.
Comment #3
vbouchetFix PHPCS feedback.
Comment #5
vbouchetI forgot to update the functional test to remove the test using the "Add new %entity_type view mode" specific button. The test is already taking care of the generic "Add view mode" flow so no need to change anything on that front.
Comment #6
smustgrave commentedThink I agree with removing the sub buttons. Is an extra click to select the entity to add a view mode for but think that's acceptable. Applied patch #5 and verified buttons are gone.
Comment #8
vbouchetMark as "Reviewed & tested by the community" as the test is now passing again.
Comment #10
lauriiiMarking this as postponed on #2721727: Allow user to add display modes from respective field UI's. as discussed in #3397535: Rethink the add view/form mode buttons on the view/form modes pages. Crediting @rkoller from the other issue.