Skip to content

Conversation

@sapayth
Copy link
Member

@sapayth sapayth commented Oct 15, 2025

fixes #220

Added a Duplicate menu item preview
CleanShot 2025-10-15 at 15 02 59

Summary by CodeRabbit

  • New Features

    • Added a “Duplicate” option to article actions with an upgrade prompt and badge.
    • Added a “Restrict editing for admin only” option to article actions with an upgrade prompt and badge.
  • Style

    • Minor UI consistency tweaks in permission and article menus; no behavioral changes.
  • Refactor

    • Structural and indentation cleanups around menu routing and feature indicators with no user-visible impact.

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Replaces 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

Cohort / File(s) Summary of changes
Article UpgradePopup split
src/components/ProPreviews/index.js
Replaces one UpgradePopup under type article with two separate UpgradePopup blocks: one for "Duplicate" and one for "Restrict editing for admin only", each including a Badge.
Formatting & early-return consistency
src/components/ProPreviews/index.js
Minor whitespace/indentation and blank-line adjustments around isProLoaded checks and various hook/route/menu blocks; no behavioral changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

Needs Review

Suggested reviewers

  • iftakharul-islam

Poem

A hop, two popups now side by side,
Badges gleam where actions hide.
Lines align with a tidy cheer,
Duplicate and Restrict appear.
— from a rabbit, bouncing near 🐰✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The pull request does not implement the objectives from issue #220 because there are no changes enabling click-to-open behavior for the action menu, no adjustments to the popup’s z-index for visibility, and no increased spacing between admin restriction icons described in the linked issue. Please extend the implementation to include click-to-open functionality for the action menu, update the upgrade popup’s z-index to ensure it appears above other elements, and increase spacing between admin restriction icons as specified in issue #220.
Out of Scope Changes Check ⚠️ Warning The addition of a “Duplicate” menu item preview is unrelated to the requirements of issue #220, which focused on toggle behavior, popup z-index, and icon spacing, so this feature falls outside the linked objectives. Consider splitting the duplicate menu item preview into a separate pull request or aligning it with additional documented objectives to keep this change focused on the linked issue’s scope.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely describes the primary enhancement of adding a duplicate menu item preview, reflecting the main functional change made in the pull request and avoiding unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 738f27d and 68721db.

📒 Files selected for processing (1)
  • src/components/ProPreviews/index.js (4 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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 heading and description props. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8231304 and 738f27d.

📒 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:

  1. ✓ Duplicate menu item preview - implemented
  2. Change action menu to open/close on click instead of hover - not addressed in this file
  3. Ensure upgrade popup appears above other elements (z-index fix) - not addressed in this file
  4. Increase spacing between admin restriction icons - partially addressed via space-x-2.5

If objectives 2-3 are addressed in other files (CSS, UpgradePopup component), please disregard. Otherwise, you may need additional changes.

@iftakharul-islam iftakharul-islam merged commit 68721db into weDevsOfficial:develop Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants