Skip to content

CONSOLE-5015: Refactor pinned nav to react-drag-drop#16146

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
logonoff:CONSOLE-5015-pinned-resource
Mar 28, 2026
Merged

CONSOLE-5015: Refactor pinned nav to react-drag-drop#16146
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
logonoff:CONSOLE-5015-pinned-resource

Conversation

@logonoff
Copy link
Copy Markdown
Member

@logonoff logonoff commented Mar 13, 2026

After

Screencast.From.2026-03-13.16-04-45.mp4

Summary by CodeRabbit

  • New Features

    • Improved drag-and-drop functionality for reordering pinned resources in the navigation sidebar.
  • Style

    • Updated visual styling for pinned resource items with improved spacing and layout.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 13, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Mar 13, 2026

@logonoff: This pull request references CONSOLE-5015 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

After

Screencast.From.2026-03-13.16-04-45.mp4

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 openshift-eng/jira-lifecycle-plugin repository.

@logonoff
Copy link
Copy Markdown
Member Author

/label px-approved
/label docs-approved

@openshift-ci openshift-ci Bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Mar 13, 2026
@openshift-ci openshift-ci Bot requested review from sg00dwin and spadgett March 13, 2026 20:05
@openshift-ci openshift-ci Bot added component/core Related to console core functionality approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 13, 2026
@logonoff logonoff force-pushed the CONSOLE-5015-pinned-resource branch from 96ee051 to bd4980b Compare March 13, 2026 20:07
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 13, 2026

📝 Walkthrough

Walkthrough

This pull request refactors the pinned resources drag-and-drop functionality in the perspective navigation component. The @patternfly/react-drag-drop dependency is updated from version ~6.4.0 to ~6.5.0-prerelease.38. The implementation shifts from a drag-drop context wrapper to an inline DragDropSort component. CSS changes remove drag state styles and add a new .co-pinned-resource-item class. PinnedResource component props are simplified to remove draggable, onReorder, and onDrag parameters, eliminating internal drag state management. Test assertions are updated to reflect renamed button labels.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: refactoring the pinned navigation component to use react-drag-drop instead of the previous approach.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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

Comment thread frontend/package.json
"@patternfly/react-core": "~6.4.0",
"@patternfly/react-data-view": "~6.3.0",
"@patternfly/react-drag-drop": "~6.4.0",
"@patternfly/react-drag-drop": "~6.5.0-prerelease.38",
Copy link
Copy Markdown
Member Author

@logonoff logonoff Mar 13, 2026

Choose a reason for hiding this comment

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

Needed to pick up patternfly/patternfly-react#12217 / patternfly/patternfly-react#12240. no impact on plugins as this is not a shared module and does not provide CSS

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Mar 13, 2026

@logonoff: This pull request references CONSOLE-5015 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

After

Screencast.From.2026-03-13.16-04-45.mp4

Summary by CodeRabbit

  • New Features

  • Improved drag-and-drop functionality for reordering pinned resources in the navigation sidebar.

  • Style

  • Updated visual styling for pinned resource items with improved spacing and layout.

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@frontend/packages/console-app/src/components/nav/PinnedResource.tsx`:
- Line 50: The component PinnedResource uses the optional prop navResources
directly with .filter(), which can throw if navResources is undefined; update
the PinnedResource component to guard navResources before calling .filter() by
either defaulting navResources to an empty array in the function signature or
using a safe access (e.g., (navResources || []).filter(...) or
navResources?.filter(...) with a fallback) so all uses in the component
(including where navResources is iterated/filtered) cannot cause a runtime
crash.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ded4e51a-762c-4927-97f0-f5de30d0c000

📥 Commits

Reviewing files that changed from the base of the PR and between 9f13e88 and bd4980b.

⛔ Files ignored due to path filters (1)
  • frontend/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • frontend/package.json
  • frontend/packages/console-app/src/components/nav/PerspectiveNav.scss
  • frontend/packages/console-app/src/components/nav/PerspectiveNav.tsx
  • frontend/packages/console-app/src/components/nav/PinnedResource.tsx
  • frontend/packages/console-app/src/components/nav/__tests__/PerspectiveNav.spec.tsx

Comment thread frontend/packages/console-app/src/components/nav/PinnedResource.tsx
@logonoff logonoff force-pushed the CONSOLE-5015-pinned-resource branch 2 times, most recently from 1efbbaf to 349557a Compare March 13, 2026 20:17
@logonoff logonoff changed the title CONSOLE-5015: Refactor pinned nav to react-drag-drop [wip] CONSOLE-5015: Refactor pinned nav to react-drag-drop Mar 14, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 14, 2026
@logonoff logonoff force-pushed the CONSOLE-5015-pinned-resource branch from 349557a to a0b30ff Compare March 15, 2026 02:23
@openshift-ci openshift-ci Bot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Mar 15, 2026
logonoff and others added 2 commits March 18, 2026 20:33
Replace NavGroup (which renders a <ul role="list">) with a plain
<section> to prevent dnd-kit's [role=status] and DragButton
[role=button] elements from being invalid children of the list.

Add a listItem prop to NavItemResource so pinned resources render
as <div> instead of <li>, avoiding the listitem violation where
<li> elements were nested inside Draggable <div> wrappers rather
than directly inside a <ul>.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@logonoff logonoff force-pushed the CONSOLE-5015-pinned-resource branch from a0b30ff to 7e8a055 Compare March 19, 2026 00:51
@logonoff logonoff changed the title [wip] CONSOLE-5015: Refactor pinned nav to react-drag-drop CONSOLE-5015: Refactor pinned nav to react-drag-drop Mar 19, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 19, 2026
@logonoff
Copy link
Copy Markdown
Member Author

/assign @yapei

@yapei
Copy link
Copy Markdown
Contributor

yapei commented Mar 23, 2026

performed following regression testing

  • add resource to navigation as pinned resources
  • remove pinned resources from nav
  • drag and drop to reorder pinned items
  • Remove from navigation button is always visible
  • the drag button is visible when there are more than 1 pinned resources
  • when resource name is longer we trimmed the name and show ...
  • verified on Firefox, Chrome and Safari
Screenshot 2026-03-23 at 1 52 57 PM

/verified by @yapei

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 23, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@yapei: This PR has been marked as verified by @yapei.

Details

In response to this:

performed following regression testing

  • add resource to navigation as pinned resources
  • remove pinned resources from nav
  • drag and drop to reorder pinned items
  • Remove from navigation button is always visible
  • the drag button is visible when there are more than 1 pinned resources
  • when resource name is longer we trimmed the name and show ...
  • verified on Firefox, Chrome and Safari
Screenshot 2026-03-23 at 1 52 57 PM

/verified by @yapei

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown
Member

@vikram-raj vikram-raj left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 23, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 23, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logonoff, vikram-raj

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

The pull request process is described 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

@logonoff
Copy link
Copy Markdown
Member Author

/test all

1 similar comment
@logonoff
Copy link
Copy Markdown
Member Author

/test all

@yapei
Copy link
Copy Markdown
Contributor

yapei commented Mar 24, 2026

/retest-required

@logonoff
Copy link
Copy Markdown
Member Author

/test all

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 1425db6 and 2 for PR HEAD 7e8a055 in total

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD f2cf862 and 1 for PR HEAD 7e8a055 in total

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 26, 2026

@logonoff: all tests passed!

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.

@openshift-merge-bot openshift-merge-bot Bot merged commit 8703624 into openshift:main Mar 28, 2026
8 checks passed
@logonoff logonoff deleted the CONSOLE-5015-pinned-resource branch March 28, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants