-
Notifications
You must be signed in to change notification settings - Fork 93
enhance: duplicate menu item preview #254
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
enhance: duplicate menu item preview #254
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughReplaces the single UpgradePopup for articles with two distinct UpgradePopup entries ("Duplicate" and "Restrict editing for admin only") and applies minor formatting/whitespace adjustments around isProLoaded checks and several hooks; no exported API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/components/ProPreviews/index.js (2)
204-205: Consider adding descriptive tooltip content to Badge components.The Badge components are used without
headinganddescriptionprops. Based on the Badge implementation, this means users hovering over the badge won't see informative tooltips explaining why these are pro features or what benefits they provide.Consider adding descriptive props:
- <Badge classes="opacity-0 group-hover:opacity-100 transition-opacity"/> + <Badge + classes="opacity-0 group-hover:opacity-100 transition-opacity" + heading={__('Pro Feature', 'wedocs')} + description={__('Duplicate articles with one click', 'wedocs')} + />- <Badge classes="opacity-0 group-hover:opacity-100 transition-opacity"/> + <Badge + classes="opacity-0 group-hover:opacity-100 transition-opacity" + heading={__('Pro Feature', 'wedocs')} + description={__('Restrict editing access to administrators only', 'wedocs')} + />Also applies to: 211-212
199-215: Minor cleanup: Remove empty line and consider reducing duplication.
- Line 199 contains an unnecessary empty line
- The two UpgradePopup blocks share identical structure with only text differences
You could extract the common structure into a reusable helper or keep as-is if clarity is preferred:
{ type === 'article' && ( - <> + <>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/ProPreviews/index.js(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/ProPreviews/index.js (4)
src/components/ProPreviews/common/UpgradePopup.js (1)
UpgradePopup(13-256)src/components/ProPreviews/common/Badge.js (1)
Badge(5-22)src/components/ProPreviews/common/Contributors.js (1)
Contributors(7-52)src/components/App.js (1)
routes(17-24)
🔇 Additional comments (3)
src/components/ProPreviews/index.js (3)
192-196: LGTM!The reformatting maintains functional equivalence while improving code readability.
247-255: LGTM!The reformatting maintains functional equivalence while improving code readability.
198-215: Note: Some PR objectives may require additional changes.The PR objectives mention:
- ✓ Duplicate menu item preview - implemented
- Change action menu to open/close on click instead of hover - not addressed in this file
- Ensure upgrade popup appears above other elements (z-index fix) - not addressed in this file
- Increase spacing between admin restriction icons - partially addressed via
space-x-2.5If objectives 2-3 are addressed in other files (CSS, UpgradePopup component), please disregard. Otherwise, you may need additional changes.
fixes #220
Added a Duplicate menu item preview

Summary by CodeRabbit
New Features
Style
Refactor