Skip to content

Conversation

@alecgeatches
Copy link
Contributor

@alecgeatches alecgeatches commented May 15, 2025

Description

The traffic boost footer bar was updated with these changes:

  • The regenerate action and icon has been moved from the toolbar into the footer, by the accept/reject buttons:
    image

  • Icons were added to the "Accept", "Reject", "Regenerate", "Remove Link", "Update Link", and "Clear Changes" buttons.

  • The "Remove Link" button has a busy background while processing:

    remove-link-background

  • A handful of snackbar notices were changed in this commit to be less wordy, with one example in the GIF above.

  • The preview footer toolbar resizes responsively:

    responsive-toolbar

  • Other minor icon changes.

How has this been tested?

I've tested locally, see screenshots above.

Summary by CodeRabbit

  • New Features

    • Added a "Regenerate" button to the footer, allowing users to trigger link regeneration directly from the footer area.
  • Improvements

    • Updated button icons and labels for better visual consistency (e.g., "Discard" renamed to "Reject", "Remove" renamed to "Remove Link").
    • Footer action buttons now wrap and center for improved layout on smaller screens.
    • Success messages for link actions are now shorter and no longer include the post title.
    • Updated icons for suggestion generation actions to enhance clarity.
  • Bug Fixes

    • Prevented potential issues with constant redefinition in the preview script.

@alecgeatches alecgeatches self-assigned this May 15, 2025
@alecgeatches alecgeatches requested a review from a team as a code owner May 15, 2025 16:09
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 15, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • build/content-helper/dashboard-page.asset.php is excluded by !build/**
  • build/content-helper/dashboard-page.js is excluded by !build/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

The updates introduce a "Regenerate" button with a new icon to the PreviewFooter, adjust button icons and labels for consistency, and move the regenerate action handler from the header to the footer. CSS changes enable footer action buttons to wrap and center. Notification messages and icons are simplified and standardized.

Changes

File(s) Change Summary
src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-footer.tsx Added onRegeneratePressed prop and "Regenerate" button with icon; updated button icons and labels for consistency; renamed some buttons.
src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-header.tsx Removed onRegeneratePressed prop, related icon import, and regenerate button from header.
src/content-helper/dashboard-page/pages/traffic-boost/preview/preview.tsx Moved regenerate handler from header to footer; simplified success notification messages by removing post titles.
src/content-helper/dashboard-page/pages/traffic-boost/preview/preview.scss Updated footer actions layout to wrap and center buttons; removed button padding.
src/content-helper/dashboard-page/pages/traffic-boost/sidebar/components/tabs/suggestions-tab.tsx Swapped update icon for reusableBlock in generate button and notification.
src/content-helper/dashboard-page/pages/traffic-boost/preview/preview-post.php Changed constant definitions to only define if not already set.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PreviewFooter
    participant AppLogic

    User->>PreviewFooter: Click "Regenerate" button
    PreviewFooter->>AppLogic: onRegeneratePressed()
    AppLogic-->>PreviewFooter: (Triggers regeneration logic)
Loading
sequenceDiagram
    participant User
    participant PreviewFooter
    participant NotificationSystem

    User->>PreviewFooter: Perform link action (plant, remove, update)
    PreviewFooter->>NotificationSystem: Show success message ("Link planted", "Link removed", "Link updated")
Loading

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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 (1)
src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-footer.tsx (1)

77-84: Well-implemented regenerate button component.

Created a reusable button component for the regenerate functionality that can be inserted in multiple locations. The button includes appropriate labeling, icon, and variant styling.

However, consider adding a JSDoc comment for this variable to improve code documentation.

+/**
+ * Reusable regenerate button component.
+ *
+ * @since 3.19.0
+ */
 const regenerateButton = <Button
 	variant="tertiary"
 	icon={ reusableBlock }
 	iconSize={ 24 }
 	onClick={ onRegeneratePressed }
 	label={ __( 'Regenerate Suggested Link', 'wp-parsely' ) }
 >{ __( 'Regenerate', 'wp-parsely' ) }</Button>;
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 61d9f22 and 29c83e0.

⛔ Files ignored due to path filters (4)
  • build/content-helper/dashboard-page-rtl.css is excluded by !build/**
  • build/content-helper/dashboard-page.asset.php is excluded by !build/**
  • build/content-helper/dashboard-page.css is excluded by !build/**
  • build/content-helper/dashboard-page.js is excluded by !build/**
📒 Files selected for processing (6)
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-footer.tsx (7 hunks)
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-header.tsx (1 hunks)
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/preview-post.php (1 hunks)
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/preview.scss (1 hunks)
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/preview.tsx (4 hunks)
  • src/content-helper/dashboard-page/pages/traffic-boost/sidebar/components/tabs/suggestions-tab.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.{html,php}`: "Perform a detailed review of the provided code with following key aspects in mind: - Review the HTML and PHP code to ensure it is well-structured and adheres ...

**/*.{html,php}: "Perform a detailed review of the provided code with following key aspects in mind:

  • Review the HTML and PHP code to ensure it is well-structured and adheres to best practices.
  • Ensure the code follows WordPress coding standards and is well-documented.
  • Confirm the code is secure and free from vulnerabilities.
  • Optimize the code for performance, removing any unnecessary elements.
  • Validate comments for accuracy, currency, and adherence to WordPress coding standards.
  • Ensure each line comment concludes with a period.
  • Verify code compatibility with the latest version of WordPress, avoiding deprecated functions or features."
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/preview-post.php
`**/*.{js,ts,tsx,jsx}`: "Perform a detailed review of the provided code with following key aspects in mind: - Review the code to ensure it is well-structured and adheres to best ...

**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:

  • Review the code to ensure it is well-structured and adheres to best practices.
  • Verify compliance with WordPress coding standards.
  • Ensure the code is well-documented.
  • Check for security vulnerabilities and confirm the code is secure.
  • Optimize the code for performance, removing any unnecessary elements.
  • Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
  • Ensure each line comment concludes with a period.
  • Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
  • Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
  • src/content-helper/dashboard-page/pages/traffic-boost/sidebar/components/tabs/suggestions-tab.tsx
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-header.tsx
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/preview.tsx
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-footer.tsx
`**/*.{css,scss}`: "Perform a detailed review of the provided code with following key aspects in mind: - Review the SCSS code to ensure it is well-structured and adheres to best ...

