Plugins window: expandable rows with rich plugin details#208
Merged
Conversation
- Implemented the `<wpd-rating-summary>` component to display a rating summary with a two-pane layout. - Added styles for the component to ensure proper layout and theming capabilities. - Created smoke tests to verify functionality, including rendering of histogram rows, automatic total calculation, and correct star rating conversion.
Contributor
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #200
plugins.improvements.mov
Why
The new Installed-plugins table had no way to see plugin details — description, changelog, FAQ, reviews, links, requirements, file metadata. The Browse tab has a slide-in flyout for that, but the Installed tab was just rows of names with no path to "tell me more about this plugin." Users were left guessing.
What ships
Expandable row detail panel —
src/plugins-window/installed-detail.tsClick any row in the Installed tab (or its chevron) and a rich detail panel slides out below it.
<wpd-badge>s for version, Active/Inactive status, and pending updates. No banner image (early iterations rendered the wp.org banner full-bleed; it looked like a billboard).<wpd-tabs>):<wpd-grid columns="2">of compact<wpd-card>s, one fact per card (file path, version, size on disk, requires WP/PHP, text domain, plugin/author URLs, network-only flag, status).<h*>1.2.3</h*>and= 1.2.3 =heading styles, groups the following nodes under each version, badges the newest with "Latest".<details>cards. First question opens by default. Animated chevron rotates 180° and flips to admin-theme-color on open.prefers-reduced-motionrespected.<wpd-rating-summary>on top, then a 2-column grid of review cards.plugin_informationand reviews are fetched on first tab activation only, cached at module scope keyed by slug. Collapsing and re-expanding a row never refetches.New
<wpd-rating-summary>component —src/ui/components/wpd-rating-summary/Replaces an ASCII-feeling histogram with a proper component:
rating(0–100, wp.org convention),total(auto-summed fromratingswhen omitted).ratings({ '5': n, … }).transform: scaleX(--ratio)with 600 ms easing).--wpd-rating-fill,--wpd-rating-star, etc.).prefers-reduced-motionrespected.src/ui/components/index.ts+WPD_COMPONENT_TAGS.The bugs found along the way
Shadow-DOM CSS doesn't pierce — the "huge icon" bug
<wpd-table>appends sub-rows into its own shadow DOM. Document-level CSS doesn't cross shadow boundaries, so every.desktop-mode-plugins__detail-*rule inplugins-window.csswas silently ignored. The hero icon wrapper had no styling, the SVG inside expanded to fill its container, and the expanded row looked like a Times Square ad.Fix: ship the panel stylesheet as a
<style>element appended inside the panel root, so the rules live in the same shadow tree as the markup. ~300 lines of rules moved out ofplugins-window.cssand into aPANEL_STYLESconstant.wp.org ships malformed FAQ HTML — the empty-accordion bug
Verified by curling
api.wordpress.org/plugins/info/1.0/<slug>.jsonfor WooCommerce, Yoast, Elementor, Fluent Support, Jetpack, WPForms. Every FAQ ships as:When the browser parses this, the question text and every answer paragraph end up as children of
<dt>, not as siblings. My first parser walked top-level siblings and found nothing — the accordion opened to an empty body.Fix: three-strategy parser, tried in order — (1)
:scope > dt(the wp.org default; split each<dt>on its first substantive child element), (2) real<dl><dt>…</dt><dd>…</dd></dl>pairs, (3) conventional<h*>Q</h*><p>A</p>siblings. Strips empty<p></p>debris from the broken nesting. Wraps bare text answers in<p>. Verified live against 6 plugins: WooCommerce 12 pairs, Yoast 7, Elementor 13, Fluent Support 6, Jetpack 8, WPForms 10.Inline
<img>in plugin descriptionsSome plugins ship a banner-style
<img>at the top of their description HTML.max-width: 100%let it dominate. Now capped atmax-height: 220px; object-fit: containso descriptions read like documentation, not landing pages.Misleading reviews empty state
The original copy said "No recent reviews" when the wp.org scraper returned zero items — but the scraper fails for many reasons (HTML drift, rate limit, locale redirect) and a histogram with hundreds of ratings could be sitting right above it, contradicting the claim. Now:
parsed: false(scrape failed) → honest "Reviews live on WordPress.org" empty state with an "Open reviews on WordPress.org" button.parsed: true, items: [](genuinely no scraped items) → just a centered "Write a review on WordPress.org" button. No misleading heading, no descriptive text. The CTA links to the actual write-a-review deep link (/support/plugin/<slug>/reviews/#new-post).Files touched
src/plugins-window/installed-view.ts— wirestable.subTable = buildInstalledDetail, toggles expansion onwpd-table-row-click.src/plugins-window/installed-detail.ts— new, ~1300 lines.src/ui/components/wpd-rating-summary/{wpd-rating-summary.ts,.styles.ts,.test.ts}— new component.src/ui/components/index.ts— registered.assets/css/plugins-window.css— added the row-cursor cue; the rest of the panel styles live inline in the TS module (see shadow-DOM note).Tests
npm run lint,npm run build,tsc --noEmit,npm run test:js— all green. 1160 tests passing (5 new for<wpd-rating-summary>).Out of scope / follow-ups
bindMenuRefresh+refreshFrameworkMenu), unrelated to this change. To investigate in a follow-up PR.