-
Notifications
You must be signed in to change notification settings - Fork 233
ENHANCE #7925: Add tooltip for disabled 'Test the page' button on draft posts #7959
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
base: develop
Are you sure you want to change the base?
Conversation
- Wrap disabled button with tooltip when post is a draft - Display message: 'This page is a draft and cannot be tested.' - Use existing .wpr-btn-with-tool-tip pattern - Avoid if-else by conditionally wrapping button Fixes #7925
- Add assertions for tooltip markup and message - Verify wpr-btn-with-tool-tip and wpr-tooltip classes - Check for draft tooltip message in output Related to #7925
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 enhances the user experience for the Rocket Insights feature by providing clearer feedback when users attempt to test draft pages. When a page has draft status, the "Test the page" button is now disabled and displays a tooltip explaining why testing is unavailable.
Key Changes:
- Added tooltip wrapper and message for disabled "Test the page" button on draft posts
- Refactored conditional logic for button classes and disabled attribute to be more readable
- Updated test fixtures to verify new tooltip elements are rendered
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| views/settings/partials/rocket-insights/rocket-insights-column.php | Added tooltip container wrapping disabled button for draft pages with explanatory message; simplified conditional logic for button state |
| tests/Fixtures/inc/Engine/Admin/RocketInsights/Render/GetRocketInsightsColumn.php | Added test assertions for new tooltip CSS classes and message text |
tests/Fixtures/inc/Engine/Admin/RocketInsights/Render/GetRocketInsightsColumn.php
Show resolved
Hide resolved
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
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.
LGTM from code perspective.
@piotrbak will need to assert that the text and tooltip placement is correct.
|
@jeawhanlee The placement is correct. I'll ask @valentinaor for confirmation about the wording, as it looks good from my side. @valentinaor what do you think? |
|
@piotrbak The copy looks good to me too |
Description
Fixes #7925
This pull request improves the user interface for the Rocket Insights feature by providing clearer feedback when a user tries to test a page that is still in draft status. Now, when a page is a draft, the "Test the page" button is disabled and accompanied by a tooltip explaining why the action is unavailable.
Type of change
Detailed scenario
What was tested
How to test
Just load the page list with draft pages, put your mouse on the
Test the pagetext, tooltip should appear.Affected Features & Quality Assurance Scope
Page/post list with RI column.
Technical description
Documentation
Enhancements to draft page handling:
views/settings/partials/rocket-insights/rocket-insights-column.php)views/settings/partials/rocket-insights/rocket-insights-column.php)Mandatory Checklist
Code validation
Code style