Skip to content

Fix single perspective icon and text in NavHeader#16663

Open
vojtechszocs wants to merge 1 commit into
openshift:mainfrom
vojtechszocs:fix-single-perspective
Open

Fix single perspective icon and text in NavHeader#16663
vojtechszocs wants to merge 1 commit into
openshift:mainfrom
vojtechszocs:fix-single-perspective

Conversation

@vojtechszocs

@vojtechszocs vojtechszocs commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Analysis / Root cause

Assuming there is just one perspective available

  • Before - NavHeader renders "Core platform" perspective icon and text (regardless of the available perspective)
  • After - NavHeader renders the actual available perspective icon and text (using "Core platform" as a fallback)

Solution description

  • refactor code that works with window.SERVER_FLAGS.perspectives
  • modify NavHeader to render actual available perspective icon and text
  • modify pkg/server/server.go to log perspective overrides (if provided)

Screenshots

Test setup

  1. build Console with PR changes applied
( cd frontend; yarn install && yarn dev-once )
  1. build and run Kubevirt plugin on localhost:9001
npm install && npm run dev
  1. run Bridge server on localhost:9000 using following parameters
./bin/bridge -plugins kubevirt-plugin=http://localhost:9001 -i18n-namespaces=plugin__kubevirt-plugin \
  -perspectives '[{ "id" : "admin", "visibility": {"state" : "Disabled" }}, { "id" : "dev", "visibility": {"state" : "Disabled" }}]' \
  -branding openshift

In this setup, both "Core platform" (admin) and "Developer" (dev) perspectives are disabled.

Test cases

Open localhost:9000 in web browser and check the nav header

  • Console renders the "Core platform" icon and text [before Kubevirt console.perspective extension comes into effect]
  • Console renders the "Virtualization" icon and text [after Kubevirt console.perspective extension comes into effect]

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of perspective override handling across the console, including access-review fallbacks and pinned resource overrides when override data is missing or invalid.
    • Updated the navigation header to consistently show the active perspective icon and name, with sensible fallbacks in single- and multi-perspective modes.
    • Enhanced server-side logging for perspective override parsing and per-override visibility details.
    • Added clarifying documentation for the server flags perspective override.
  • Tests
    • Updated perspective and pinned-resource tests to mock shared override configuration instead of mutating window flags.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Perspective override handling was centralized into a shared utility and consumed by frontend hooks, the perspective state provider, and NavHeader. Related tests now mock the shared override data directly, and server logging reports parsed perspective overrides.

Changes

Perspective override flow

Layer / File(s) Summary
Shared override contract
frontend/packages/console-shared/src/utils/override-perspectives.ts, frontend/@types/console/window.d.ts, frontend/packages/console-app/src/components/detect-context/PerspectiveConfiguration.tsx, frontend/packages/dev-console/src/components/catalog/PinnedResourcesConfiguration.tsx
Defines shared perspective override types and runtime parsing, documents the window flag, and updates perspective-configuration consumers to import the shared shapes.
Hook and provider integration
frontend/packages/console-shared/src/hooks/usePerspectives.ts, frontend/packages/console-shared/src/hooks/usePinnedResources.ts, frontend/packages/console-app/src/actions/providers/perspective-state-provider.ts
Perspective visibility, pinned resources, and provider initialization now use the shared override list instead of parsing window.SERVER_FLAGS.perspectives directly.
NavHeader perspective rendering
frontend/packages/console-app/src/components/nav/NavHeader.tsx
NavHeader now derives the active perspective name and icon from the current perspective and uses the shared fallback icon path in both toggle modes.
Tests and server logging
frontend/packages/console-app/src/components/detect-context/__tests__/PerspectiveDetector.spec.tsx, frontend/packages/console-app/src/components/nav/__tests__/NavHeader.spec.tsx, frontend/packages/console-shared/src/hooks/__tests__/usePerspectives.spec.ts, frontend/packages/console-shared/src/hooks/__tests__/usePinnedResources.spec.ts, pkg/server/server.go
Perspective tests now mock the shared override list directly, and server logging reports parsed perspective overrides grouped by visibility state.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

jira/valid-reference, verified

