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

Fixed #35143 -- Improved accessibility of 404/500 debug pages. #17787

Merged
merged 1 commit into from Jan 31, 2024

Conversation

MHLut
Copy link
Contributor

@MHLut MHLut commented Jan 28, 2024

Fixes ticket #35143.

Notes

The HTTP 400 error page uses the same template as HTTP 500.

Requested changes

The page should have a header, main, and footer.

Done. I did not fix the indentation within the <main> element in the HTTP 500 template because it would cause a shift in most lines. The new CSS is hence somewhat hacky.

The indentation is currently inconsistent and is best fixed in a separate ticket.

Each table should have scope attributes on th elements.

Done.

Monospaced text in the patterns list should use a code element.

Done for all the pattern items in the HTTP 404 template. I kept the CSS line that sets the list font to monospace, to prevent a visual change to the list marker font.

I have also wrapped the Python Path value in the HTTP 500 page in a code block, but couldn't get a working unit test for this scenario. (there is a test draft in the related commit message).

I left all other <pre> elements without <code> for future tickets.

The small text within the h1 should use a small element instead of a span.

Done. Since <small> looked different from the original styled span, I reused the former's CSS.

@MHLut
Copy link
Contributor Author

MHLut commented Jan 28, 2024

Apologies for the multiple failed checks; I have the pre-commit running locally now.

Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@MHLut Thanks 👍 I left comments.

docs/releases/5.1.txt Outdated Show resolved Hide resolved
docs/releases/5.1.txt Outdated Show resolved Hide resolved
tests/view_tests/tests/test_debug.py Outdated Show resolved Hide resolved
tests/view_tests/tests/test_debug.py Outdated Show resolved Hide resolved
django/views/templates/technical_500.html Show resolved Hide resolved
django/views/templates/technical_500.html Show resolved Hide resolved
django/views/templates/technical_404.html Outdated Show resolved Hide resolved
django/views/templates/technical_404.html Outdated Show resolved Hide resolved
django/views/templates/technical_500.html Show resolved Hide resolved
@MHLut
Copy link
Contributor Author

MHLut commented Jan 30, 2024

As far as I can see, I've resolved all the issues we've found in the last two days.

@MHLut MHLut force-pushed the ticket_35143 branch 2 times, most recently from 8acfc57 to 88978f2 Compare January 30, 2024 15:41
@felixxm felixxm changed the title Fixed #35143 -- Accessibility improvements to debug error pages. Fixed #35143 -- Improved accessibility of 404/500 debug pages. Jan 31, 2024
@felixxm felixxm added the selenium Apply to have Selenium tests run on a PR label Jan 31, 2024
@felixxm
Copy link
Member

felixxm commented Jan 31, 2024

@MHLut Thanks for updates 👍

@MHLut
Copy link
Contributor Author

MHLut commented Jan 31, 2024

Note: The Selenium test that failed is test_inline_add_another_widgets (admin_views.test_autocomplete_view.SeleniumTests.test_inline_add_another_widgets).

As far as I know, my changes should not touch the admin, and I'm not sure where this is coming from.

This:
- changes the header, main, and footer content areas to be rendered
  in a <header>, <main>, and <footer> tags,
- adds scope attributes to <th>,
- uses <code> for a patterns list,
- uses <small> instead of <span>.
@felixxm felixxm merged commit b9e2a3f into django:main Jan 31, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Djangonauts 🚀 selenium Apply to have Selenium tests run on a PR
Projects
None yet
4 participants