Skip to content

Orders 7874 accessibility create return page - #2712

Merged
bc-vivekaggarwal merged 1 commit into
feature/PROJECT-7525-new-returns-flowfrom
ORDERS-7874-accessibility-create-return-page
Jul 27, 2026
Merged

Orders 7874 accessibility create return page#2712
bc-vivekaggarwal merged 1 commit into
feature/PROJECT-7525-new-returns-flowfrom
ORDERS-7874-accessibility-create-return-page

Conversation

@bc-vivekaggarwal

@bc-vivekaggarwal bc-vivekaggarwal commented Jul 22, 2026

Copy link
Copy Markdown

What?

Add accessibility support on create return page.
A/C:

  • Improve Lighthouse accessibility score.
  • All interactive controls are keyboard-operable (Tab, Shift+Tab, Enter/Space, arrow keys where appropriate)
  • All form controls have programmatically associated labels; no unlabelled controls
  • Validation errors announced via live region; individual errors linked to their fields
  • Loading/in-flight and success states communicated non-visually
  • Focus managed correctly on page load and after errors

Requirements

  • CHANGELOG.md entry added (required for code changes only)

Tickets / Documentation

ORDERS-7874

Screenshots (if appropriate)

Manual Testing:
Before implementation:

Lighthouse score:
accessibility returns current

Behavior:

  • Improper navigation focusing on top level links instead of functionality on the page
  • No navigation to disabled buttons that can announce the reason for being disabled
  • No announcement during loading/in-fligh state
  • Navigation focus doesn't change to alerts and continue from last action button(Submit button here).
Screen.Recording.2026-07-22.at.11.55.53.am.mov
  • No announcement of success message on landing on success page.
Screen.Recording.2026-07-22.at.4.19.52.pm.mov
After implementation:

Lighthouse score(this will further be improved by implementation of ORDERS-7945):
accessibility returns new

Navigation Behavior(starts with return heading and goes into items first):
https://github.com/user-attachments/assets/69b44efb-c37f-40c8-a805-2e48717f8e59

e2e behavior:
https://github.com/user-attachments/assets/3ffe1b68-8267-4e95-9f71-bf2b50f0895a


Note

Low Risk
Changes are limited to create-return template, JS, SCSS, and strings; no auth, payments, or shared checkout paths. Submit gating now relies on aria-disabled plus JS, which is intentional but worth a quick regression pass on keyboard submit.

Overview
Improves keyboard and screen-reader support on the account create return page so tab order, labels, and status announcements match WCAG-oriented expectations.

Focus and announcements: On load, focus moves to the page h1 (newReturn-heading). Submitting sets aria-busy on the form, speaks a submitting message via an assertive live region, and on failure focuses the error alert; on success focus lands on the confirmation heading.

Submit control: The submit button stays in the tab order using aria-disabled (not native disabled), with hidden hints that explain what’s missing vs. when submit is ready; JS blocks submit when aria-disabled is true.

Markup and labels: Order line items are a semantic ul/li list. Quantity selects use aria-labelledby tying labels to product names. Decorative dividers and the arrow on the policy link are hidden from assistive tech. Header layout is adjusted so order date placement matches mobile/desktop flex order.

Styles: Secondary text uses darker grey for contrast; focus-visible outlines target WCAG 2.2 focus appearance; invalid submit styling reflects aria-disabled.

New strings in lang/en.json: submit_hint, submit_ready, submitting.

Reviewed by Cursor Bugbot for commit 448ea39. Bugbot is set up for automated code reviews on this repo. Configure here.

@bc-vivekaggarwal
bc-vivekaggarwal changed the base branch from master to feature/PROJECT-7525-new-returns-flow July 22, 2026 02:30
@bc-vivekaggarwal bc-vivekaggarwal changed the title Orders 7874 accessibility create return page [DRAFT] [WIP] Orders 7874 accessibility create return page Jul 22, 2026
@bc-vivekaggarwal bc-vivekaggarwal changed the title [DRAFT] [WIP] Orders 7874 accessibility create return page Orders 7874 accessibility create return page Jul 22, 2026
@bc-vivekaggarwal
bc-vivekaggarwal marked this pull request as ready for review July 22, 2026 06:29
@bc-vivekaggarwal
bc-vivekaggarwal requested a review from a team as a code owner July 22, 2026 06:29
@bc-vivekaggarwal
bc-vivekaggarwal force-pushed the ORDERS-7874-accessibility-create-return-page branch from 3ac1c07 to ff43308 Compare July 22, 2026 06:57
@bc-vivekaggarwal
bc-vivekaggarwal force-pushed the ORDERS-7874-accessibility-create-return-page branch from ff43308 to 70e04c4 Compare July 22, 2026 23:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves accessibility on the account Create Return page by adding screen-reader announcements, keyboard focus management, and more descriptive labeling/semantics for return line items and submit behavior.

Changes:

  • Adds focus management (initial focus on heading, focus on error alert, focus on confirmation heading) and an assertive live region announcement during submission.
  • Updates markup semantics for line items (list structure) and introduces aria-disabled + hint text for the submit control.
  • Adjusts styling for contrast, DOM/visual ordering, aria-disabled button appearance, and :focus-visible outlines; adds new English strings and a changelog entry.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
templates/pages/create-return.html Adds live region, focusable headings/alerts, list semantics, and new ARIA labeling/hints for form controls.
assets/js/theme/create-return.js Implements focus-on-load, live-region announcements, aria-disabled submit gating, and success/error focus behavior.
assets/scss/components/stencil/createReturn/_createReturn.scss Improves contrast and focus styling; styles aria-disabled buttons; supports new list wrapper.
lang/en.json Adds new accessibility-related strings for submit hints and submission status.
CHANGELOG.md Records the accessibility improvements for the create return page.
Comments suppressed due to low confidence (3)

