Skip to content

feat(adoption-insights): Top Plugins card + shared primitives (RHIDP-18768, RHIDP-18769) - #5470

Open
ciiay wants to merge 21 commits into
redhat-developer:mainfrom
ciiay:RHIDP-18133-top-plugins-homepage-card
Open

ciiay wants to merge 21 commits into
redhat-developer:mainfrom
ciiay:RHIDP-18133-top-plugins-homepage-card

Conversation

@ciiay

@ciiay ciiay commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Hey, I just made a Pull Request!

Implements the two UI stories under epic RHIDP-18133 (UX DTUX-3136):

  • RHIDP-18768 — shared Popular Content homepage card primitives
  • RHIDP-18769 — Top Plugins / Extensions homepage card

QE / e2e coverage remains out of scope here (RHIDP-18770).

What changed

  • Shared Popular Content shell: auto / hybrid / curated mode resolution, display-count + title config, Adoption Insights fetch helpers limited to the configured count, empty / error / permission-denied states that keep the homepage loadable, and HomePageWidgetBlueprint registration.
  • Top Plugins card (home-page-widget:adoption-insights/top-plugins-card) maps getPlugins() / top_plugins into list rows with rank, 16px plugin icons, friendly display name, plugin id subtitle, signed trend %, and visit counts; header info tooltip for the 28-day lookback.
  • Built-in plugin destinations (admin-overridable via pluginDestinations), SPA navigation via Backstage Link, and InfoCard shell so dark-mode surfaces match other NFS homepage widgets.
  • Local NFS app-config wiring (widgetLayout + homepage.defaultWidgets) so the card appears in Add-widget / customizable homepage.

How to verify

  • cd workspaces/adoption-insights && yarn start → open / and confirm Top Plugins renders with rank / icon / name / id / trend / visits
  • Toggle card settings (mode, displayCount, title) on the customizable homepage; curated mode with items should skip AI fetches
  • Empty / error / permission-denied states keep the homepage loadable
  • On rhdh-local, enable Adoption Insights + homepage and confirm Add-widget lists the card (defaultWidgets.ref: top-plugins-card)
  • Unit tests from the plugin package:
    CI=1 yarn test --testPathPatterns='homepage/(popularContent|topPlugins)' --watchAll=false

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
rhidp_18133.mp4

Ship the Popular Content pathfinder card with shared mode/config primitives
and a BUI list row (rank, trend, visits) for local and RHDH homepage verify.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rhdh-gh-app

rhdh-gh-app Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-app-defaults

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/adoption-insights/packages/app none v0.0.0
@red-hat-developer-hub/backstage-plugin-adoption-insights workspaces/adoption-insights/plugins/adoption-insights minor v1.1.1
@red-hat-developer-hub/backstage-plugin-app-defaults workspaces/app-defaults/plugins/app-defaults none v1.13.1

@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.08585% with 116 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.05%. Comparing base (fd3c61e) to head (2a30c2d).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5470      +/-   ##
==========================================
+ Coverage   66.01%   66.05%   +0.04%     
==========================================
  Files        2808     2824      +16     
  Lines      113174   113676     +502     
  Branches    31772    31918     +146     
==========================================
+ Hits        74708    75093     +385     
- Misses      36654    36768     +114     
- Partials     1812     1815       +3     
Flag Coverage Δ *Carryforward flag
adoption-insights 86.58% <73.08%> (-2.28%) ⬇️
ai-integrations 90.89% <ø> (ø) Carriedforward from 0fb05c5
app-defaults 77.28% <ø> (ø)
augment 46.67% <ø> (ø) Carriedforward from 0fb05c5
boost 93.94% <ø> (ø) Carriedforward from 0fb05c5
bulk-import 73.13% <ø> (ø) Carriedforward from 0fb05c5
cost-management 13.56% <ø> (ø) Carriedforward from 0fb05c5
dcm 74.35% <ø> (ø) Carriedforward from 0fb05c5
e2e-adoption-insights 60.16% <ø> (ø) Carriedforward from 0fb05c5
e2e-extensions 62.87% <ø> (ø) Carriedforward from 0fb05c5
e2e-global-header 52.43% <ø> (ø) Carriedforward from 0fb05c5
e2e-homepage 61.25% <ø> (ø) Carriedforward from 0fb05c5
e2e-intelligent-assistant 46.10% <ø> (ø) Carriedforward from 0fb05c5
e2e-orchestrator 49.80% <ø> (ø) Carriedforward from 0fb05c5
e2e-orchestrator-plugin 49.79% <ø> (ø) Carriedforward from 0fb05c5
e2e-quickstart 54.83% <ø> (ø) Carriedforward from 0fb05c5
e2e-scorecard 49.88% <ø> (ø) Carriedforward from 0fb05c5
e2e-theme 16.43% <ø> (ø) Carriedforward from 0fb05c5
extensions 60.42% <ø> (ø) Carriedforward from 0fb05c5
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 0fb05c5
global-header 69.15% <ø> (ø) Carriedforward from 0fb05c5
homepage 86.56% <ø> (ø) Carriedforward from 0fb05c5
install-dynamic-plugins 86.58% <ø> (ø) Carriedforward from 0fb05c5
intelligent-assistant 79.92% <ø> (ø) Carriedforward from 0fb05c5
konflux 91.98% <ø> (ø) Carriedforward from 0fb05c5
lightspeed 69.02% <ø> (ø) Carriedforward from 0fb05c5
mcp-integrations 84.46% <ø> (ø) Carriedforward from 0fb05c5
orchestrator 77.13% <ø> (ø) Carriedforward from 0fb05c5
quickstart 65.83% <ø> (ø) Carriedforward from 0fb05c5
sandbox 79.56% <ø> (ø) Carriedforward from 0fb05c5
scorecard 92.32% <ø> (ø) Carriedforward from 0fb05c5
theme 89.01% <ø> (ø) Carriedforward from 0fb05c5
translations 7.91% <ø> (ø) Carriedforward from 0fb05c5
x2a 81.73% <ø> (ø) Carriedforward from 0fb05c5

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd3c61e...2a30c2d. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ciiay and others added 3 commits November 6, 2026 22:58
Wire plugin destinations, SPA navigation, 16px icons, InfoCard theming,
and homepage defaultWidgets catalog registration so the pathfinder card
matches DTUX visual ACs and shows up in Add-widget.

Co-authored-by: Cursor <cursoragent@cursor.com>
Narrow ListRow icon to ReactElement and loosen MUI icon map typing so
tsc:full passes; dedupe yarn.lock for the verify-lockfile check.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align translation key order in the API report with declarations produced
by tsc:full so the CI api-reports --ci gate passes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ciiay
ciiay marked this pull request as ready for review November 9, 2026 15:09
Align changeset filenames with the Top Plugins story instead of the
parent epic RHIDP-18133.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ciiay ciiay changed the title feat(adoption-insights): Top Plugins homepage card (RHIDP-18133) feat(adoption-insights): Top Plugins homepage card (RHIDP-18769) Nov 9, 2026
@ciiay ciiay changed the title feat(adoption-insights): Top Plugins homepage card (RHIDP-18769) feat(adoption-insights): Top Plugins card + shared primitives (RHIDP-18768, RHIDP-18769) Nov 9, 2026
ciiay and others added 2 commits November 9, 2026 10:37
Combine the destinations patch into the single minor changeset so one
entry covers the full RHIDP-18768/18769 PR surface.

Co-authored-by: Cursor <cursoragent@cursor.com>
Gate the homepage widget with the same NFS permission predicate as the
Adoption Insights page so unauthorized users do not see it on the grid
or in the Add Widget catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>
@invincibleJai

Copy link
Copy Markdown
Member

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:13 AM UTC · Completed 6:37 AM UTC

Commit: 8a08267 · View workflow run →

Runtime: claude · Model: claude-opus-4-6 · Effort: high · Cost: $9.86

@fullsend-ai-review fullsend-ai-review Bot added the risk/elevated PR risk: elevated label Nov 12, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: elevated (3/5)

Details

Large-scale feature addition (36 files, 2787 lines, 3 dependency files, large blast radius) in a mature, actively contested workspace (9 authors, 9 fix commits in 90d) produces an elevated composite risk despite no protected paths or CI changes.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [Alpha types in stable API surface] report.api.md:14 — The stable API report imports HomePageWidgetBlueprintParams and HomePageWidgetData from @backstage/plugin-home-react/alpha. Alpha packages carry no semver compatibility guarantees; a breaking change to HomePageWidgetBlueprintParams would silently violate the stable package contract without a semver major bump.
    Remediation: Either move the new extension's declaration to report-alpha.api.md (mark it @alpha) until @backstage/plugin-home-react/alpha stabilises, or confirm with the Backstage team that the types are effectively frozen and document that assumption.

Low

  • [Inconsistent date formatting] useAdoptionInsightsRanking.ts:92 — start_date uses formatInTimeZone() while end_date uses format() from date-fns. Both produce the same result today (timezone is the host timezone), but using two different formatting strategies for the same kind of value is error-prone for maintenance.
    Remediation: Use formatInTimeZone() consistently for both start_date and end_date.

  • [input-validation] pluginDestinations.ts:83 — path.startsWith('/') also accepts protocol-relative URLs like //evil.com. The rendering layer handles this correctly via isExternalHref, but the JSDoc claim "Only absolute app paths" is inaccurate. Admin-controlled config only; practical risk is negligible.
    Remediation: Tighten to path.startsWith('/') && !path.startsWith('//').

  • [scope-creep] app-config.yaml:87 — Backend port changed from 7007 to 7009 with no explanation. All other workspaces use 7007. Neither linked issue authorises this change.
    Remediation: Revert the port change or add a comment explaining why 7009 is required.

  • [dead-code-abstraction] topPlugins/pluginDestinations.ts — Unused re-export barrel forwarding from ../popularContent/pluginDestinations. No file imports from this module; mapPlugins.ts imports directly from ../popularContent/pluginDestinations.
    Remediation: Remove this file or document the intent for future use.

  • [unexplained-dependency-upgrade] packages/app/package.json — @red-hat-developer-hub/backstage-plugin-theme bumped from ^1.2.2 to ^1.5.1 (3 minor versions) without explanation in the changeset or PR body.
    Remediation: Document why this version is required or revert if not strictly needed.

  • [naming/idioms] PopularContentListCard.tsx:163 — visitCount.toLocaleString('en-US') hard-codes the US locale for number formatting. The plugin supports i18n translations (de, es, fr, it, ja), so hard-coding en-US number formatting contradicts the internationalisation effort.
    Remediation: Use visitCount.toLocaleString() (no argument) for browser locale.

  • [missing prerequisite documentation] README.md:24 — The installation section omits that homepage widgets require @red-hat-developer-hub/backstage-plugin-homepage. The new "Homepage widgets (NFS)" section mentions it only parenthetically.
    Remediation: Add explicit install/import instructions under the "Homepage widgets (NFS)" heading.

  • [Promoted production dependency changes] package.json:68 — @backstage/ui moved from devDependencies to dependencies, and @remixicon/react added as new production dependency. Both promotions are justified by runtime usage in new homepage card components.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:

  • workspaces/adoption-insights/plugins/adoption-insights/README.md (file-level): Line 24 · [low] missing prerequisite documentation

The installation section omits that homepage widgets require @red-hat-developer-hub/backstage-plugin-homepage. The new 'Homepage widgets (NFS)' section mentions it only parenthetically.

Suggested fix: Add explicit install/import instructions under the 'Homepage widgets (NFS)' heading.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

Tighten destination path validation, align date formatting and locale
number formatting, restore the default backend port, drop an unused
re-export, document the homepage plugin prerequisite, and keep the
local theme pin on the existing caret range.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ciiay

ciiay commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

Addressed Fullsend review findings in e49012b:

Fixed

  • Consistent formatInTimeZone() for ranking lookback dates
  • Reject protocol-relative // destinations in parsePluginDestinations
  • Revert local backend port 7009 → 7007
  • Browser-locale toLocaleString() for visit counts
  • Remove unused topPlugins/pluginDestinations re-export barrel
  • Revert unexplained theme caret pin ^1.5.1 → ^1.2.2 (homepage dep kept)
  • README: explicit homepage plugin prerequisite + install note; clarify permission gate hides the card

Intentionally unchanged

  • Alpha types in stable API report (medium): same NFS HomePageWidgetBlueprint pattern already used by scorecard; widget must stay on the stable plugin export for discovery. Replied on the inline comment with rationale.
  • @backstage/ui / @remixicon/react promotions: justified by runtime usage (review already notes this)

Happy to adjust further if reviewers want a different approach on the medium finding.

Co-authored-by: Cursor <cursoragent@cursor.com>
ciiay and others added 3 commits November 13, 2026 11:32
Co-authored-by: Cursor <cursoragent@cursor.com>
…type

Replace per-row plugin icons with centered ranks, tighten header chrome, and use full-width BUI token dividers with whole-row href navigation and hover.

Co-authored-by: Cursor <cursoragent@cursor.com>
…Layout

Remove in-card Edit settings (RHDHPLAN-1711) and document auto, hybrid, and curated mode examples in the README.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore blank lines accidentally removed from IA package changelogs; no IA changes in this PR.

Co-authored-by: Cursor <cursoragent@cursor.com>

@Eswaraiahsapram Eswaraiahsapram left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @ciiay, I tested it locally, and everything looks good to me. I’ve added a few review commits. Could you please take a look?

Align the 28-day lookback with the Insights page inclusive window, drop the
unused footer and positive-trend plus, tighten widget height to h:4, and refresh
the changeset summary.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use absolute trend values with direction via icon/aria, render a centered
empty state and danger Alert for errors, and move status copy into locales.

Co-authored-by: Cursor <cursoragent@cursor.com>
"@mui/x-date-pickers": "5.0.20",
"@red-hat-developer-hub/backstage-plugin-adoption-insights-common": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-app-react": "^1.8.1",
"@remixicon/react": "^4.6.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to add this additional library when we already have MUI Icons? Could we use the existing MUI Icons instead?

Comment on lines +31 to +37
import {
RiArrowDownLine,
RiArrowUpLine,
RiCheckboxCircleFill,
RiInformationLine,
RiSubtractLine,
} from '@remixicon/react';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we already have MUI Icons available in the project, could we use the existing MUI icons instead of introducing an additional dependency?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Eswaraiahsapram , we are moving away from MUI in our migration feature, so in my implementation I tried to avoid using components from any MUI lib.

ciiay and others added 2 commits November 25, 2026 09:23
Sync report-alpha.api.md after adding emptyDescription and errorDescription
translation keys for the Top Plugins empty/error states.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ciiay
ciiay requested review from a team as code owners November 25, 2026 14:40
Restore the test dependency used by AppSidebar tests after the main merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
ciiay and others added 2 commits November 25, 2026 10:03
Regenerate report-alpha.api.md from a clean tsc so translation key order
matches CI after the main merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
…S routes

Prefer widget/config overrides and mounted app-tree pages over the static
fallback map, and skip shared shell plugin ids like app so analytics rows
do not deep-link to Learning Paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants