Skip to content

Conversation

RaduCristianPopescu
Copy link

@RaduCristianPopescu RaduCristianPopescu commented Sep 19, 2025

All Submissions:

Changes proposed in this Pull Request:

Improve welcome screen UX with toggle-able benefits display.
CleanShot 2025-09-24 at 10 38 22@2x
CleanShot 2025-09-24 at 10 38 11@2x

Closes https://github.com/Codeinwp/optimole-service/issues/1528#event-19753237307

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link
Contributor

@Copilot 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 refactors the welcome screen to improve UX by making the benefits section collapsible. It adds a toggle button that allows users to show/hide the benefits list, creating a cleaner initial view while still providing access to detailed information.

Key Changes:

  • Adds a new translatable string for the benefits toggle button
  • Implements a collapsible benefits section with toggle functionality
  • Includes keyboard accessibility support for the toggle interaction

Reviewed Changes

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

File Description
inc/admin.php Adds new translatable string for the benefits toggle button
assets/src/dashboard/parts/connect/index.js Implements the collapsible benefits UI with toggle functionality and keyboard support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 193 to 197
onKeyPress={ ( e ) => {
if ( 'Enter' === e.key || ' ' === e.key ) {
setShowBenefits( ! showBenefits );
}
}}
Copy link
Preview

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

The onKeyPress event is deprecated and doesn't handle all keyboard interactions properly. Use onKeyDown instead for better accessibility support, as it captures key presses more reliably across different browsers and assistive technologies.

Copilot uses AI. Check for mistakes.

role="button"
tabIndex="0"
onKeyPress={ ( e ) => {
if ( 'Enter' === e.key || ' ' === e.key ) {
Copy link
Preview

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing e.preventDefault() and e.stopPropagation() calls when handling the Space key. This can cause the page to scroll when users press Space to activate the toggle button.

Suggested change
if ( 'Enter' === e.key || ' ' === e.key ) {
if ( 'Enter' === e.key || ' ' === e.key ) {
if (e.key === ' ') {
e.preventDefault();
e.stopPropagation();
}

Copilot uses AI. Check for mistakes.

@pirate-bot
Copy link
Collaborator

pirate-bot commented Sep 19, 2025

Plugin build for 1ad40a7 is ready 🛎️!

@ineagu
Copy link
Contributor

ineagu commented Sep 23, 2025

Screenshot 2025-09-23 at 16 57 20

@RaduCristianPopescu can we make a small ui adjustment on the existing user button, also make the background for the login box lighter as in the image.

@selul selul merged commit be4b22f into development Sep 30, 2025
11 checks passed
@selul selul deleted the refactor/welcome-screen branch September 30, 2025 13:56
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.

5 participants