Skip to content

fix(scorecard): fix the default layout for homePageScorecards#2771

Merged
HusneShabbir merged 1 commit intoredhat-developer:mainfrom
rohitratannagar:fix/scorecard-homepage-default-layout
Apr 16, 2026
Merged

fix(scorecard): fix the default layout for homePageScorecards#2771
HusneShabbir merged 1 commit intoredhat-developer:mainfrom
rohitratannagar:fix/scorecard-homepage-default-layout

Conversation

@rohitratannagar
Copy link
Copy Markdown
Contributor

@rohitratannagar rohitratannagar commented Apr 15, 2026

Hey, I just made a Pull Request!

Description

Fixes: https://redhat.atlassian.net/browse/RHDHBUGS-2952

  • Fixes the default layout for scorecardHomePageCards

UI before changes

Screenshot 2026-04-15 at 10 33 32

UI after changes

Screen.Recording.2026-04-15.at.6.22.03.PM.mov

✔️ 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)

@rhdh-qodo-merge
Copy link
Copy Markdown

Review Summary by Qodo

Fix scorecard homepage default layout and widget configuration

🐞 Bug fix 📝 Documentation

Grey Divider

Walkthroughs

Description
• Renamed scorecard homepage widgets to reflect actual configurations
• Updated widget priorities and layout positioning in app config
• Added two new aggregated card widgets for different metric types
• Updated documentation with new widget names and descriptions
Diagram
flowchart LR
  A["Old Widget Names<br/>ScorecardJiraHomepage<br/>ScorecardGithubHomepage"] -- "Renamed to" --> B["New Widget Names<br/>AggregatedCardWithDeprecatedMetricId<br/>AggregatedCardWithDefaultAggregation<br/>AggregatedCardWithJiraOpenIssues<br/>AggregatedCardWithGithubOpenPrs"]
  B -- "Updated priorities<br/>410-440" --> C["App Config<br/>widgetLayout"]
  C -- "Documented in" --> D["README.md<br/>NFS Configuration"]
Loading

Grey Divider

File Changes

1. workspaces/scorecard/.changeset/whole-walls-ring.md ⚙️ Configuration changes +5/-0

Changeset for scorecard homepage layout fix

• Added changeset entry for patch version bump
• Documents fix for scorecard-homepage-cards default layout

workspaces/scorecard/.changeset/whole-walls-ring.md


2. workspaces/scorecard/app-config.yaml ⚙️ Configuration changes +27/-4

Update homepage widget names and priorities

• Renamed ScorecardJiraHomepage to AggregatedCardWithDeprecatedMetricId with priority 410
• Renamed ScorecardGithubHomepage to AggregatedCardWithDefaultAggregation with priority 420
• Added AggregatedCardWithJiraOpenIssues widget with priority 430
• Added AggregatedCardWithGithubOpenPrs widget with priority 440
• Updated x-axis positioning for right-column widgets

workspaces/scorecard/app-config.yaml


3. workspaces/scorecard/plugins/scorecard/README.md 📝 Documentation +37/-15

Update documentation for new widget configuration

• Updated widget configuration examples with new widget names and priorities
• Changed widget count from two to four in documentation
• Updated widget descriptions to reflect actual metric configurations
• Updated modules table to list all four new widget names
• Updated extensions section with new widget identifiers and descriptions

workspaces/scorecard/plugins/scorecard/README.md


Grey Divider

Qodo Logo

@rhdh-qodo-merge
Copy link
Copy Markdown

rhdh-qodo-merge Bot commented Apr 15, 2026

Code Review by Qodo

🐞 Bugs (1)   📘 Rule violations (0)   📎 Requirement gaps (0)
🐞\ ≡ Correctness (1)

Grey Divider


Remediation recommended