Suggested reviewers

  • spadgett
  • sg00dwin
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: fixing NavHeader’s single-perspective icon and text.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Reviewed the modified test files; all titles are static strings with no dynamic data, UUIDs, timestamps, or generated identifiers.
Test Structure And Quality ✅ Passed These are Jest/RTL unit tests, not Ginkgo; they use beforeEach/afterEach cleanup and bounded waitFor calls, with no cluster resources or unbounded waits.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the changed tests are Jest unit specs, and the Go change is server logging only.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS: The PR only adds frontend Jest unit tests and a server log change; no new Ginkgo e2e tests or multi-node/SNO assumptions were added.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The PR only changes console UI/shared perspective parsing and server logging; no deployment manifests, controllers, pod specs, anti-affinity, nodeSelectors, or replica logic.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes were introduced; entrypoints use klog/stderr, and the new server logs are klog-backed, not fmt stdout.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS: The PR adds only frontend Jest unit/component tests and perspective refactors; no new Ginkgo e2e specs, IPv4 hardcodes, or external connectivity were introduced.
No-Weak-Crypto ✅ Passed No MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto/secret comparisons were introduced in the touched files.
Container-Privileges ✅ Passed PASS: The PR only touches TS/Go code and tests; no manifest files were changed, and the touched files contain no privileged/root/securityContext settings.
No-Sensitive-Data-In-Logs ✅ Passed New logs are generic parse/access warnings and perspective IDs/states only; no passwords, tokens, hostnames, or PII are logged.
Description check ✅ Passed The PR description covers the required analysis, solution, screenshots, test setup, and test cases; only optional sections are missing.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from Leo6Leo and TheRealJon June 22, 2026 19:29
@openshift-ci openshift-ci Bot added the component/backend Related to backend label Jun 22, 2026
@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vojtechszocs
Once this PR has been reviewed and has the lgtm label, please assign jhadvig for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added component/core Related to console core functionality component/shared Related to console-shared labels Jun 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/packages/console-shared/src/hooks/usePerspectives.ts`:
- Around line 42-52: The `overridePerspectives` export in the IIFE is casting
the parsed JSON to `Perspective[]` without validating that the parsed result is
actually an array. This means valid JSON like `{}` will pass parsing and the
type assertion, but crash downstream when array methods like `.find()` are
called. Add runtime validation to check that the parsed result from
`JSON.parse(window.SERVER_FLAGS.perspectives)` is actually an array (using
`Array.isArray()`) before returning it, and return undefined if the validation
fails, following the allow-list validation approach at this trust boundary.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ded9900b-8754-4070-b09a-624a162dfe60

📥 Commits

Reviewing files that changed from the base of the PR and between 072acc0 and 9ca7d94.

📒 Files selected for processing (6)
  • frontend/@types/console/window.d.ts
  • frontend/packages/console-app/src/actions/providers/perspective-state-provider.ts
  • frontend/packages/console-app/src/components/nav/NavHeader.tsx
  • frontend/packages/console-shared/src/hooks/usePerspectives.ts
  • frontend/packages/console-shared/src/hooks/usePinnedResources.ts
  • pkg/server/server.go

Comment thread frontend/packages/console-shared/src/hooks/usePerspectives.ts Outdated
() =>
perspectiveExtensions.find((p) => p?.properties?.id === activePerspective)?.properties ??
perspectiveExtensions[0]?.properties ?? { icon: null, name: null },
perspectiveExtensions[0]?.properties ?? { icon: null, name: '-' },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note that name is mandatory within console.perspective extension's properties.

The fallback "-" text could be replaced with null to not render any text, if we have such preference.

@vojtechszocs vojtechszocs force-pushed the fix-single-perspective branch from 9ca7d94 to f1298a6 Compare June 23, 2026 20:40
@openshift-ci openshift-ci Bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. component/dev-console Related to dev-console labels Jun 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (1)
frontend/packages/console-app/src/components/detect-context/PerspectiveConfiguration.tsx (1)

17-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Prefer a concrete SDK module path over root src import.

For new code, use a direct module file path for this type import instead of @console/dynamic-plugin-sdk/src.

As per coding guidelines, "frontend/**/*.{ts,tsx,js,jsx}: Never import from package index files ... import from specific file paths instead."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/console-app/src/components/detect-context/PerspectiveConfiguration.tsx`
at line 17, The import statement for the Perspective type in
PerspectiveConfiguration.tsx is importing from the root
`@console/dynamic-plugin-sdk/src` path. Replace this with a direct module file
path instead of the `src` root directory. Determine the specific file that
exports the Perspective type and update the import statement to reference that
concrete module path directly.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@frontend/packages/console-app/src/components/detect-context/__tests__/PerspectiveDetector.spec.tsx`:
- Line 10: The mockOverridePerspectives variable in PerspectiveDetector.spec.tsx
has an incorrect type annotation that does not allow undefined values. Update
the type annotation of mockOverridePerspectives from PerspectiveType[] to
PerspectiveType[] | undefined to match the actual return type of the
overridePerspectives export and to support test scenarios where undefined is
explicitly assigned to this variable.

In
`@frontend/packages/console-app/src/components/nav/__tests__/NavHeader.spec.tsx`:
- Line 9: The variable mockOverridePerspectives is declared with type
Perspective[] but is reset to undefined in the afterEach cleanup blocks, so the
type declaration does not match the actual possible values. Update the type
annotation of mockOverridePerspectives from Perspective[] to Perspective[] |
undefined to accurately reflect that it can be either an array of Perspective
objects or undefined.

In
`@frontend/packages/console-shared/src/hooks/__tests__/usePerspectives.spec.ts`:
- Line 10: The type annotation for the variable mockOverridePerspectives is
declared as Perspective[] but the tests assign undefined to it in multiple
places, causing a type mismatch. Update the type declaration of
mockOverridePerspectives to be Perspective[] | undefined to correctly reflect
that it can hold either an array of Perspective objects or an undefined value.

In
`@frontend/packages/console-shared/src/hooks/__tests__/usePinnedResources.spec.ts`:
- Line 18: The variable mockOverridePerspectives is currently typed as
Perspective[] but should be typed as Perspective[] | undefined to accurately
reflect that it can be assigned undefined (as shown on line 77 and matching the
behavior of the actual overridePerspectives export). Update the type annotation
of mockOverridePerspectives from Perspective[] to Perspective[] | undefined.

In `@frontend/packages/console-shared/src/utils/override-perspectives.ts`:
- Around line 36-53: The function getOverridePerspectives declares a return type
of Perspective[] but its control flow shows it can return undefined in two
scenarios: when window.SERVER_FLAGS.perspectives is not set and when the
try-catch block fails to parse the perspectives. Update the return type
annotation of the getOverridePerspectives function from Perspective[] to
Perspective[] | undefined to accurately reflect the actual return possibilities
and align the TypeScript signature with the JSDoc documentation.
- Line 1: In the import statement at the top of override-perspectives.ts, change
the import source for AccessReviewResourceAttributes from the package root
import `@console/dynamic-plugin-sdk` to the direct file path
`@console/dynamic-plugin-sdk/src/extensions/console-types`. This is a direct
modification to the single import line that imports the
AccessReviewResourceAttributes type, replacing the short import path with the
full file path to the concrete module.

---

Nitpick comments:
In
`@frontend/packages/console-app/src/components/detect-context/PerspectiveConfiguration.tsx`:
- Line 17: The import statement for the Perspective type in
PerspectiveConfiguration.tsx is importing from the root
`@console/dynamic-plugin-sdk/src` path. Replace this with a direct module file
path instead of the `src` root directory. Determine the specific file that
exports the Perspective type and update the import statement to reference that
concrete module path directly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1fe580db-b85b-4ce5-bdde-8450f7a379a9

📥 Commits

Reviewing files that changed from the base of the PR and between 9ca7d94 and f1298a6.

📒 Files selected for processing (13)
  • frontend/@types/console/window.d.ts
  • frontend/packages/console-app/src/actions/providers/perspective-state-provider.ts
  • frontend/packages/console-app/src/components/detect-context/PerspectiveConfiguration.tsx
  • frontend/packages/console-app/src/components/detect-context/__tests__/PerspectiveDetector.spec.tsx
  • frontend/packages/console-app/src/components/nav/NavHeader.tsx
  • frontend/packages/console-app/src/components/nav/__tests__/NavHeader.spec.tsx
  • frontend/packages/console-shared/src/hooks/__tests__/usePerspectives.spec.ts
  • frontend/packages/console-shared/src/hooks/__tests__/usePinnedResources.spec.ts
  • frontend/packages/console-shared/src/hooks/usePerspectives.ts
  • frontend/packages/console-shared/src/hooks/usePinnedResources.ts
  • frontend/packages/console-shared/src/utils/override-perspectives.ts
  • frontend/packages/dev-console/src/components/catalog/PinnedResourcesConfiguration.tsx
  • pkg/server/server.go
✅ Files skipped from review due to trivial changes (1)
  • frontend/@types/console/window.d.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • pkg/server/server.go
  • frontend/packages/console-app/src/actions/providers/perspective-state-provider.ts
  • frontend/packages/console-shared/src/hooks/usePinnedResources.ts
  • frontend/packages/console-app/src/components/nav/NavHeader.tsx

import NavHeader from '../NavHeader';
import { renderWithPerspective } from './navTestUtils';

let mockOverridePerspectives: Perspective[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the type of mockOverridePerspectives to allow undefined.

The variable is typed as Perspective[] but should be Perspective[] | undefined to match the actual return type of overridePerspectives. The afterEach blocks at lines 110 and 130 explicitly reset this variable to undefined.

🔧 Proposed fix
-let mockOverridePerspectives: Perspective[];
+let mockOverridePerspectives: Perspective[] | undefined;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let mockOverridePerspectives: Perspective[];
let mockOverridePerspectives: Perspective[] | undefined;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/console-app/src/components/nav/__tests__/NavHeader.spec.tsx`
at line 9, The variable mockOverridePerspectives is declared with type
Perspective[] but is reset to undefined in the afterEach cleanup blocks, so the
type declaration does not match the actual possible values. Update the type
annotation of mockOverridePerspectives from Perspective[] to Perspective[] |
undefined to accurately reflect that it can be either an array of Perspective
objects or undefined.


