Problem/Motivation

Four interaction defects affect keyboard, screen-reader and no-JS users, and one affects every reader who posts a comment.

Submitting a comment gives almost no visible feedback. The handler sets aria-busy on the form (js/comment-form.js:117), sets form.inert (:129), disables the buttons, and prepends a small "Submitting comment..." status line to the top of the form (:83-93). But there is no CSS rule for a busy form: the only [aria-busy="true"] rule in the module is comment.css:223, scoped to .act-comment-approval, and [data-act-form-feedback] carries only a margin (comment-form.css:20). inert applies no visual treatment of its own. So after a long comment the only cue inside the viewport is that the Save button stops looking clickable, while the status line sits at the top of the form, potentially well above the fold. Reported from real use: "the buttons went disabled, and I did see a small message at the top of the form ... but if my comment was longer I might not've seen that."

The same status line is also unlikely to be announced. On the first submission of a page, the live region is created and populated in a single synchronous task (js/comment-form.js:83-93), and live regions must exist in the accessibility tree before their content changes. Every other announcement in the file is backed by Drupal.announce; this one is not.

After a validation error, focus is lost to the top of the document because the errored node is replaced and the error branch never restores it. Branch expansion gives no busy/loading feedback and can fail silently, with no re-entry guard and no catch on the failure announce. With the default density, a no-JavaScript reader sees subject lines and bylines but zero comment bodies, no show-all link, and several JS-only controls rendered enabled.

Steps to reproduce

  • Write a comment long enough that the top of the form scrolls out of view, then press Save; observe that the only in-viewport cue is the disabled buttons, with no spinner, no dimming, and no message near the button.
  • Submit the first comment of a page with a screen reader; observe "Submitting comment..." is not announced.
  • Submit an empty reply; observe focus move to the top of the document.
  • Click a caret on a slow branch; observe a multi-second wait with no loading indicator.
  • Disable JavaScript; open a default-density thread; observe no comment bodies and enabled JS-only controls.

Proposed resolution

  • Give the busy form a visible state. The hook already exists: add a rule for .act-reply-form[aria-busy="true"] / form[aria-busy="true"] that dims and visually locks the form, matching the existing [aria-busy] treatment at comment.css:223.
  • Put a cue where the reader is looking: a spinner or "Saving..." label adjacent to the Save button, not only at the top of the form. Consider also pinning the status line to the form's action row rather than prepending it.
  • Announce submission start via Drupal.announce, or render an empty [data-act-form-feedback][role=status] container server-side in InlineReply::alter() so the live region pre-exists its first mutation.
  • Restore focus to a sensible target (the invalid field or the feedback node) after a validation error.
  • Add aria-busy/loading state, a re-entry guard, and a visible error path to branch expansion.
  • Hide JS-only controls when JS is absent; render a show-all link; consider a non-empty default density.

Remaining tasks

  • Verify the busy state is visible without scrolling on a comment long enough to push the form header off screen.
  • Verify keyboard, screen-reader and no-JS flows.

User interface changes

Adds a visible saving state on the comment form and a cue next to the Save button, restores focus after errors, adds loading feedback, and makes no-JS content usable.

API changes

None anticipated.

Data model changes

None anticipated.

Comments

freelock created an issue. See original summary.

  • freelock committed 4cbaa266 on 1.0.x
    fix: #3623177 UX robustness: submit feedback, focus, and no-JS fallback
    
freelock’s picture

Status: Active » Needs work

Alpha3 follow-up: visible summaries are not a readable fallback

The submission feedback, validation focus, and branch feedback improvements are present. The no-JavaScript requirement remains incomplete: the default single density omits comment bodies, and Show all retains that density and the depth restriction.

Kernel rendering of 100 roots plus one reply produced 100 root summaries and zero bodies after following Show all. With full density but depth one, the child remained absent and no show-all link appeared when siblings were not truncated. Depth zero rendered no rows and incorrectly displayed “No comments yet.”

Steps to reproduce

  1. Disable JavaScript and open a default-density discussion.
  2. Follow Show all and attempt to read a comment body and a depth-hidden reply.
  3. Repeat with depth zero; inspect the empty-state message and inactive Expand thread button.

Remaining work and acceptance

  • Provide a real server-rendered navigation path to readable bodies and depth-hidden comments.
  • Distinguish an empty discussion from a nonempty discussion whose rows are withheld.
  • Hide or replace controls that cannot operate without JavaScript.
  • Test actual generated HTML with JavaScript disabled, follow the fallback links, and assert body content and nested replies are reachable.

A changed default alone is insufficient for existing placements configured with summary density or depth zero.

  • freelock committed b85fb008 on 1.0.x
    fix: #3623177 UX robustness: submit feedback, focus, and no-JS fallback
    

  • freelock committed 6331d52c on 1.0.x
    fix: #3623177 UX robustness: submit feedback, focus, and no-JS fallback
    
freelock’s picture

Status: Needs work » Fixed

Fixed in Alpha4.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.