Skip to content

Conversation

@cajieh
Copy link
Contributor

@cajieh cajieh commented Jan 19, 2026

Summary

Removes the withDashboardResources Higher-Order Component in favor of targeted React hooks, modernizing 17 components across 10 files as part of the "Remove and Update Firehose" epic.

Problem

The withDashboardResources HOC injected all capabilities into every component regardless of actual needs:

  • Performance: Unnecessary re-renders on unrelated data changes
  • Clarity: Unclear dependencies per component
  • Technical debt: Class-based HOC + Redux + Firehose coupling
  • Type safety: Complex HOC intersection types

Solution

Replace monolithic HOC with targeted hooks based on actual usage:

Screenshot 2026-01-22 at 1 56 02 PM

Key Change: useDynamicDashboardResources

Bridges declarative hooks with imperative plugin requirements:
// Enables runtime resource watching without violating Rules of Hooks const { watchResource, stopWatchResource, results } = useDynamicDashboardResources();

  // Plugin extensions can register 0-N resources at runtime

  extensions.forEach((ext, i) => {
    watchResource(key(i), ext.properties.k8sResource);
  });

Benefits

  • Performance: Components only watch what they need
  • Code quality: -271 lines, clearer intent
  • Type safety: Specific return types per hook
  • Modern React: Hooks over HOCs, functional components

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

openshift-ci-robot commented Jan 19, 2026

@cajieh: This pull request references CONSOLE-5031 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:

NOT READY FOR READY

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.

@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

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.

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


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

@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 Jan 19, 2026
@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Jan 19, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cajieh

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

@openshift-ci openshift-ci bot added component/dashboard Related to dashboard approved Indicates a PR has been approved by an approver from all required OWNERS files. component/metal3 Related to metal3-plugin component/shared Related to console-shared labels Jan 19, 2026
@cajieh cajieh force-pushed the refactor-withDashboard-resources-component branch 2 times, most recently from 17a6b03 to d56e111 Compare January 19, 2026 21:07
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 19, 2026
@cajieh cajieh force-pushed the refactor-withDashboard-resources-component branch from d56e111 to faafcc4 Compare January 19, 2026 21:16
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 19, 2026
@cajieh cajieh force-pushed the refactor-withDashboard-resources-component branch from faafcc4 to 2fc0cfb Compare January 19, 2026 21:18
<RecentEvent />
<RecentEvents />
</ActivityBody>
<RecentEventFooter />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Redundant!

@cajieh cajieh force-pushed the refactor-withDashboard-resources-component branch from 2fc0cfb to d11eec1 Compare January 19, 2026 21:33
<OngoingActivity projectName={projectName} />
<RecentEvent projectName={projectName} viewEvents={viewEvents} />
</ActivityBody>
<RecentEventFooter projectName={projectName} viewEvents={viewEvents} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Redundant after the refactoring! The footer functionality is preserved with the same logic:
const shouldShowFooter = events?.loaded && events?.data && events.data.length > 50;

@cajieh cajieh force-pushed the refactor-withDashboard-resources-component branch 4 times, most recently from 46dbf18 to 0fa4c50 Compare January 21, 2026 14:18
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 21, 2026

@cajieh: This pull request references CONSOLE-5031 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:

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.

@cajieh cajieh force-pushed the refactor-withDashboard-resources-component branch from 0fa4c50 to ff8cacf Compare January 21, 2026 15:07
@cajieh cajieh force-pushed the refactor-withDashboard-resources-component branch from ff8cacf to 0538151 Compare January 21, 2026 15:39
@cajieh
Copy link
Contributor Author

cajieh commented Jan 22, 2026

/retest

@cajieh cajieh changed the title [WIP] CONSOLE-5031: Refactor withDashboardResources in with-dashboard-resources.tsx into … CONSOLE-5029: Refactor withDashboardResources in with-dashboard-resources.tsx into … Jan 22, 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 Jan 22, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 22, 2026

@cajieh: This pull request references CONSOLE-5029 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 spike to target the "4.22.0" version, but no target version was set.

Details

In response to this:

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 22, 2026

@cajieh: This pull request references CONSOLE-5029 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 spike to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Removes the withDashboardResources Higher-Order Component in favor of targeted React hooks, modernizing 17 components across 10 files as part of the "Remove and Update Firehose" epic.

Problem

The withDashboardResources HOC injected all capabilities into every component regardless of actual needs:

Performance: Unnecessary re-renders on unrelated data changes
Clarity: Unclear dependencies per component
Technical debt: Class-based HOC + Redux + Firehose coupling
Type safety: Complex HOC intersection types

Solution

Replace monolithic HOC with targeted hooks based on actual usage:

Screenshot 2026-01-22 at 1 56 02 PM

Key Change: useDynamicDashboardResources

Bridges declarative hooks with imperative plugin requirements:
// Enables runtime resource watching without violating Rules of Hooks
const { watchResource, stopWatchResource, results } = useDynamicDashboardResources();

// Plugin extensions can register 0-N resources at runtime

 extensions.forEach((ext, i) => {
   watchResource(key(i), ext.properties.k8sResource);
 });

Benefits

Performance: Components only watch what they need
Code quality: -271 lines, clearer intent
Type safety: Specific return types per hook
Modern React: Hooks over HOCs, functional components

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 22, 2026

@cajieh: This pull request references CONSOLE-5029 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 spike to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Removes the withDashboardResources Higher-Order Component in favor of targeted React hooks, modernizing 17 components across 10 files as part of the "Remove and Update Firehose" epic.

Problem

The withDashboardResources HOC injected all capabilities into every component regardless of actual needs:

  • Performance: Unnecessary re-renders on unrelated data changes
  • Clarity: Unclear dependencies per component
  • Technical debt: Class-based HOC + Redux + Firehose coupling
  • Type safety: Complex HOC intersection types

Solution

Replace monolithic HOC with targeted hooks based on actual usage:

Screenshot 2026-01-22 at 1 56 02 PM

Key Change: useDynamicDashboardResources

Bridges declarative hooks with imperative plugin requirements:
// Enables runtime resource watching without violating Rules of Hooks const { watchResource, stopWatchResource, results } = useDynamicDashboardResources();

 // Plugin extensions can register 0-N resources at runtime

 extensions.forEach((ext, i) => {
   watchResource(key(i), ext.properties.k8sResource);
 });

Benefits

  • Performance: Components only watch what they need
  • Code quality: -271 lines, clearer intent
  • Type safety: Specific return types per hook
  • Modern React: Hooks over HOCs, functional components

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 22, 2026

@cajieh: This pull request references CONSOLE-5029 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 spike to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Removes the withDashboardResources Higher-Order Component in favor of targeted React hooks, modernizing 17 components across 10 files as part of the "Remove and Update Firehose" epic.

Problem

The withDashboardResources HOC injected all capabilities into every component regardless of actual needs:

  • Performance: Unnecessary re-renders on unrelated data changes
  • Clarity: Unclear dependencies per component
  • Technical debt: Class-based HOC + Redux + Firehose coupling
  • Type safety: Complex HOC intersection types

Solution

Replace monolithic HOC with targeted hooks based on actual usage:

Screenshot 2026-01-22 at 1 56 02 PM

Key Change: useDynamicDashboardResources

Bridges declarative hooks with imperative plugin requirements:
// Enables runtime resource watching without violating Rules of Hooks const { watchResource, stopWatchResource, results } = useDynamicDashboardResources();

 // Plugin extensions can register 0-N resources at runtime

 extensions.forEach((ext, i) => {
   watchResource(key(i), ext.properties.k8sResource);
 });

Benefits

  • Performance: Components only watch what they need
  • Code quality: -271 lines, clearer intent
  • Type safety: Specific return types per hook
  • Modern React: Hooks over HOCs, functional components

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 22, 2026

@cajieh: 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.

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 component/dashboard Related to dashboard component/metal3 Related to metal3-plugin component/shared Related to console-shared jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants