PR 19794 review

rancher/dashboard PR 19794 (codyrancher), Show the project name in the Project Monitor detail header, fixes issue 15947. You were the requested reviewer. Reviewed 2026-11-05. Nothing is posted.

Preview: rancherpr19794r.mf-created-dashboard.ui.rancher.space, built from 51a64e59d, backend mf Rancher (v2.16.0-7758e3e-head). Baseline: the shared dashboard-master preview, rebuilt today from 261b8932f, the current tip. PR + fix: rancherpr19794fixr.mf-created-dashboard.ui.rancher.space, commit 5522448ca, which exists only locally.

Verdict: good change, one small suggestion, nothing blocks

Test it yourself

  1. Log in as the mf local admin on the PR list and pick All Namespaces. The admin's filter on this cluster is Only System Namespaces, and my runs didn't change it.
  2. Click the Default row whose namespace is default. The header reads Project Monitor: Default. Master reads project-monitoring.
  3. Find the pr19794-noproject row. Its Project cell is empty on the PR and on master, and shows project-monitoring on PR + fix.
  4. Open that monitor in edit mode. The header stops at Project Monitor:, and PR + fix names it. The form below stays on Loading on every build, because the federator's ConfigMap isn't on the cluster. I removed my temporary one so it can't confuse your PR 19737 checks.
  5. Open the pr19794-special row and click Show Configuration to see card 3.

The non-admin cases can't be replayed, because I deleted the temp user. The screenshots below are from that user.

Findings
1

Two places skip the new fallback

shell/list/helm.cattle.io.projecthelmchart.vue:42 · shell/components/ResourceDetail/Masthead/legacy.vue:395
Suggestion

The PR adds the fallback to nameDisplay, but the list's Project column and the legacy masthead (which edit mode also uses) read projectDisplayName, which has none. So when the project can't be resolved, they show nothing, while the new detail header correctly shows project-monitoring.

Where it shows

Neither is the common path. A Project Member reading a monitor in their own project gets Default everywhere, so this takes custom RBAC or a namespace outside any project.

PR, real non-admin: the third row has no link
PR, real non-admin: the third row has no link
PR + fix, same user: the third row can be opened
PR + fix, same user: the third row can be opened
PR, edit mode, namespace in no project: no name
PR, edit mode, namespace in no project: no name
PR + fix, same monitor
PR + fix, same monitor

The fix, tested

shell/list/helm.cattle.io.projecthelmchart.vue
-        return {
-          ...header, value: 'projectDisplayName', labelKey: 'tableHeaders.project'
-        };
+        return { ...header, labelKey: 'tableHeaders.project' };

shell/components/ResourceDetail/Masthead/legacy.vue
-import { FLEET, NAMESPACE, MANAGEMENT, HELM } from '@shell/config/types';
+import { FLEET, NAMESPACE, MANAGEMENT } from '@shell/config/types';
-    isProjectHelmChart() {
-      return this.schema?.id === HELM.PROJECTHELMCHART;
-    },
-
-      let displayName = this.value.nameDisplay;
-
-      if (this.isProjectHelmChart) {
-        displayName = this.value.projectDisplayName;
-      }
+      const displayName = this.value.nameDisplay;

On PR + fix, the blank cell and blank headers are gone, and everything else matches the PR: header, drawer, delete dialog, export name, sort order, search and legacy view. The ten suites covering these files pass (62 tests), and lint is clean. PR 19737 edits other parts of the list file, so this shouldn't conflict with it.

2

The PR fixes a missing header it barely mentions

Good

The description says projectId stops throwing. What that means for a user: on master, someone who can read a monitor but not its namespace gets no title or actions on the detail page, plus a TypeError in the console. With the PR they get the normal header.

Master, real non-admin: no header
Master, real non-admin: no header
PR, same user and monitor
PR, same user and monitor
3

The drawer title shows HTML entities for free-text names

shell/components/Drawer/ResourceDetailDrawer/index.vue:34 · shell/components/Resource/Detail/TitleBar/index.vue:131,145
Not this PR

i18n.t() escapes its output by default, and these places then render it as plain text. A project called R&D shows as R&D in the Show Configuration title, and the two header aria-labels read the same way. It's generic: a ConfigMap with a free-text name does it on master too. This PR only adds project names to what can reach it, so I left it out of the suggested review. It could be its own small issue.

PR: Project Monitor
PR: Project Monitor
Master: a plain ConfigMap
Master: a plain ConfigMap

Nothing here renders as HTML. <b>x</b> in a project name stays literal text in the header, the delete dialog and the list.

4

Under Explorer, the list shows its heading and Create button twice

Not this PR

Open Project Monitors from More Resources > Helm instead of Monitoring. It's the same on master, so it isn't in the suggested review.

How it was, how it is now
CaseMasterPRPR + fix
Admin, project known
Detail headerproject-monitoringDefaultDefault
?legacy=true, edit, YAML editDefaultDefaultDefault
Show Configuration titleproject-monitoringDefaultDefault
Delete dialogproject-monitoringDefaultDefault
Header aria-labelsproject-monitoringDefaultDefault
Export As > YAMLproject-monitoring.yamlDefault.yamlDefault.yaml
Project column orderDoesn't follow the names shownSorted by project, both directionsSame as PR
List searchFinds by projectSameSame
Namespace in no project
Detail header, drawer, delete, exportproject-monitoringSameSame
Edit and ?legacy=true headerNo nameNo nameproject-monitoring
List cellEmptyEmptyproject-monitoring link
Real non-admin, Project Member of Default, RoleBindings on two registration namespaces
Own monitor, detail headerproject-monitoringDefaultDefault
Hidden namespace, detail headerNo header, TypeErrorproject-monitoringproject-monitoring
Hidden namespace, listResource names on every row, TypeError (6 of 7 loads; 1 load showed the empty state, cause not chased)Default, Default, empty (5 of 5)Default, Default, project-monitoring (4 of 4)
The PR's test steps and claims, live
PR test step or claimLive result
Apply the PR's ProjectHelmChart in default and patch its statusDone word for word. CD2 already has both CRDs and no federator, so nothing reconciled it.
List shows Project Default, click it, header reads Project Monitor: DefaultYes. Master reads project-monitoring.
Same header with ?legacy=true and in edit modeYes when the project is known. See card 1 when it isn't.
Show Configuration title and Delete dialog name the projectYes. The dialog was cancelled, nothing deleted.
Aria-labels and the YAML download name followYes: Default.yaml. The menu item is Export As, then YAML.
Project column sorting follows the project nameYes, both directions. On master the column isn't sorted by what it shows.
No Name column: UI-created monitors are one per projectHolds. The form hard-codes the name, and prometheus-federator runs with Singleton: true ("only one HelmChart can be registered per project"). A second one from kubectl also reads Default, and the operator should reject it (read in its source, not run).
Only the legacy masthead special-cased this typeNearly. The list also reads projectDisplayName, through its header override.
Also checked
CheckedResult
PR unit tests3 of 3 pass. Removing the fallback fails 2, and restoring master's throw fails 1, so they test the real behaviour.
CI on 51a64e59dGreen except Branch Milestone, the known v2.17-on-master gate. The first attempt failed only manager/kontainer-drivers.spec.ts, unrelated, and passed on the automatic retry.
Every generic reader of nameDisplayRead through them. PromptRemove's typed confirmation doesn't apply to this type, and bulk export already de-duplicates names.
namespaces getter now that projectId can be undefinedSafe from code: Namespace.projectId returns a string or null, so nothing matches undefined.
Create and clone pagesSame headers and no errors on all three builds.
Project names that collideTwo projects named zz9067-same exist on CD2. The monitor shows that name. Nothing breaks.

Not checked

To post

Suggested review: Comment

For Cody, in your voice, using your usual shape: an intro line and one inline comment, with no code blocks and no preview link. Not posted.

Main comment

Works as described: the header, drawer, delete dialog and export all show the project now, and sorting follows it. It also brings back the header for someone who can read a monitor but not its namespace, which is missing on master. One small suggestion inline.

Inline on shell/models/helm.cattle.io.projecthelmchart.js:27

The list's Project column and the legacy masthead (also used by edit) still read projectDisplayName, so they miss this fallback. When the project can't be resolved, the list shows an empty cell with nothing to click, and the edit header stops at Project Monitor:. I hit both with a monitor in a namespace outside any project, and the list one with a Project Member who can read a monitor in another project's namespace. That user gets a link on master, but only because the getter throws there.

Could both read nameDisplay instead? That means dropping the value override in the list's header map and the isProjectHelmChart special case in the masthead. I tried it and the rest stays the same, including sorting, search and the legacy and edit headers, and the tests still pass.

Attach the two list screenshots from card 1, PR then with the change, as width-400 images.

Left on the clusters

I kept these so the preview links above work. They're inert because no federator is running, but your PR 19737 checks on CD2 will see 8 monitors until they're gone. The temp user, its RBAC and the temporary federator ConfigMap are already deleted.

kubectl --kubeconfig kubeconfig/created-dashboard-2.yaml delete projecthelmcharts -n default project-monitoring
kubectl --kubeconfig kubeconfig/created-dashboard-2.yaml delete projecthelmcharts -n cattle-project-p-ln8nm project-monitoring second-monitor
kubectl --kubeconfig kubeconfig/created-dashboard-2.yaml delete projecthelmcharts -n cattle-project-p-jftpq project-monitoring
kubectl --kubeconfig kubeconfig/created-dashboard-2.yaml delete projecthelmcharts -n cattle-project-p-cdnkq project-monitoring
kubectl --kubeconfig kubeconfig/created-dashboard-2.yaml delete projecthelmcharts -n cattle-project-p-cmzfk project-monitoring
kubectl --kubeconfig kubeconfig/created-dashboard-2.yaml delete ns pr19794-noproject pr19794-special
kubectl --kubeconfig kubeconfig/kube_config_server_mf.yaml delete projects.management.cattle.io -n c-m-bmsk94st p-ph6mg
bash preview/cleanup-branch.sh dashboard pr19794fix
bash preview/cleanup-branch.sh dashboard pr19794