Skip to content

fix(operational-dashboard): remove stray unused widget catalog entries - #280

Merged
kdoberst merged 2 commits into
openshift-online:mainfrom
kdoberst:HYERSHELL-338-remove-stray-widgets
Sep 16, 2026
Merged

kdoberst merged 2 commits into
openshift-online:mainfrom
kdoberst:HYERSHELL-338-remove-stray-widgets

Conversation

@kdoberst

Copy link
Copy Markdown
Collaborator

Summary

Fixes HYPERSHELL-338 by removing three stray operational dashboard widget types that were still registered in the widget catalog but not part of the default layout. On a fresh load (cleared local storage), those entries caused the Add widgets control to appear even though every default widget was already on the grid.

  • Remove optional widget catalog entries for managed-clusters, managed-cluster-status, and managed-databases
  • Remove the unused ManagedClusterStatusCard component and related i18n strings
  • Bump the layout persistence key to hypershell.operational-dashboard.layout.v29 so saved layouts reset cleanly

Problem

After clearing localStorage, the operational dashboard showed an Add widgets button with three inventory widgets that could be added back:

  • Clusters (managed-clusters)
  • Cluster status (managed-cluster-status)
  • Databases (managed-databases)
Screenshot 2026-09-14 at 1 15 05 PM

These were leftover registrations from earlier platform-inventory work. They were not on the default layout and were not intended to be user-facing yet, so a clean dashboard load should not offer anything to add.

Expected behavior:

  • Fresh load with no saved layout: Add widgets is hidden
  • After removing a widget from the default layout: Add widgets lists only the widget(s) that were removed

Solution

Delete the stray widget mappings, rendering logic, and message keys for the three unused types. Platform inventory coverage on the default layout is unchanged.

Changes

Area Change
packages/operational-dashboard-ui/src/pages/operational-dashboard-page.tsx Remove widget catalog entries and managed-clusters inventory-status routing; bump layout key to v29
packages/operational-dashboard-ui/src/pages/dashboard-widget.tsx Remove ManagedClusterStatusCard
packages/operational-dashboard-ui/src/dashboard/dashboard-layout-template.ts Remove title messages for deleted widget types
packages/operational-dashboard-ui/src/messages.ts Remove unused widget and chart message descriptors
components/web-console/locales/en.json Remove matching locale entries

Test plan

  • Clear localStorage for the web console origin (or use a fresh browser profile)
  • Open the operational dashboard as a platform admin with inventory metrics available
  • Confirm the default Platform inventory section renders (inventory-summary, provider/region donuts, database status)
  • Confirm Add widgets is not shown on initial load
  • Remove a default widget (for example managed-cluster-regions), open Add widgets, and confirm only the removed widget is listed
  • Re-add the removed widget and confirm it renders correctly
  • Run pnpm --filter @openshift-online/hypershell-operational-dashboard-ui check

@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 71a477a4-2d16-4dc2-831d-e4d416063a68

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@amber-review-bot

amber-review-bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Amber review: comment

Amber review

Status: Complete

View the submitted review.

amber-review-bot

This comment was marked as outdated.

amber-review-bot

This comment was marked as outdated.

amber-review-bot

This comment was marked as outdated.

@kdoberst kdoberst changed the title HYPERSHIFT-338 Remove stray unused widgets HYPERSHELL-338 Remove stray unused widgets Sep 15, 2026
@kdoberst
kdoberst force-pushed the HYERSHELL-338-remove-stray-widgets branch from 9ffb64e to c6f1b7c Compare September 15, 2026 13:23
amber-review-bot

This comment was marked as outdated.

@kdoberst kdoberst changed the title HYPERSHELL-338 Remove stray unused widgets fix(operational-dashboard): remove stray unused widget catalog entries Sep 15, 2026
@kdoberst

Copy link
Copy Markdown
Collaborator Author

Note: I ran pnpm run i18n:extract and no updates were needed

Update OP-DASH-21 and PI-07 so specs match the removed standalone
managed-clusters, managed-cluster-status, and managed-databases widgets
and record the layout persistence key v29 bump.

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

@amber-review-bot amber-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict

Re-verified at head 7574215: this remains a clean, symmetric removal of three catalog-only operational-dashboard widgets (managed-clusters, managed-cluster-status, managed-databases), and the new docs: commit brings the specs back in line with the code. The remaining open item is not a defect in this PR but a cross-PR merge-order/renumbering decision it shares with the other in-flight dashboard change.

Amber Analysis

The removal is functionally complete and internally consistent. The five removed messages.ts descriptors match the five removed locales/en.json entries one-for-one, ManagedClusterStatusCard and its import are gone with no remaining references, and the inventory-status branch in createWidgetMapping now unconditionally returns ManagedDatabaseStatusCard (correct, since managed-database-status is the only surviving inventory-status widget). The managed-clusters / managed-databases metric IDs are still consumed by the surviving managed-cluster-providers, managed-cluster-regions, and managed-database-status widgets plus dashboard-metric-sources.ts and the inventory-summary path, and ClusterIcon/DatabaseIcon remain in use, so nothing is orphaned. Confidence: High.

Previous concerns

  • Code contradicted normative spec OP-DASH-21 (widget catalog, scenario, version history): addressed. Commit 7574215 updates specs/web-console/operational-dashboard.spec.md OP-DASH-21 to state the catalog SHALL NOT register the three standalone widget types, removes the Scenario: Operator adds managed cluster status donut, and records the v29 bump in the version-history line ("Removing managed-clusters, managed-cluster-status, and managed-databases from the widget catalog SHALL bump the layout persistence key to ...layout.v29"). The companion specs/platform/platform-inventory.spec.md PI-07 table drops the three rows and its suppression scenario now targets managed-database-status. Code and spec now agree.
  • OP-DASH-21 catalog/scenario spec-consistency inline finding: addressed by the same commit; see the spec text above.
  • Non-conventional PR/commit title: addressed. The PR title is now fix(operational-dashboard): remove stray unused widget catalog entries, a valid Conventional Commit for the squash merge. (The branch name HYERSHELL-338 remains misspelled but is cosmetic.)
  • Confirm i18n:check passes for the hand-edited en.json deletions: cannot verify. The 5-descriptor / 5-locale removal is symmetric by inspection, but I cannot run formatjs extract here; this remains a CI-verify item (the author noted pnpm run i18n:extract produced no updates).

Cross-PR coordination

PR #279 (registered-user adoption metrics) reshapes the same operational-dashboard default layout and edits the same files this PR touches (operational-dashboard-page.tsx, dashboard-layout-template.ts, messages.ts, dashboard-widget.tsx, components/web-console/locales/en.json, and both specs/web-console/operational-dashboard.spec.md and specs/platform/platform-inventory.spec.md). Both branch off the same v28 base of the strictly-ordered LAYOUT_STORAGE_KEY: this PR advances the code key and spec version history to v29, while #279 advances both straight to v30, omitting v29. The raw keys do not collide, so there is no localStorage hazard; the issue is monotonic numbering and spec consistency. More substantively, #279 retains the three widget catalog entries (managed-clusters, managed-cluster-status, managed-databases) that this PR deletes, so the two PRs disagree on the final widget catalog and combined default-layout shape. Maintainers and the shared author must pick a merge order, renumber the layout key and spec version history so they stay monotonic, and agree whether those three widgets are deprecated (this PR) or preserved (#279) in the merged result before either lands.

Findings Summary (ordered by severity, highest first)

No new findings. All prior substantive concerns are addressed; one CI-verify note remains.

  1. [Note] Confirm i18n:check is green in CI for the hand-edited en.json deletions - Spec Consistency

Convention Checklist

Convention Result
Code matches authoritative spec (desired state) Pass
Conventional commit / PR title Pass
No em dashes in text files Pass
i18n descriptors and locale entries kept in sync Pass
No orphaned imports/components after removal Pass
PatternFly / canonical shared components reused Pass

kdoberst added a commit to kdoberst/hypershell that referenced this pull request Sep 15, 2026
PI-03 must cover both managed_clusters and managed_databases List RBAC
to match authorization.go and PI-09. Database inventory removal belongs
in a follow-on PR (openshift-online#272); widget catalog cleanup follows in openshift-online#280.

HYPERSHELL-279

Co-authored-by: Cursor <cursoragent@cursor.com>
kdoberst added a commit to kdoberst/hypershell that referenced this pull request Sep 16, 2026
PI-03 must cover both managed_clusters and managed_databases List RBAC
to match authorization.go and PI-09. Database inventory removal belongs
in a follow-on PR (openshift-online#272); widget catalog cleanup follows in openshift-online#280.

HYPERSHELL-279

Co-authored-by: Cursor <cursoragent@cursor.com>
@kdoberst
kdoberst added this pull request to the merge queue Sep 16, 2026
Merged via the queue into openshift-online:main with commit 6fe7247 Sep 16, 2026
26 checks passed
@kdoberst
kdoberst deleted the HYERSHELL-338-remove-stray-widgets branch September 16, 2026 17:35
kdoberst added a commit to kdoberst/hypershell that referenced this pull request Sep 17, 2026
PI-03 must cover both managed_clusters and managed_databases List RBAC
to match authorization.go and PI-09. Database inventory removal belongs
in a follow-on PR (openshift-online#272); widget catalog cleanup follows in openshift-online#280.

HYPERSHELL-279

Co-authored-by: Cursor <cursoragent@cursor.com>
kdoberst added a commit to kdoberst/hypershell that referenced this pull request Sep 17, 2026
…PERSHELL-279] (openshift-online#279)

* HYPERSHELL-279 specs

* HYPERSHELL-279 Code

* Add  platform:admin role to dev admin user

* Updated specs

* Amber review fixes

* perf(api-server): cache daily activity upserts per user and UTC day

Skip redundant INSERT ... ON CONFLICT DO NOTHING round-trips on the
authenticated request path after a user is already recorded for the
current UTC day. Retries on persistence failure to preserve best-effort
RU-10 semantics.

HYPERSHELL-279

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

* fix(api-server): wrap user DAO errors with context

Wrap gorm errors in activity and adoption count DAO methods so scrape
and recording failures are easier to trace.

HYPERSHELL-279

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

* docs(spec): narrow inventory spec overlap with controller-local openshift-online#272

Scope PI-03 dashboard-inventory authorization to managed clusters only and document the adoption layout v30 bump in OP-DASH-11 so this PR does not reaffirm database inventory contract language that openshift-online#272 removes.

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

* docs(spec): restore managed_databases in PI-03 dashboard inventory auth

PI-03 must cover both managed_clusters and managed_databases List RBAC
to match authorization.go and PI-09. Database inventory removal belongs
in a follow-on PR (openshift-online#272); widget catalog cleanup follows in openshift-online#280.

HYPERSHELL-279

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

* fix broken test after rebase

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants