feat(ui): add focus-visible, skip link, ARIA attributes, and code pan… - #108
Closed
Prag-18 wants to merge 3 commits into
Closed
feat(ui): add focus-visible, skip link, ARIA attributes, and code pan…#108Prag-18 wants to merge 3 commits into
Prag-18 wants to merge 3 commits into
Conversation
|
@Prag-18 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
2 tasks
Owner
|
@Prag-18 resolve the merge conflicts |
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves keyboard accessibility and screen reader support across the entire
DevPath application. Previously, interactive elements such as nav links, skill chips,
form controls, and the code viewer panel had no visible focus indicators, making the
app nearly unusable for keyboard-only users. The changes introduce a consistent
:focus-visiblering system (indigo on light backgrounds, yellow on dark), askip-to-main-content link, proper ARIA attributes on all interactive controls, and a
full focus trap with return-focus behaviour on the slide-up code panel — all without
altering any existing hover states or visual design.
Related Issue
Closes #25 [Add keyboard accessibility improvements]
Type of Change
data/projects.jsonWhat Was Changed [required]
static/style.css.skip-linkstyles; global*:focus-visiblering with dark-context overrides; per-component focus overrides for every interactive element classtemplates/index.html<main id="main-content">landmark,aria-expanded+aria-controlson mobile nav toggle,role="alert"+aria-liveon all error<div>s,aria-required+aria-describedbyon all<select>s,aria-liveon results sectiontemplates/project.html<main>landmark,aria-labelon<nav>,aria-expanded+aria-controlson both View Code buttons,role="dialog"+aria-modal+aria-labelon code panel,aria-hiddenon all decorative SVGsstatic/script.jsaria-expandedstring value on mobile toggle; addedEscapekey handler to close mobile menu and return focus to toggle; addedkeydownhandler for skill quick-pick chips; wired "Try Different Inputs" viaaddEventListener(replaced inlineonclick) and focuses skills input after scroll; implemented full focus trap (Tab/Shift+Tab wrap) inside code panel; returns focus to trigger button when panel closes; restoredfetchStarterCodefunctionHow to Test This PR
git checkout feat/keyboard-navigationpip install -r requirements.txtpython app.pyKeyboard navigation tests:
Tabimmediately on page load — a "Skip to main content" link should appear at the topEnteron the skip link — focus should jump past the navbar to the hero sectionEnter— menu opens; pressEscape— menu closes and focus returns to the buttonEnter— chip is addedSpaceorEnter— skill is added<select>dropdowns — each shows an indigo focus ringEnter— form submits; if fields are empty, error messages are announced by screen readers/project/1), Tab to "View Code" and pressEnter— panel opens; Tab key must stay inside the panel (focus trap active)Escape— panel closes and focus returns to the "View Code" button that opened itpython tests/test_basic.pyExpected test output:
27 passed, 0 failed out of 27 tests
Test Results
paste output here
Screenshots (if UI change)
Self-Review Checklist [required]
feat/,fix/,docs/,data/,style/,test/python tests/test_basic.pyand all 27 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
*:focus { outline: none }reset is intentional — it suppresses the default browserring for mouse users only. The
:focus-visiblerules below it restore a polished customring for keyboard users, which is the recommended modern pattern (used by GitHub, Stripe, etc.).
Escapealways exits the trap and returns focus correctly.
flake8is unaffected by this PR.