Skip to content

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

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

Merged
merged 4 commits into from
Jul 2, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 1, 2025

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.

Copy link
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 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
@Copilot Copilot AI requested a review from JudahGabriel July 1, 2025 22:23
Copilot finished work on behalf of JudahGabriel July 1, 2025 22:23
@JudahGabriel JudahGabriel marked this pull request as ready for review July 2, 2025 22:54
@JudahGabriel JudahGabriel merged commit b60266a into main Jul 2, 2025
4 checks passed
@JudahGabriel 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