-
Notifications
You must be signed in to change notification settings - Fork 12
refactor: welcome screen #965
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
Conversation
There was a problem hiding this 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.
onKeyPress={ ( e ) => { | ||
if ( 'Enter' === e.key || ' ' === e.key ) { | ||
setShowBenefits( ! showBenefits ); | ||
} | ||
}} |
There was a problem hiding this comment.
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 ) { |
There was a problem hiding this comment.
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.
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.
![]() @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. |
acc5d75
to
1ad40a7
Compare
All Submissions:
Changes proposed in this Pull Request:
Improve welcome screen UX with toggle-able benefits display.


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