-
Notifications
You must be signed in to change notification settings - Fork 32
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
PCH Related Posts: Add advanced search #3117
Conversation
📝 WalkthroughWalkthroughThis pull request introduces significant changes to the Related Posts functionality across multiple files. The primary modifications involve removing Changes
Sequence DiagramsequenceDiagram
participant User
participant EditorSidebar
participant RelatedPostsProvider
participant ContentAPI
User->>EditorSidebar: Open sidebar
EditorSidebar->>RelatedPostsProvider: Request related posts
RelatedPostsProvider->>ContentAPI: Fetch posts with new filters
ContentAPI-->>RelatedPostsProvider: Return filtered posts
RelatedPostsProvider-->>EditorSidebar: Display related posts
Possibly related PRs
Suggested Reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
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: 1
🧹 Nitpick comments (9)
src/content-helper/editor-sidebar/related-posts/provider.ts (3)
44-50
: Add a @SInCE tag in the method’s JSDoc.
WordPress coding standards require a@since
annotation for newly introduced methods.
53-65
: End parameter descriptions with a period.
WordPress coding guidelines recommend ending each JSDoc parameter line with a period.
71-90
: Sanitize filter input before API requests.
Ensure thatauthor
,section
, andtags
values are safely handled to prevent potential injection.src/content-helper/editor-sidebar/related-posts/component.tsx (3)
126-130
: Externalize default filter values.
Consider moving them to a constants file to simplify updates and maintenance.
Line range hint
185-209
: Consider a fully async/await approach.
Refactor the promise chain for clearer readability and error handling.
212-217
: Complete JSDoc with @SInCE and punctuation.
Add a@since
annotation if newly introduced, and end each parameter line with a period.src/content-helper/common/utils/api.ts (1)
15-15
: Update JSDoc for the tag property to document the array support.The change from string to string[] is correct and aligns with the multi-tag filtering requirement. Consider adding JSDoc to document this capability.
export interface AnalyticsApiOptionalQueryParams extends ApiPeriodRange { + /** Array of tags to filter by. Supports up to 5 tags. @since 3.14.0 */ tag?: string[];
src/content-helper/editor-sidebar/related-posts/component-filter-settings.tsx (2)
22-24
: Add JSDoc for FilterControlsProps properties.The type definition needs documentation for its properties.
type FilterControlsProps = { + /** Post filters containing author, section, and tags. @since 3.14.0 */ filters: PostFilters; + /** Optional label for the filter controls. @since 3.14.0 */ label?: string; + /** Callback function when filters change. @since 3.14.0 */ onFiltersChange: ( selection: string | null | undefined, type:PostFilterType ) => void;
40-43
: Consider extracting the condition to a descriptive variable.The condition checking for empty data could be more readable.
- if ( 0 === postData.authors.length && - 0 === postData.categories.length && - 0 === postData.tags.length - ) { + const hasNoFilterableData = 0 === postData.authors.length && + 0 === postData.categories.length && + 0 === postData.tags.length; + + if (hasNoFilterableData) {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (8)
build/content-helper/dashboard-widget.asset.php
is excluded by!build/**
build/content-helper/dashboard-widget.js
is excluded by!build/**
build/content-helper/editor-sidebar-rtl.css
is excluded by!build/**
build/content-helper/editor-sidebar.asset.php
is excluded by!build/**
build/content-helper/editor-sidebar.css
is excluded by!build/**
build/content-helper/editor-sidebar.js
is excluded by!build/**
build/loader.asset.php
is excluded by!build/**
build/loader.js
is excluded by!build/**
📒 Files selected for processing (17)
src/content-helper/common/settings/types/sidebar-settings.d.ts
(0 hunks)src/content-helper/common/utils/api.ts
(1 hunks)src/content-helper/common/utils/constants.ts
(1 hunks)src/content-helper/editor-sidebar/editor-sidebar.tsx
(1 hunks)src/content-helper/editor-sidebar/related-posts/component-filter-settings.tsx
(2 hunks)src/content-helper/editor-sidebar/related-posts/component.tsx
(8 hunks)src/content-helper/editor-sidebar/related-posts/provider.ts
(2 hunks)src/content-helper/editor-sidebar/related-posts/related-posts.scss
(0 hunks)src/rest-api/settings/class-endpoint-editor-sidebar-settings.php
(1 hunks)src/services/content-api/endpoints/class-endpoint-analytics-posts.php
(2 hunks)tests/Integration/RestAPI/Settings/EndpointEditorSidebarSettingsTest.php
(1 hunks)tests/Integration/Services/ContentAPI/Endpoints/EndpointAnalyticsPostsTest.php
(2 hunks)tests/e2e/specs/content-helper/errors.spec.ts
(2 hunks)tests/e2e/specs/content-helper/related-posts-panel-filters.spec.ts
(1 hunks)tests/e2e/specs/content-helper/top-bar-icon.spec.ts
(1 hunks)tests/e2e/utils.ts
(1 hunks)tests/js/content-helper/structure.test.tsx
(7 hunks)
💤 Files with no reviewable changes (2)
- src/content-helper/common/settings/types/sidebar-settings.d.ts
- src/content-helper/editor-sidebar/related-posts/related-posts.scss
🧰 Additional context used
📓 Path-based instructions (15)
tests/e2e/specs/content-helper/related-posts-panel-filters.spec.ts (1)
Pattern **/*.{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/common/utils/api.ts (1)
Pattern **/*.{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/rest-api/settings/class-endpoint-editor-sidebar-settings.php (1)
Pattern **/*.{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."
tests/Integration/RestAPI/Settings/EndpointEditorSidebarSettingsTest.php (1)
Pattern **/*.{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."
tests/e2e/utils.ts (1)
Pattern **/*.{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."
tests/e2e/specs/content-helper/top-bar-icon.spec.ts (1)
Pattern **/*.{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."
tests/e2e/specs/content-helper/errors.spec.ts (1)
Pattern **/*.{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/services/content-api/endpoints/class-endpoint-analytics-posts.php (1)
Pattern **/*.{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."
tests/Integration/Services/ContentAPI/Endpoints/EndpointAnalyticsPostsTest.php (1)
Pattern **/*.{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/common/utils/constants.ts (1)
Pattern **/*.{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/editor-sidebar/related-posts/component-filter-settings.tsx (1)
Pattern **/*.{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/editor-sidebar/related-posts/provider.ts (1)
Pattern **/*.{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."
tests/js/content-helper/structure.test.tsx (1)
Pattern **/*.{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/editor-sidebar/related-posts/component.tsx (1)
Pattern **/*.{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/editor-sidebar/editor-sidebar.tsx (1)
Pattern **/*.{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."
🪛 Biome (1.9.4)
src/content-helper/editor-sidebar/related-posts/provider.ts
[error] 40-40: Using this in a static context can be confusing.
this refers to the class.
Unsafe fix: Use the class name instead.
(lint/complexity/noThisInStatic)
🔇 Additional comments (29)
src/services/content-api/endpoints/class-endpoint-analytics-posts.php (3)
121-123
: LGTM! Method name change improves clarity.The renamed method
append_same_key_params_to_url
better describes its purpose of appending multiple values with the same key.
157-170
: LGTM! Well-documented method with improved parameter names.The PHPDoc follows WordPress standards, and the parameter names are more descriptive and aligned with their purpose.
171-186
: LGTM! Robust implementation with proper validation.The implementation includes:
- Empty key and value validation
- Proper URL encoding for special characters
- Correct URL parameter appending logic
tests/Integration/Services/ContentAPI/Endpoints/EndpointAnalyticsPostsTest.php (3)
50-71
: LGTM! Well-structured test method with comprehensive documentation.The test method follows PHPUnit best practices with proper annotations and parameter documentation.
72-81
: LGTM! Test implementation follows best practices.The test properly uses reflection to access the protected method and performs exact string comparison for validation.
83-158
: LGTM! Comprehensive data provider with excellent test coverage.The data provider includes well-organized test cases covering:
- Basic URL parameter handling
- Complex scenarios with existing parameters
- Special character handling
- Edge cases with empty values
src/content-helper/editor-sidebar/related-posts/provider.ts (1)
10-14
: No concerns about the new imports.
They adhere to standard WordPress and TypeScript usage with no functional or security concerns.src/content-helper/editor-sidebar/related-posts/component.tsx (5)
Line range hint
11-24
: Imports and enumerations are consistent.
Usage of WordPress imports and enumerations appears fine and secure.
219-236
: Validate or sanitize filter input.
Ensure that user-provided data is not used in a way that could introduce XSS or other vulnerabilities.
259-259
: Localized string usage is correct.
Good job using the__()
function for translations.
295-296
: Filter component integration looks good.
Props usage is consistent with the newPostFilters
interface.
314-314
: Clear no-results message.
Provides a user-friendly fallback in case no posts are returned.tests/e2e/specs/content-helper/related-posts-panel-filters.spec.ts (1)
46-47
: Test coverage is appropriate.
Verifying for “Loading…” ensures the fetch request initiates successfully.src/content-helper/editor-sidebar/related-posts/component-filter-settings.tsx (1)
82-92
: LGTM! Well-implemented tag filtering.The FormTokenField implementation correctly:
- Limits tags to 5 using maxLength
- Hides unnecessary help text
- Uses placeholder text
- Provides tag suggestions
tests/e2e/specs/content-helper/errors.spec.ts (1)
86-87
: LGTM! Tests updated to match new UI text.The test changes correctly reflect the updated UI message and selector.
src/rest-api/settings/class-endpoint-editor-sidebar-settings.php (1)
84-91
: LGTM! Clean removal of deprecated filter settings.The RelatedPosts configuration has been correctly simplified while maintaining essential settings.
tests/e2e/utils.ts (2)
44-45
: LGTM! Function signature simplified to match new advanced search approach.The removal of
category
,tag
, andfilterType
parameters aligns with the PR's objective of supporting composite searches. The simplified signature improves maintainability.Also applies to: 50-51
57-60
: LGTM! Clear and focused implementation.The code is well-commented and performs the necessary steps in a straightforward manner.
src/content-helper/common/utils/constants.ts (2)
Line range hint
32-38
: LGTM! Filter types aligned with advanced search feature.The
PostFilterType
enum now precisely reflects the available filter types for the advanced search feature.
50-55
: LGTM! Well-designed interface for advanced search.The
PostFilters
interface effectively supports:
- AND search queries with author and section
- Multiple tag selection through the tags array
tests/e2e/specs/content-helper/top-bar-icon.spec.ts (1)
78-79
: LGTM! Tests updated to match new UI.The selector and expected message have been appropriately updated to reflect the new advanced search interface.
src/content-helper/editor-sidebar/editor-sidebar.tsx (2)
14-14
: LGTM! Import reorganized for better code organization.The
PluginSidebar
import is now properly sourced from type definitions.
Line range hint
71-77
: LGTM! Settings structure simplified.The removal of
FilterBy
andFilterValue
fromRelatedPosts
settings aligns with the new advanced search implementation, reducing complexity while maintaining type safety.tests/js/content-helper/structure.test.tsx (5)
21-21
: LGTM: Import statement aligns with type changes.The addition of the PostData type import is consistent with the refactoring of related posts handling.
128-128
: LGTM: Mock function signature simplified.The function now directly returns PostData[], which aligns with the simplified related posts API interactions.
183-185
: LGTM: Mock data structure simplified.The mock data is now directly returned without wrapping it in a GetRelatedPostsResult object, consistent with the new API structure.
290-292
: LGTM: Function signature updated correctly.The type annotation change to PostData[] maintains consistency with the simplified data structure.
308-310
: LGTM: Function signature updated correctly.The type annotation change to PostData[] maintains consistency with the simplified data structure.
tests/Integration/RestAPI/Settings/EndpointEditorSidebarSettingsTest.php (1)
77-79
: LGTM: RelatedPosts array simplified and properly ordered.The removal of FilterBy and FilterValue keys aligns with the broader restructuring, and the remaining keys are correctly sorted alphabetically as per the comment guidelines.
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.
Thank you for working on this! I really like that you added more functionality and were able to make the codebase more simple to understand. 🙂
I added a nitpick comment, however approving the PR as otherwise looks great!
Co-authored-by: Henrique Mouta <[email protected]>
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 (1)
src/content-helper/editor-sidebar/related-posts/component.tsx (1)
211-218
: Update JSDoc to match WordPress standards.The JSDoc comment needs improvement to match WordPress coding standards.
Add a description and update the @SInCE tag:
/** - * Updates the filters value. + * Updates the filter values for author, section, or tags. * - * @since 3.11.0 + * @since 3.15.0 Updated to handle multiple filter types. * * @param {PostFilters} newValue The new filters value. * @param {PostFilterType} filterType The type of filter being changed. */
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content-helper/editor-sidebar/related-posts/component.tsx
(8 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{js,ts,tsx,jsx}`: "Perform a detailed review of the pr...
**/*.{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/editor-sidebar/related-posts/component.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build
- GitHub Check: E2E against WordPress latest
- GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
src/content-helper/editor-sidebar/related-posts/component.tsx (4)
11-11
: LGTM! Import changes are well-structured.The imports are correctly organized, with WordPress dependencies separated from internal dependencies.
Also applies to: 24-24
126-130
: LGTM! State management is well-structured.The new filters state properly implements the advanced search requirements with separate properties for author, section, and tags.
183-209
: LGTM! Effect hook is properly implemented.The useEffect hook correctly handles the new filters state and includes all necessary dependencies.
259-259
: LGTM! UI messages are clear and properly internationalized.The messages have been simplified as per PR objectives while maintaining proper i18n support.
Also applies to: 314-316
…ch-related-posts" (9b1f597)
Description
With this PR, we're adding advanced search to PCH Related Posts.
To keep the fetching operation to a single API call, only
AND
search queries are supported. The search can query for author, section, and up to 5 tags simultaneously.Additional changes:
Top related posts in the x section in the last x days
was removed, as it would become quite large and unwieldy for composite searches.Motivation and context
Offer a way to get more specific results.
How has this been tested?
Some tests were added, others adjusted and a couple of them removed.
Screenshots
Summary by CodeRabbit
Release Notes
New Features
Changes
Improvements
Refactoring
This release focuses on improving the flexibility and usability of related posts filtering while removing legacy code and simplifying the overall implementation.