templates/pages/create-return.html:97

  • The resolution is labelled via aria-labelledby pointing at a that is display:none at most breakpoints (.newReturn-controlLabel). If that label is not exposed, the control’s accessible name may omit the “Request” label text. <label class="newReturn-controlLabel" id="newReturn-resolutionLabel-{{id}}" for="resolution-{{id}}">{{lang 'account.returns.request'}}</label> <select class="form-select form-select--small" id="resolution-{{id}}" aria-labelledby="newReturn-resolutionLabel-{{id}} newReturn-itemName-{{id}}"> templates/pages/create-return.html:104 The reason is labelled via aria-labelledby pointing at a that is display:none at most breakpoints (.newReturn-controlLabel). Hidden labels can be dropped from the accessibility tree, leaving the control without the “Reason” label text in its accessible name.
                    <label class="newReturn-controlLabel" id="newReturn-reasonLabel-{{id}}" for="reason-{{id}}">{{lang 'account.returns.reason_header'}}</label>
                    <select class="form-select form-select--small" id="reason-{{id}}" aria-labelledby="newReturn-reasonLabel-{{id}} newReturn-itemName-{{id}}">

templates/pages/create-return.html:34

  • The error summary markup nests a

    inside another

    (invalid HTML). Browsers will auto-close the first

    , which can lead to inconsistent DOM/announcement behavior for the alert content.

        <p class="alertBox-message" data-return-error-message>
            {{lang 'common.generic_error'}}
            {{#if ../settings.phone_number}}
            <p class="alertBox-message">
                {{lang 'account.returns.contact_merchant' phone_number=../settings.phone_number }}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +85 to +89
<label class="newReturn-controlLabel" id="newReturn-qtyLabel-{{id}}" for="qty-{{id}}">{{lang 'account.orders.return.quantity'}}</label>
<div class="newReturn-orderLineItemQtyWrapper">
<select class="form-select form-select--small form-select--short"
id="qty-{{id}}"
aria-label="{{lang 'account.orders.return.quantity'}}">
aria-labelledby="newReturn-qtyLabel-{{id}} newReturn-itemName-{{id}}">

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aria-labelledby includes the referenced element's text even when it's display:none

Comment thread lang/en.json Outdated
"select_resolution": "Select preferred resolution",
"select_reason": "Select a return reason",
"submit_hint": "Select a quantity, preferred resolution, and reason for at least one item to submit your return.",
"submit_ready": "Press Enter to submit your return.",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment thread assets/js/theme/create-return.js Outdated
Comment on lines +55 to +56
// aria-disabled (not the native disabled attr) keeps the button keyboard/SR reachable while
// invalid; the described-by hint swaps between "what to select" and "press Enter to submit".

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\nit
to keep comments connected and not new-lined mid sentence or with one word left:

// aria-disabled (not the native disabled attr) keeps the button keyboard/SR reachable while invalid.
// the described-by hint swaps between "what to select" and "press Enter to submit".

@bc-vivekaggarwal
bc-vivekaggarwal force-pushed the ORDERS-7874-accessibility-create-return-page branch from 70e04c4 to 19579a4 Compare July 24, 2026 03:57
Comment thread assets/scss/components/stencil/createReturn/_createReturn.scss
@bc-vivekaggarwal
bc-vivekaggarwal force-pushed the ORDERS-7874-accessibility-create-return-page branch from 19579a4 to a4efb13 Compare July 24, 2026 04:52
@BC-SEven
BC-SEven force-pushed the feature/PROJECT-7525-new-returns-flow branch from de1a079 to 4f7dccc Compare July 27, 2026 01:17
@bc-vivekaggarwal
bc-vivekaggarwal force-pushed the ORDERS-7874-accessibility-create-return-page branch from a4efb13 to fffac5b Compare July 27, 2026 03:34
Comment thread templates/pages/create-return.html
@bc-vivekaggarwal
bc-vivekaggarwal force-pushed the ORDERS-7874-accessibility-create-return-page branch from fffac5b to 5e879e3 Compare July 27, 2026 03:45
Comment thread templates/pages/create-return.html Outdated
@bc-vivekaggarwal
bc-vivekaggarwal force-pushed the ORDERS-7874-accessibility-create-return-page branch from 5e879e3 to 6d85e39 Compare July 27, 2026 05:47

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6d85e39. Configure here.

.newReturn .button[aria-disabled="true"] {
cursor: not-allowed;
opacity: 0.5;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabled submit keeps hover styles

Low Severity

Replacing native disabled with aria-disabled left the submit control under .button--primary hover and active styles. Only opacity and cursor are overridden, so the control still looks interactive on pointer hover even though activation is blocked in JS.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6d85e39. Configure here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for accessibility features so user can go to the button and understand why a button is disabled

@bc-vivekaggarwal
bc-vivekaggarwal force-pushed the ORDERS-7874-accessibility-create-return-page branch from 6d85e39 to 448ea39 Compare July 27, 2026 05:55
@bc-vivekaggarwal
bc-vivekaggarwal merged commit 341d6bb into feature/PROJECT-7525-new-returns-flow Jul 27, 2026
1 check passed
@bc-vivekaggarwal
bc-vivekaggarwal deleted the ORDERS-7874-accessibility-create-return-page branch July 27, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants