Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2871: bundle screenreader - [no sandbox currently] #3356

Merged
merged 9 commits into from
Jan 24, 2025
1 change: 1 addition & 0 deletions src/registrar/forms/domain_request_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ class CurrentSitesForm(RegistrarForm):
error_messages={
"invalid": ("Enter your organization's current website in the required format, like example.com.")
},
widget=forms.URLInput(attrs={"aria-labelledby": "id_current_sites_header id_current_sites_body"}),
)


Expand Down
4 changes: 3 additions & 1 deletion src/registrar/models/utility/domain_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ class DomainHelper:

# a domain name is alphanumeric or hyphen, up to 63 characters, doesn't
# begin or end with a hyphen, followed by a TLD of 2-6 alphabetic characters
DOMAIN_REGEX = re.compile(r"^(?!-)[A-Za-z0-9-]{1,63}(?<!-)\.[A-Za-z]{2,6}$")
DOMAIN_REGEX = re.compile(r"^(?!-)[A-Za-z0-9-]{1,200}(?<!-)\.[A-Za-z]{2,6}$")
Copy link
Contributor

Choose a reason for hiding this comment

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

(potentially blocking) The from itself doesn't have a max length attribute, so if you enter more than 200 chars you just get a generic message. Should be fixable via adding max length to the form element, but this may be outside the scope of the ticket - let me know. @SamiyahKey what are your thoughts?

image


# a domain can be no longer than 253 characters in total
# NOTE: the domain name is limited by the DOMAIN_REGEX above
# to 200 characters (not including the .gov at the end)
Comment on lines +21 to +22
Copy link
Contributor

Choose a reason for hiding this comment

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

I appreciate the comments here!

MAX_LENGTH = 253

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions src/registrar/templates/domain_request_current_sites.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

{% block form_instructions %}
<p>We can better evaluate your request if we know about domains you’re already using.</p>
<h2>What are the current websites for your organization?</h2>
<p>Enter your organization’s current public websites. If you already have a .gov domain, include that in your list. This question is optional.</p>
<h2 id="id_current_sites_header">What are the current websites for your organization?</h2>
<p id="id_current_sites_body">Enter your organization’s current public websites. If you already have a .gov domain, include that in your list. This question is optional.</p>
{% endblock %}

{% block form_required_fields_help_text %}
Expand Down
8 changes: 5 additions & 3 deletions src/registrar/templates/domain_request_dotgov_domain.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h2>What .gov domain do you want?</h2>

<p id="domain_instructions" class="margin-top-05">After you enter your domain, we’ll make sure it’s available and that it meets some of our naming requirements. If your domain passes these initial checks, we’ll verify that it meets all our requirements after you complete the rest of this form.</p>

{% with attr_aria_describedby="domain_instructions domain_instructions2" %}
{% with attr_aria_labelledby="domain_instructions domain_instructions2" attr_aria_describedby="id_dotgov_domain-requested_domain--toast" %}
Copy link
Contributor

Choose a reason for hiding this comment

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

(potentially blocking) @SamiyahKey Unlike current sites, this doesn't read the header then the description. Is that something we want here? This is for the .gov domain page

Copy link

@SamiyahKey SamiyahKey Jan 23, 2025

Choose a reason for hiding this comment

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

@zandercymatics good catch! Ideally, we should follow a consistent reading order that aligns with accessibility best practices, ensuring that users receive information in a logical and expected sequence.

We should definitely be maintaining a predictable reading order. The header should generally be announced first to provide context before the description is read.

If the current implementation deviates from this pattern, we might need to revisit the heading hierarchy or ARIA roles to ensure we're meeting user expectations.

Do we know if this change was intentional? If there isn't a reason we should adjust it to match the reading order as it is throughout .gov

{# attr_validate / validate="domain" invokes code in getgov.min.js #}
{% with append_gov=True attr_validate="domain" add_label_class="usa-sr-only" %}
{% input_with_errors forms.0.requested_domain %}
Expand All @@ -67,12 +67,14 @@ <h2>Alternative domains (optional)</h2>
<p id="alt_domain_instructions" class="margin-top-05">Are there other domains you’d like if we can’t give
you your first choice?</p>

{% with attr_aria_describedby="alt_domain_instructions" %}
{% with attr_aria_labelledby="alt_domain_instructions" %}
{# Will probably want to remove blank-ok and do related cleanup when we implement delete #}
{% with attr_validate="domain" append_gov=True add_label_class="usa-sr-only" add_class="blank-ok alternate-domain-input" %}
{% for form in forms.1 %}
<div class="repeatable-form">
{% input_with_errors form.alternative_domain %}
{% with attr_aria_describedby=form.alternative_domain.auto_id|stringformat:"s"|add:"--toast" %}
{% input_with_errors form.alternative_domain %}
{% endwith %}
</div>
{% endfor %}
{% endwith %}
Expand Down
Loading