1. Homepage widgets may overlap 🐞
Description
The new widgetLayout config omits y for multiple widgets that share the same x (e.g., both
AggregatedCardWithDeprecatedMetricId and AggregatedCardWithJiraOpenIssues default to x=0,y=0),
which can stack widgets on top of each other in the read-only homepage grid. This breaks layout
determinism for any app using customizable: false (or switching to it later) while copying this
default configuration.
Code

workspaces/scorecard/app-config.yaml[R28-56]

+            AggregatedCardWithDeprecatedMetricId:
+              priority: 410
              breakpoints:
                xl: { w: 4, h: 6 }
                lg: { w: 4, h: 6 }
                md: { w: 4, h: 6 }
                sm: { w: 4, h: 6 }
                xs: { w: 4, h: 6 }
                xxs: { w: 4, h: 6 }
-            ScorecardGithubHomepage:
-              priority: 250
+                
+            AggregatedCardWithDefaultAggregation:
+              priority: 420
              breakpoints:
                xl: { w: 4, h: 6, x: 4 }
                lg: { w: 4, h: 6, x: 4 }
                md: { w: 4, h: 6, x: 4 }
                sm: { w: 4, h: 6, x: 4 }
                xs: { w: 4, h: 6, x: 4 }
                xxs: { w: 4, h: 6, x: 4 }
+
+            AggregatedCardWithJiraOpenIssues:
+              priority: 430
+              breakpoints:
+                xl: { w: 4, h: 6 }
+                lg: { w: 4, h: 6 }
+                md: { w: 4, h: 6 }
+                sm: { w: 4, h: 6 }
+                xs: { w: 4, h: 6 }
+                xxs: { w: 4, h: 6 }
Evidence
In the Scorecard workspace config, multiple widgets have no y across breakpoints, and two of them
also omit x (so they default to x=0). In the dynamic-home-page read-only grid implementation,
missing x/y are defaulted to 0 and compaction is disabled (compactType: null), so identical
coordinates can cause widgets to render in the same grid cell (overlap).

workspaces/scorecard/app-config.yaml[24-66]
workspaces/homepage/plugins/dynamic-home-page/src/alpha/components/ReadOnlyGirdLayout.tsx[52-80]
workspaces/homepage/plugins/dynamic-home-page/src/alpha/components/ReadOnlyGirdLayout.tsx[121-134]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`workspaces/scorecard/app-config.yaml` defines breakpoint layouts for multiple widgets but omits `y`. In the read-only layout implementation, missing `y` becomes `0`, and with `compactType: null` this can place multiple widgets at the same `x/y` (overlap).

### Issue Context
Even though the example config currently sets `customizable: true`, the same `widgetLayout` can be reused for `customizable: false` (read-only) in real deployments and in the README copy/paste example.

### Fix Focus Areas
- workspaces/scorecard/app-config.yaml[24-66]
- workspaces/scorecard/plugins/scorecard/README.md[127-175]

### Suggested change
Assign explicit `y` values to create distinct rows (e.g., first row `y: 0`, second row `y: 6` if `h: 6`) for the widgets that should appear below the first row (e.g., `AggregatedCardWithJiraOpenIssues` and `AggregatedCardWithGithubOpenPrs`) across all breakpoints shown.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app Bot commented Apr 15, 2026

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-scorecard workspaces/scorecard/plugins/scorecard patch v2.4.0

Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@rohitratannagar rohitratannagar force-pushed the fix/scorecard-homepage-default-layout branch from 7a0ef56 to 65d66ed Compare April 15, 2026 11:55
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@imykhno imykhno left a comment

Choose a reason for hiding this comment

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

Tested locally, widgets layout on homepage were fixed
/lgtm

Copy link
Copy Markdown
Member

@Eswaraiahsapram Eswaraiahsapram left a comment

Choose a reason for hiding this comment

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

Thanks @rohitratannagar, tested locally. Looks good to me 🎉

/lgtm

Copy link
Copy Markdown
Contributor

@HusneShabbir HusneShabbir left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@HusneShabbir HusneShabbir merged commit 0fda0c7 into redhat-developer:main Apr 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants