feat(checks): add Collapse All and Expand All controls to results page#1347
feat(checks): add Collapse All and Expand All controls to results page#1347faisalahammad wants to merge 5 commits into
Conversation
Add Collapse All and Expand All buttons above results. Hide buttons until scan completes via is-hidden class. Use custom card UI with rotating chevron, file icon, and brand color. All cards start collapsed by default. Fixes WordPress#1334
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
Adds global expand/collapse controls and updates the results UI to use a custom “file card” layout for each file’s results on the Plugin Check admin page, improving navigation for large reports.
Changes:
- Add “Collapse All” / “Expand All” controls (hidden until checks complete) to the admin page.
- Replace per-file
<details>/<summary>results sections with custom collapsible card sections (icon, branded title, rotating chevron). - Implement class-based collapse/expand behavior in JS and add corresponding CSS styles.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/admin-page.php | Adds the Collapse All / Expand All buttons container (initially hidden). |
| templates/results-table.php | Reworks per-file results markup into a collapsible “card” section with header button + content region. |
| assets/js/plugin-check-admin.js | Adds delegated per-card toggle behavior and wiring for Collapse All / Expand All; hides/shows controls based on scan completion. |
| assets/css/plugin-check-admin.css | Introduces styling for the new controls container and file-section card UI (including chevron rotation). |
| .gitignore | Ignores /build-temp. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thank you, @faisalahammad, for the quick action. It looks very good. I’m still working on gathering more feedback and exploring additional UI/UX enhancements. I’m not a developer, but I’m very curious to learn how things work. I’d love to understand more about how to contribute to an existing PR like yours, make improvements, and submit updates. Any guidance would be greatly appreciated. Thanks again for your contribution and support! |
- Remove /build-temp from .gitignore - Remove trailing <br> after file section (double spacing with card margin) - Update @SInCE tags to 2.1.0 for new toggleFileSection and setAllFileSectionsOpen Refs WordPress#1347
|
Addressed all 3 review comments in commit 9ca7abf:
Tests: PHPCS passed, JS lint passed, CodeRabbit review passed (no findings). Ready for re-review. |
The Codecov CLI v11.x GPG signature verification fails in GitHub Actions runners because the signing public key is missing from the default GPG keyring. Import it from keyserver.ubuntu.com (with a Keybase fallback) before the codecov-action runs. Add the import step to both behat-test.yml and php-test.yml since both use the same pinned codecov-action and hit the same issue. Refs WordPress#1347
|
Pushed a fix for the failing Problem: Codecov CLI v11.x checks GPG signature of its binary before uploading, but the signing public key was missing from GitHub Actions runner keyring. This caused Fix: Added a step to import the Codecov signing key before the codecov-action runs in both All 27 checks now pass including the coverage upload on PHP 8.4. |
Debian bullseye security repo (deb.debian.org) occasionally times out during Docker build for PHP 7.4 + WP 6.3 matrix job. Add retry loop around wp-env start step (3 attempts, 30s delay). Docker build cache preserves already-built layers between retries. Refs WordPress#1347
Previous 3-attempt 30s backoff insufficient for transient Docker Hub registry timeouts. Bump to 5 attempts with 60s backoff to give the network time to recover. Refs WordPress#1347
|
I'm thinking about the main purpose of this PR. Does it help plugin authors? Should it be grouped by files? |
Summary
Add Collapse All and Expand All buttons above the results list. Hide the buttons until the scan finishes, and switch the per file sections to a custom card layout with a file icon, brand colored title, and rotating chevron arrow.
Fixes #1334
Changes
templates/admin-page.php
Before:
After:
Why: Buttons must stay hidden until results load.
button-secondarymatches the export button style.templates/results-table.php
Before: native
<details>+<summary>per file.After: custom card with header button, file icon, FILE label, filename, and chevron. All cards start collapsed via
--collapsedclass.Why: Matches the reference UI in the issue. Native
details/summarydoes not give the custom card look with brand color and file icon.assets/js/plugin-check-admin.js
Why: Replaced
details.opentoggle with a class based toggle. Added a delegated click handler on each card header to flip--collapsedandaria-expanded. Hide the controls container on result reset, and show it only afterchecksCompletedis true.assets/css/plugin-check-admin.css
Why: New card style with border, white background, header button reset, chevron rotation on
aria-expanded="true", brand color on the section title, file icon spacing, and.is-hiddenon the controls container.Testing
Test 1: Initial page load
Result: Collapse All and Expand All buttons not visible. Results area empty.
Test 2: Run a check
Result: Results load. Collapse All and Expand All buttons appear above results. Each file is a collapsed card with file icon, FILE label, filename, and a right side chevron.
Test 3: Toggle cards
Result: All three toggle paths work and stay in sync with
aria-expanded.Test 4: Re run a check
Result: Controls hide during the new scan, then reappear when results finish.
Test 5: False positives section
Result: The existing false positives details element still works as before.
Screenshots
Plugin-check-preview.mov