**/*.{css,scss}: "Perform a detailed review of the provided code with following key aspects in mind:

  • Review the SCSS code to ensure it is well-structured and adheres to best practices.
  • Convert dimensions greater than or equal to 3px to rem units using the to_rem function.
  • Utilize variables for sizes and colors defined in src/content-helper/common/css/variables.scss instead of hardcoding values."
  • src/content-helper/dashboard-page/pages/traffic-boost/preview/preview.scss
🧬 Code Graph Analysis (1)
src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-footer.tsx (2)
src/content-helper/dashboard-page/pages/traffic-boost/store.ts (2)
  • isAccepting (809-811)
  • isRemoving (812-814)
src/content-helper/common/components/vertical-divider/component.tsx (1)
  • VerticalDivider (26-32)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: E2E against WordPress latest
🔇 Additional comments (21)
src/content-helper/dashboard-page/pages/traffic-boost/preview/preview.scss (1)

216-217: Good improvement to the footer layout's responsiveness!

Adding flex-wrap: wrap and justify-content: center improves the user experience by allowing buttons to flow to a new line when needed and remain visually balanced. This supports the relocated regenerate button and other action buttons, ensuring they display correctly on smaller screens.

src/content-helper/dashboard-page/pages/traffic-boost/preview/preview-post.php (1)

17-22: Good defensive coding practice!

Using conditional checks before defining the constants prevents potential PHP notices when these constants might already be defined elsewhere. The PHPCS ignore comments are correctly applied for the non-prefixed constants.

src/content-helper/dashboard-page/pages/traffic-boost/sidebar/components/tabs/suggestions-tab.tsx (3)

7-7: Icon import updated correctly.

The change from update to reusableBlock icon aligns with the UI consistency improvements in the PR.


83-83: Button icon updated for consistency.

The GenerateButton component now uses the reusableBlock icon, maintaining visual consistency with other regenerate buttons in the interface.


246-246: Success notification icon updated for consistency.

The success notification now displays the reusableBlock icon, which matches the icon used in the related action buttons throughout the UI.

src/content-helper/dashboard-page/pages/traffic-boost/preview/preview.tsx (4)

304-304: Simplified notification message.

Removing the post title from the success message makes the notification cleaner and less verbose, improving the user experience.


394-394: Simplified notification message.

Removing the post title from the link removal success message makes the notification cleaner and less verbose.


459-459: Simplified notification message.

Removing the post title from the link update success message makes the notification cleaner and less verbose.


627-627: Properly relocated regenerate functionality.

The regenerate action handler has been moved from the header to the footer, which aligns with the UI changes described in the PR objectives. This improves the location of related actions by grouping them together in the footer.

src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-header.tsx (1)

7-7: Icon import update looks good.

The removal of the update icon from imports aligns with relocating the regenerate action from the header to the footer component, as mentioned in the PR objectives.

src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-footer.tsx (11)

8-8: Properly updated icon imports.

Added the necessary icons for the updated UI components: check, close, reusableBlock, and undo. This follows WordPress coding standards by importing only the icons that are actually used in the component.


27-27: Interface prop addition is correct.

Added the onRegeneratePressed callback to the PreviewFooterProps interface, which is necessary for the relocated regenerate functionality.


56-56: Component prop destructuring updated correctly.

The onRegeneratePressed callback is properly destructured from the component props, matching the interface update.


110-111: Improved Accept button with icon.

Added the check icon to the Accept button when not in the busy state, which improves visual communication. The conditional icon display correctly handles the busy state.


115-117: Button improvements and Regenerate placement.

Renamed "Discard" to "Reject" which is more intuitive, added the close icon for clarity, and properly placed the regenerate button. This improves the UI by providing clearer action labeling and consistent iconography.


124-127: Enhanced Clear changes button with undo icon.

Added the undo icon to the Clear changes button, which visually communicates the purpose of the action. This is a good UI improvement that follows WordPress design patterns.


142-143: Improved Update Link button.

Added the check icon to the Update Link button when not in busy state, providing consistent visual feedback across action buttons. The conditional icon display correctly handles the busy state.


154-154: Proper placement of regenerate button for link update scenario.

Added the regenerate button in the appropriate location for the link update workflow. This provides a consistent user experience across different states of the component.


159-162: Enhanced Clear changes button with undo icon.

Added the undo icon to another instance of the Clear changes button, maintaining consistent UI patterns across the component.


167-173: Improved Remove Link button with dynamic styling.

Enhanced the Remove Link button with these improvements:

  1. Dynamic variant switching between primary (when busy) and tertiary (when idle)
  2. Conditional icon display that shows the close icon only when not busy
  3. Renamed from "Remove" to "Remove Link" for clarity

This implements the PR objective of showing a busy background animation while processing.


174-174: Proper placement of regenerate button for link removal scenario.

Added the regenerate button in the appropriate location for the link removal workflow, ensuring consistency across different states of the component.

@acicovic acicovic added this to the 3.19.0 milestone May 15, 2025
@acicovic acicovic added Maintenance & Fixes Ticket/PR related to codebase maintenance tasks Feature: Engagement Boost Ticket/PR related to Engagement Boost labels May 15, 2025
@alecgeatches alecgeatches merged commit 716413a into add/traffic-boost May 15, 2025
39 checks passed
@alecgeatches alecgeatches deleted the update/boost-link-action-ui branch May 15, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature: Engagement Boost Ticket/PR related to Engagement Boost Maintenance & Fixes Ticket/PR related to codebase maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants