Skip to content

Conversation

@iMattPro
Copy link
Contributor

@iMattPro iMattPro commented Dec 23, 2025

Improvements made in this PR:

  1. Use escape key to close/dismiss/deny the prompt.
  2. Add aria attributes for accessibility.
  3. Add UCP preference in notifications so users can disable the prompt permanently on all their devices, to better comply with GDPR.
Screenshot 2025-12-30 at 8 24 03 AM

@iMattPro iMattPro requested a review from rxu December 26, 2025 17:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the web push notification popup prompt with improved accessibility, user experience, and GDPR compliance features. The main additions include keyboard navigation (Escape key support), comprehensive ARIA attributes for screen readers, and a persistent user preference to disable the popup prompt across all devices.

Key changes include:

  • Escape key functionality to dismiss the popup prompt
  • ARIA attributes (role, aria-modal, aria-labelledby, aria-describedby) for better screen reader support
  • New database column and UCP toggle control for users to permanently disable popup prompts

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
ucp/controller/webpush.php Adds toggle_popup() controller method to handle user preference changes for disabling popup prompts
notification/method/webpush.php Updates template data to include toggle URL and checks user preference when determining whether to show popup
migrations/add_user_popup_preference.php Creates database migration to add user_wpn_popup_disabled column to users table
config/wpn_ucp.yml Registers new route for the toggle popup controller endpoint
styles/all/template/webpush.js Implements escape key handler, hidePopup() helper function, and togglePopupHandler() for preference updates
styles/all/template/webpush_popup.html Adds ARIA attributes for accessibility (role, aria-modal, aria-labelledby, aria-describedby, aria-hidden)
styles/prosilver/template/event/ucp_notifications_content_before.html Adds toggle button UI in UCP notifications settings with icon-based state indicator
styles/all/template/ucp_notifications_webpush.html Passes toggle popup URL to JavaScript initialization
styles/all/theme/phpbb_wpn.css Adds grid-based layout for notification settings with responsive breakpoints and toggle icon styling
tests/functional/functional_test.php Adds functional test covering toggle button presence and state changes
tests/controller/controller_webpush_test.php Adds unit tests for toggle functionality including edge cases (invalid tokens, non-AJAX, anonymous users)
language/en/webpushnotifications_module_ucp.php Adds English translations for toggle feature and updates popup title text
language/ru/webpushnotifications_module_ucp.php Adds Russian translations for toggle feature and updates popup title text
controller/manifest.php Fixes parse_url() usage to specify PHP_URL_PATH parameter explicitly for better code clarity

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +48 to +54
.wpn-fieldset .fa-toggle-on {
color: #105289;
}

.wpn-fieldset .fa-toggle-off {
color: #5d5d5d;
}
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Missing focus styles for the toggle button. The .wpn-toggle-button class is used in the template but has no CSS styling defined, including focus indicators. Keyboard users need visible focus indicators to navigate the interface. Add focus styles for this button to ensure accessibility compliance.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

@iMattPro iMattPro merged commit e9af8d0 into phpbb-extensions:main Jan 5, 2026
33 checks passed
@iMattPro iMattPro deleted the fixes branch January 5, 2026 23:20
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.

2 participants