Problem/Motivation

Spin off from #3604037: [PP-1] Indicate that grouping elements have child element errors for UX and a11y.

Child elements in the forms sidebar are invisible to the user when the sidebar is closed. It's the same fundamental problem as with the related grouping element issues.

To improve the user experience and accessibility we should indicate when there are errors 'inside' the closed sidebar. Currently it is hard for the user to find the actual problematic field when the (child) field itself is invisible.

I'm assuming this is Major for the same reasons that the issues for standard grouping elements are.

Steps to reproduce

  1. Standard installation
  2. Log in as admin
  3. Set Default Admin as the admin theme.
  4. Install the article test recipe (drush recipe core/tests/fixtures/recipes/article_content_type),
    or create an Article content type & install the Path module (aka path_alias).
  5. Go to /node/add/article.
  6. Reduce viewport width until the sidebar on the right containing the "advanced" fields collapses.
  7. Enter a value in the Title field to limit errors.
  8. Click the toggle button to expand the right sidebar.
  9. Enter a value without a beginning slash in the URL alias field.
  10. Close the sidebar.
  11. Clear / reset caches (drush cr). This is a temporary measure.
    Tested on the MR tugboat preview as of 2026-09-07, and clearing the cache was not necessary.
  12. Click the Save button.
    This should cause a validation error: "The alias path has to start with a slash".
Expected

The closed sidebar indicates that there is an invalid field within it, for the same reasons that details and vertical tabs elements indicate that there are child errors for #3604037: [PP-1] Indicate that grouping elements have child element errors for UX and a11y.

See the Proposed resolution for details.

Actual

There's no indication that the closed sidebar contains an invalid field.

Proposed resolution

Add a visual indicator to the toggle control.

  1. Place the prohibition icon from the top error block at the logical inline start of the toggle button, previous to the sidebar icon.
    This means on the left for LTR and on the right for RTL.
  2. In the toggle control's default state, the sidebar icon is red.
  3. Use the input error color from invalid fields for the sidebar icon and the prohibition icon (var(--input--error-color)).
  4. Append visually hidden " (sidebar contains error)" to the text content of the toggle control. This is mostly consistent with the hidden text in #3604037: [PP-1] Indicate that grouping elements have child element errors for UX and a11y and #2848507: Indicate that grouping elements have child element errors for ux and a11y.
  5. Include both icons in the clickable area of the button.

Screenshot of proposed error states:

Toggle control in normal, error, error plus hover, and error plus focus states.

Does it also need hidden text like #3604037: [PP-1] Indicate that grouping elements have child element errors for UX and a11y?. IIUC [KentR], UX team said yes in the 2026-08-28 Usability Meeting.

Remaining tasks

  1. Add a visual indicator to the toggle control.
  2. Create merge request.
  3. Add test.
  4. Refactor code to bust the render cache for the toggle button when there are validation errors in the advanced sidebar.
  5. Update test.
  6. Usability / UX review.
  7. Make the element uncacheable, possibly with a lazy builder as @berdir suggested in Slack (?)
  8. Take screenshots for the User interface changes section of the issue summary, performing any manual testing that's not covered by the UX review.
  9. Create change record (?)

User interface changes

Toggle control in normal, error, error plus hover, and error plus focus states.

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3619387

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

kentr created an issue. See original summary.

kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
kentr’s picture

Title: [PP-1] Indicate that forms sidebar has child element errors for UX and a11y » Indicate that forms sidebar has child element errors for UX and a11y
Issue summary: View changes
StatusFileSize
new75.15 KB

It's actually not postponed on #2848507: Indicate that grouping elements have child element errors for ux and a11y.

Here's a screenshot of the toggle control from the issue fork. IMO it needs a non-color visual cue also.

kentr’s picture

Issue summary: View changes
kentr’s picture

Assigned: Unassigned » kentr
Issue summary: View changes
Status: Active » Needs work
Issue tags: +Needs tests, +Needs merge request
StatusFileSize
new22.79 KB

Added the error icon to the toggle control and screenshot of the control in different states.

Needs a test.

kentr’s picture

Assigned: kentr » Unassigned
kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
Issue tags: +Needs usability review
kentr’s picture

Issue summary: View changes
mgifford’s picture

I started this and got interrupted too many times.

I think it is close to working now though. I think that the name of the show/hide button needs to stay the same (and indicate open or closed). I'm too tired to think about that now.

From AI...

Bundle is ready: /Users/mgifford/drupal-core/issue-3619387-review.zip (61 KB, 30 files).
What's inside:

  • 3619387-sidebar-errors-full.patch — standalone, uploadable full patch (vs branch base HEAD). Also copied as sidebar-errors-full.patch.
  • sidebar-errors-interdiff.patch — interdiff vs patches/core-a11y-aggregate-2026-07-20.patch. Helper.php is intentionally omitted because its has-error work is already in that aggregate; the interdiff is the delta beyond it (CSS, sidebar.js modal logic, FormHooks/PreprocessHooks changes, test).
  • sidebar-errors-comment.md — proposed issue-queue comment (with the required LLM disclosure line).
  • guidepup/ — sidebar-modal.voiceover.mjs (VoiceOver harness), README.md (install/run + diff before/after), ANALYSIS.md (expected before/after SR behavior).
  • src/ — copies of all 7 changed files for direct review without patching.
  • README.md — bundle index + local verify commands.

One caveat carried over from before: the live Guidepup/VoiceOver run can't execute inside this Linux container — the harness + expected analysis are ready, and you run node guidepup/sidebar-modal.voiceover.mjs on your macOS host (with VoiceOver automation enabled), twice (before/after), then diff the logs.

The working tree is unchanged (the temp baseline branch I used for the interdiff was deleted). Nothing is committed.

kentr’s picture

The UX team looked at this in the last meeting: #3618410: Drupal Usability Meeting 2026-08-28. Looks like the recording and transcript aren't up yet, but I listened in.

What I remember as far as their suggestions:

  1. Put the error icon at the "beginning" (logical inline start) of the toggle instead of at the end, so that the primary toggle icon doesn't move.
  2. Do add hidden text.
    IIRC they didn't have a specific suggestion for the text content, but they said it's a little weird with the changing verb in the accessible name.
    Removing the verb is currently part of #3619154: Accessibility fixes for Admin theme's toggle control.
    IMO, the error text should be somewhat consistent with the text added by #2848507: Indicate that grouping elements have child element errors for ux and a11y.

I'm working on implementing those suggestions.

kentr’s picture

Picking this back up.

kentr’s picture

Issue summary: View changes

kentr’s picture

Issue summary: View changes
Issue tags: -Needs merge request
kentr’s picture

Issue summary: View changes
StatusFileSize
new23.16 KB
kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
kentr’s picture