Skip to content

Fix keyboard focus indicator for "View Details" button in Report Card manifest section - #5000

Merged
Judah Gabriel Himango (JudahGabriel) merged 4 commits into
mainfrom
copilot/fix-4976
Jul 2, 2025
Merged

Fix keyboard focus indicator for "View Details" button in Report Card manifest section#5000
Judah Gabriel Himango (JudahGabriel) merged 4 commits into
mainfrom
copilot/fix-4976

Conversation

Copilot AI commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds visible focus indicators to the "View Details" button in the Report Card's Manifest region to improve keyboard accessibility for users navigating with keyboard-only input.

Problem

The "View Details" button (implemented as a Shoelace sl-details component) in the Report Card's Manifest section did not display a visible focus indicator when navigated to using keyboard navigation. This creates an accessibility barrier for keyboard-only users and users with low vision who cannot determine which element currently has focus.

Solution

Added CSS focus styles using the :focus-visible pseudo-class to ensure the button shows a clear visual indicator when focused via keyboard navigation:

sl-details:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

sl-details::part(header):focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

Changes Made

  • Added focus styles in apps/pwabuilder/src/script/pages/app-report.ts (8 lines of CSS)
  • Added test case in apps/pwabuilder/tests/report-card.spec.ts to verify focus indicator visibility
  • Updated .gitignore to exclude test artifacts

Testing

  • ✅ Build passes with TypeScript compilation
  • ✅ Focus indicator displays as a visible purple outline when navigating with keyboard
  • ✅ Test case verifies focus behavior programmatically
  • ✅ Follows existing code patterns and WCAG 2.2 Focus Visible guidelines

Screenshot

Focus indicator demonstration

The screenshot shows the "View Details" button with a visible purple focus outline when navigated to using keyboard navigation.

Accessibility Impact

This change ensures compliance with WCAG 2.2 Success Criterion 2.4.7 (Focus Visible) by providing a clear visual indication of which interactive element has keyboard focus, enabling keyboard-only users to successfully navigate the Report Card interface.

Fixes #4976.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.88/linux64/chrome-headless-shell-linux64.zip
    • Triggering command: node install.mjs (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thanks @Copilot for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

Copilot AI and others added 3 commits July 1, 2025 22:10
Co-authored-by: JudahGabriel <312936+JudahGabriel@users.noreply.github.com>
Co-authored-by: JudahGabriel <312936+JudahGabriel@users.noreply.github.com>
Co-authored-by: JudahGabriel <312936+JudahGabriel@users.noreply.github.com>
Copilot AI changed the title [WIP] [PWA Builder - Report Card]: Keyboard Focus Indicator Not Visible on ‘View Details’ Button under Manifest Region Fix keyboard focus indicator for "View Details" button in Report Card manifest section Jul 1, 2025
@JudahGabriel
Judah Gabriel Himango (JudahGabriel) marked this pull request as ready for review July 2, 2025 22:54
@JudahGabriel
Judah Gabriel Himango (JudahGabriel) merged commit b60266a into main Jul 2, 2025
4 checks passed
@JudahGabriel
Judah Gabriel Himango (JudahGabriel) deleted the copilot/fix-4976 branch July 2, 2025 23:19
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.

[PWA Builder - Report Card]: Keyboard Focus Indicator Not Visible on ‘View Details’ Button under Manifest Region

2 participants