const useExtensionsMock = useExtensions as jest.Mock;

let mockOverridePerspectives: Perspective[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the type of mockOverridePerspectives to allow undefined.

The variable is typed as Perspective[] but tests explicitly assign undefined to it (lines 27, 58, 90). The type should be Perspective[] | undefined to match the actual return type of overridePerspectives.

🔧 Proposed fix
-let mockOverridePerspectives: Perspective[];
+let mockOverridePerspectives: Perspective[] | undefined;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/packages/console-shared/src/hooks/__tests__/usePerspectives.spec.ts`
at line 10, The type annotation for the variable mockOverridePerspectives is
declared as Perspective[] but the tests assign undefined to it in multiple
places, causing a type mismatch. Update the type declaration of
mockOverridePerspectives to be Perspective[] | undefined to correctly reflect
that it can hold either an array of Perspective objects or an undefined value.

const useModelFinderMock = useModelFinder as jest.Mock;
const setPinnedResourcesMock = jest.fn();

let mockOverridePerspectives: Perspective[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the type of mockOverridePerspectives to allow undefined.

The variable is typed as Perspective[] but should be Perspective[] | undefined. Line 77 explicitly assigns undefined to this variable, and the actual overridePerspectives export can return undefined when no overrides are configured.

🔧 Proposed fix
-let mockOverridePerspectives: Perspective[];
+let mockOverridePerspectives: Perspective[] | undefined;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let mockOverridePerspectives: Perspective[];
let mockOverridePerspectives: Perspective[] | undefined;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/console-shared/src/hooks/__tests__/usePinnedResources.spec.ts`
at line 18, The variable mockOverridePerspectives is currently typed as
Perspective[] but should be typed as Perspective[] | undefined to accurately
reflect that it can be assigned undefined (as shown on line 77 and matching the
behavior of the actual overridePerspectives export). Update the type annotation
of mockOverridePerspectives from Perspective[] to Perspective[] | undefined.

@@ -0,0 +1,56 @@
import type { AccessReviewResourceAttributes } from '@console/dynamic-plugin-sdk';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find the concrete export location for AccessReviewResourceAttributes
rg -n "export (type|interface) AccessReviewResourceAttributes" frontend/packages/console-dynamic-plugin-sdk/src

Repository: openshift/console

Length of output: 282


🏁 Script executed:

#!/bin/bash
# Check if there's an index file at the SDK root that re-exports AccessReviewResourceAttributes
fd -t f "^index\.(ts|js)$" frontend/packages/console-dynamic-plugin-sdk/src

# Check the main SDK index for re-exports
head -50 frontend/packages/console-dynamic-plugin-sdk/src/index.ts | grep -E "(export|AccessReviewResourceAttributes)"

# Verify the console-types.ts file location and confirm the export
cat -n frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts | sed -n '60,70p'

Repository: openshift/console

Length of output: 1376


🏁 Script executed:

#!/bin/bash
# Check the extensions/index.ts to see if it re-exports AccessReviewResourceAttributes
cat frontend/packages/console-dynamic-plugin-sdk/src/extensions/index.ts | grep -E "(AccessReviewResourceAttributes|export.*from)"

# Also verify the import in the file under review
cat -n frontend/packages/console-shared/src/utils/override-perspectives.ts | head -5

Repository: openshift/console

Length of output: 1516


🏁 Script executed:

#!/bin/bash
# Check how other files import from console-dynamic-plugin-sdk to see the pattern
rg -n "import.*AccessReviewResourceAttributes" frontend/packages/console-shared/src --type ts

# Also check what import patterns are used in the console codebase for SDK imports
rg "import.*from '`@console/dynamic-plugin-sdk/src`" frontend/packages/console-shared/src --type ts -A 0 | head -10

Repository: openshift/console

Length of output: 1800


Use a direct SDK file import instead of a package-root import.

Import AccessReviewResourceAttributes from the concrete file path @console/dynamic-plugin-sdk/src/extensions/console-types instead of the package root. This avoids potential circular dependencies and aligns with the codebase pattern already established in other files within console-shared.

Change:

import type { AccessReviewResourceAttributes } from '`@console/dynamic-plugin-sdk`';

To:

import type { AccessReviewResourceAttributes } from '`@console/dynamic-plugin-sdk/src/extensions/console-types`';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/packages/console-shared/src/utils/override-perspectives.ts` at line
1, In the import statement at the top of override-perspectives.ts, change the
import source for AccessReviewResourceAttributes from the package root import
`@console/dynamic-plugin-sdk` to the direct file path
`@console/dynamic-plugin-sdk/src/extensions/console-types`. This is a direct
modification to the single import line that imports the
AccessReviewResourceAttributes type, replacing the short import path with the
full file path to the concrete module.

Source: Coding guidelines

Comment thread frontend/packages/console-shared/src/utils/override-perspectives.ts
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@vojtechszocs vojtechszocs force-pushed the fix-single-perspective branch from f1298a6 to c73c57a Compare June 24, 2026 17:50
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/packages/console-app/src/components/nav/NavHeader.tsx`:
- Around line 74-80: The NavHeader fallback currently returns null name/icon
when usePerspectives() has no available entries, which makes the header blank.
Update the fallback logic in NavHeader’s useMemo so that if no matching
perspective is found and perspectiveExtensions[0] is missing, it still returns
the explicit built-in label “Core platform” instead of { icon: null, name: null
}, while preserving the existing search for the active perspective.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: dbf0eb16-d071-4e00-a4ea-15955d3c4a55

📥 Commits

Reviewing files that changed from the base of the PR and between f1298a6 and c73c57a.

📒 Files selected for processing (13)
  • frontend/@types/console/window.d.ts
  • frontend/packages/console-app/src/actions/providers/perspective-state-provider.ts
  • frontend/packages/console-app/src/components/detect-context/PerspectiveConfiguration.tsx
  • frontend/packages/console-app/src/components/detect-context/__tests__/PerspectiveDetector.spec.tsx
  • frontend/packages/console-app/src/components/nav/NavHeader.tsx
  • frontend/packages/console-app/src/components/nav/__tests__/NavHeader.spec.tsx
  • frontend/packages/console-shared/src/hooks/__tests__/usePerspectives.spec.ts
  • frontend/packages/console-shared/src/hooks/__tests__/usePinnedResources.spec.ts
  • frontend/packages/console-shared/src/hooks/usePerspectives.ts
  • frontend/packages/console-shared/src/hooks/usePinnedResources.ts
  • frontend/packages/console-shared/src/utils/override-perspectives.ts
  • frontend/packages/dev-console/src/components/catalog/PinnedResourcesConfiguration.tsx
  • pkg/server/server.go
✅ Files skipped from review due to trivial changes (1)
  • frontend/@types/console/window.d.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • pkg/server/server.go
  • frontend/packages/console-app/src/components/nav/tests/NavHeader.spec.tsx
  • frontend/packages/console-shared/src/utils/override-perspectives.ts
  • frontend/packages/console-app/src/components/detect-context/tests/PerspectiveDetector.spec.tsx
  • frontend/packages/console-shared/src/hooks/usePinnedResources.ts
  • frontend/packages/console-shared/src/hooks/tests/usePerspectives.spec.ts
  • frontend/packages/dev-console/src/components/catalog/PinnedResourcesConfiguration.tsx
  • frontend/packages/console-app/src/actions/providers/perspective-state-provider.ts
  • frontend/packages/console-app/src/components/detect-context/PerspectiveConfiguration.tsx
  • frontend/packages/console-shared/src/hooks/usePerspectives.ts
  • frontend/packages/console-shared/src/hooks/tests/usePinnedResources.spec.ts

Comment thread frontend/packages/console-app/src/components/nav/NavHeader.tsx Outdated
@vojtechszocs vojtechszocs force-pushed the fix-single-perspective branch from c73c57a to 9c3a425 Compare June 24, 2026 18:10
@vojtechszocs vojtechszocs force-pushed the fix-single-perspective branch from 9c3a425 to 1c1a862 Compare June 24, 2026 20:22
@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@vojtechszocs: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-playwright 1c1a862 link false /test e2e-playwright
ci/prow/e2e-gcp-console 1c1a862 link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

component/backend Related to backend component/core Related to console core functionality component/dev-console Related to dev-console component/shared Related to console-shared

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant