-
Notifications
You must be signed in to change notification settings - Fork 82
Wrap blocked domains and keywords in collapsible details element #2591
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
Conversation
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 improves the user experience in the ActivityPub moderation settings by making blocked domains and keywords lists collapsible. Users can now see at a glance how many items are blocked without being overwhelmed by long lists, while still having easy access to the full list when needed.
Key Changes:
- Wrapped blocked domains and keywords tables in HTML
<details>elements with summary text showing the count - Added count display using WordPress i18n plural functions
- Kept add forms visible outside collapsible sections to maintain easy access
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| includes/wp-admin/class-settings-fields.php | Added collapsible <details> wrapper with count display for both blocked domains and keywords tables |
| .github/changelog/2591-from-description | Added changelog entry documenting the UI improvement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move the inline styles for the collapsible details/summary elements to activitypub-admin.css instead of using inline styles in PHP.
4d67dae to
6205b3c
Compare
|
I generally like the idea, but it is still a bit glitchy.
|
- Always render <details> wrapper structure (even when empty) with data-type attribute - Add <tbody> wrapper for proper striped table styling - Update JavaScript to work with collapsible structure and update summary counts dynamically - Use wp.i18n._n() for proper pluralization instead of localized strings - Add wp-i18n dependency and wp_set_script_translations() - Extract duplicated validation/message code into helper functions - Add JSDoc comments for better IDE support
Use jQuery's element construction with attributes object and .text() instead of string concatenation when inserting user-controlled values into the DOM. This prevents malicious input from being executed.
|
@pfefferle This should behave less glitchy now. |
Proposed changes:
<details>elements.Other information:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Wrap blocked domains and keywords tables in collapsible details element.