Skip to content

CONSOLE-5102: Migrate ExportApplicationModal and rollback-modal to useOverlay#16063

Open
sg00dwin wants to merge 5 commits intoopenshift:mainfrom
sg00dwin:CONSOLE-5102-additional-modal-migration
Open

CONSOLE-5102: Migrate ExportApplicationModal and rollback-modal to useOverlay#16063
sg00dwin wants to merge 5 commits intoopenshift:mainfrom
sg00dwin:CONSOLE-5102-additional-modal-migration

Conversation

@sg00dwin
Copy link
Member

@sg00dwin sg00dwin commented Feb 25, 2026

Summary

Migrates the remaining modals from the legacy createModalLauncher pattern to the modern OverlayComponent pattern. All modals follow the *ModalOverlay naming convention to clearly distinguish from the deprecated ModalProvider pattern.

Changes

Modals Migrated (2 total)

  1. ExportApplicationModal (packages/topology/src/components/export-app/ExportApplicationModal.tsx)

    • Wrapped with ExportApplicationModalOverlay: OverlayComponent
    • Lazy export: LazyExportApplicationModalOverlay
    • Removed createModalLauncher usage and handleExportApplication helper
    • Passes launchModal through AddCardItem callback props to support plugin $codeRef code path
  2. RollbackModal (public/components/modals/rollback-modal.tsx)

    • Converted from .jsx to .tsx with proper TypeScript types
    • Wrapped with RollbackModalOverlay: OverlayComponent
    • Lazy export: LazyRollbackModalOverlay
    • Removed createModalLauncher usage

Updated Consumers

  • ExportApplication.tsx — Uses useOverlay() with LazyExportApplicationModalOverlay
  • export-application.ts — Receives launchModal via callback props from AddCardItem
  • AddCardItem.tsx — Added useOverlay() and passes launchModal in callback props alongside namespace and toast
  • useReplicaSetActions.ts — Uses useOverlay() with LazyRollbackModalOverlay
  • useReplicationControllerActions.ts — Uses useOverlay() with LazyRollbackModalOverlay
  • modals/index.ts — Updated with LazyRollbackModalOverlay lazy export

Migration Pattern

Each migration follows the consistent pattern established in #15932, #15939, and #15940:

  • Export modal overlay as OverlayComponent using the *ModalOverlay naming convention
  • Wrap modal component with ModalWrapper and connect to overlay lifecycle (closeOverlay)
  • Lazy-load the overlay using React.lazy() with webpack chunk names for code splitting
  • Update consuming components to use useOverlay hook with launchModal()
  • Ensure proper prop spreading: {...props} before explicit cancel and close props
  • Added launchModal to all hook dependency arrays

Naming Convention

All modal overlay components and exports follow the *ModalOverlay naming pattern:

  • Component exports: ExportApplicationModalOverlay, RollbackModalOverlay
  • Lazy exports: LazyExportApplicationModalOverlay, LazyRollbackModalOverlay

Test Plan

  • Export Application modal opens from topology toolbar (requires GitOps Primer operator)
  • Export Application modal opens from Add page card callback
  • Rollback modal opens from ReplicaSet kebab menu action
  • Rollback modal opens from ReplicationController kebab menu action
  • Rollback submission works for both Deployment and DeploymentConfig resources
  • No console errors or warnings related to modals
  • Lazy loading works correctly (check Network tab for separate chunks)
  • yarn lint passes
  • yarn test passes

Related

Assisted by Claude Code

Summary by CodeRabbit

  • Refactor
    • Updated modal system to use an overlay-based component architecture with lazy loading for rollback and export dialogs, improving code organization and performance.

  Convert rollback-modal.jsx to TypeScript and replace createModalLauncher
  with RollbackModalOverlay using ModalWrapper. Update consumer hooks
  (useReplicaSetActions, useReplicationControllerActions) to use useOverlay
  with LazyRollbackModalOverlay.

Assisted by Claude Code
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 25, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 25, 2026

@sg00dwin: This pull request references CONSOLE-5102 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 sub-task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Migrates the remaining non-OLM modals from the legacy createModalLauncher pattern to the modern OverlayComponent pattern. All modals follow the *ModalOverlay naming convention to clearly distinguish from the deprecated ModalProvider pattern.

Changes

Modals Migrated (2 total)

  1. ExportApplicationModal (packages/topology/src/components/export-app/ExportApplicationModal.tsx)
  • Wrapped with ExportApplicationModalOverlay: OverlayComponent
  • Lazy export: LazyExportApplicationModalOverlay
  • Removed createModalLauncher usage and handleExportApplication helper
  • Passes launchModal through AddCardItem callback props to support plugin $codeRef code path
  1. RollbackModal (public/components/modals/rollback-modal.tsx)
  • Converted from .jsx to .tsx with proper TypeScript types
  • Wrapped with RollbackModalOverlay: OverlayComponent
  • Lazy export: LazyRollbackModalOverlay
  • Removed createModalLauncher usage

Updated Consumers

  • ExportApplication.tsx — Uses useOverlay() with LazyExportApplicationModalOverlay
  • export-application.ts — Receives launchModal via callback props from AddCardItem
  • AddCardItem.tsx — Added useOverlay() and passes launchModal in callback props alongside namespace and toast
  • useReplicaSetActions.ts — Uses useOverlay() with LazyRollbackModalOverlay
  • useReplicationControllerActions.ts — Uses useOverlay() with LazyRollbackModalOverlay
  • modals/index.ts — Updated with LazyRollbackModalOverlay lazy export

Migration Pattern

Each migration follows the consistent pattern established in #15932, #15939, and #15940:

  • Export modal overlay as OverlayComponent using the *ModalOverlay naming convention
  • Wrap modal component with ModalWrapper and connect to overlay lifecycle (closeOverlay)
  • Lazy-load the overlay using React.lazy() with webpack chunk names for code splitting
  • Update consuming components to use useOverlay hook with launchModal()
  • Ensure proper prop spreading: {...props} before explicit cancel and close props
  • Added launchModal to all hook dependency arrays

Naming Convention

All modal overlay components and exports follow the *ModalOverlay naming pattern:

  • Component exports: ExportApplicationModalOverlay, RollbackModalOverlay
  • Lazy exports: LazyExportApplicationModalOverlay, LazyRollbackModalOverlay

Test Plan

  • Export Application modal opens from topology toolbar (requires GitOps Primer operator)
  • Export Application modal opens from Add page card callback
  • Rollback modal opens from ReplicaSet kebab menu action
  • Rollback modal opens from ReplicationController kebab menu action
  • Rollback submission works for both Deployment and DeploymentConfig resources
  • No console errors or warnings related to modals
  • Lazy loading works correctly (check Network tab for separate chunks)
  • yarn lint passes
  • yarn test passes

Related

Assisted by Claude Code

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 Feb 25, 2026

@sg00dwin: This pull request references CONSOLE-5102 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 sub-task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Migrates the remaining modals from the legacy createModalLauncher pattern to the modern OverlayComponent pattern. All modals follow the *ModalOverlay naming convention to clearly distinguish from the deprecated ModalProvider pattern.

Changes

Modals Migrated (2 total)

  1. ExportApplicationModal (packages/topology/src/components/export-app/ExportApplicationModal.tsx)
  • Wrapped with ExportApplicationModalOverlay: OverlayComponent
  • Lazy export: LazyExportApplicationModalOverlay
  • Removed createModalLauncher usage and handleExportApplication helper
  • Passes launchModal through AddCardItem callback props to support plugin $codeRef code path
  1. RollbackModal (public/components/modals/rollback-modal.tsx)
  • Converted from .jsx to .tsx with proper TypeScript types
  • Wrapped with RollbackModalOverlay: OverlayComponent
  • Lazy export: LazyRollbackModalOverlay
  • Removed createModalLauncher usage

Updated Consumers

  • ExportApplication.tsx — Uses useOverlay() with LazyExportApplicationModalOverlay
  • export-application.ts — Receives launchModal via callback props from AddCardItem
  • AddCardItem.tsx — Added useOverlay() and passes launchModal in callback props alongside namespace and toast
  • useReplicaSetActions.ts — Uses useOverlay() with LazyRollbackModalOverlay
  • useReplicationControllerActions.ts — Uses useOverlay() with LazyRollbackModalOverlay
  • modals/index.ts — Updated with LazyRollbackModalOverlay lazy export

Migration Pattern

Each migration follows the consistent pattern established in #15932, #15939, and #15940:

  • Export modal overlay as OverlayComponent using the *ModalOverlay naming convention
  • Wrap modal component with ModalWrapper and connect to overlay lifecycle (closeOverlay)
  • Lazy-load the overlay using React.lazy() with webpack chunk names for code splitting
  • Update consuming components to use useOverlay hook with launchModal()
  • Ensure proper prop spreading: {...props} before explicit cancel and close props
  • Added launchModal to all hook dependency arrays

Naming Convention

All modal overlay components and exports follow the *ModalOverlay naming pattern:

  • Component exports: ExportApplicationModalOverlay, RollbackModalOverlay
  • Lazy exports: LazyExportApplicationModalOverlay, LazyRollbackModalOverlay

Test Plan

  • Export Application modal opens from topology toolbar (requires GitOps Primer operator)
  • Export Application modal opens from Add page card callback
  • Rollback modal opens from ReplicaSet kebab menu action
  • Rollback modal opens from ReplicationController kebab menu action
  • Rollback submission works for both Deployment and DeploymentConfig resources
  • No console errors or warnings related to modals
  • Lazy loading works correctly (check Network tab for separate chunks)
  • yarn lint passes
  • yarn test passes

Related

Assisted by Claude Code

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 openshift-ci bot requested review from TheRealJon and cajieh February 25, 2026 19:36
@openshift-ci openshift-ci bot added component/core Related to console core functionality component/dev-console Related to dev-console component/topology Related to topology labels Feb 25, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 25, 2026

@sg00dwin: This pull request references CONSOLE-5102 which is a valid jira issue.

Details

In response to this:

Summary

Migrates the remaining modals from the legacy createModalLauncher pattern to the modern OverlayComponent pattern. All modals follow the *ModalOverlay naming convention to clearly distinguish from the deprecated ModalProvider pattern.

Changes

Modals Migrated (2 total)

  1. ExportApplicationModal (packages/topology/src/components/export-app/ExportApplicationModal.tsx)
  • Wrapped with ExportApplicationModalOverlay: OverlayComponent
  • Lazy export: LazyExportApplicationModalOverlay
  • Removed createModalLauncher usage and handleExportApplication helper
  • Passes launchModal through AddCardItem callback props to support plugin $codeRef code path
  1. RollbackModal (public/components/modals/rollback-modal.tsx)
  • Converted from .jsx to .tsx with proper TypeScript types
  • Wrapped with RollbackModalOverlay: OverlayComponent
  • Lazy export: LazyRollbackModalOverlay
  • Removed createModalLauncher usage

Updated Consumers

  • ExportApplication.tsx — Uses useOverlay() with LazyExportApplicationModalOverlay
  • export-application.ts — Receives launchModal via callback props from AddCardItem
  • AddCardItem.tsx — Added useOverlay() and passes launchModal in callback props alongside namespace and toast
  • useReplicaSetActions.ts — Uses useOverlay() with LazyRollbackModalOverlay
  • useReplicationControllerActions.ts — Uses useOverlay() with LazyRollbackModalOverlay
  • modals/index.ts — Updated with LazyRollbackModalOverlay lazy export

Migration Pattern

Each migration follows the consistent pattern established in #15932, #15939, and #15940:

  • Export modal overlay as OverlayComponent using the *ModalOverlay naming convention
  • Wrap modal component with ModalWrapper and connect to overlay lifecycle (closeOverlay)
  • Lazy-load the overlay using React.lazy() with webpack chunk names for code splitting
  • Update consuming components to use useOverlay hook with launchModal()
  • Ensure proper prop spreading: {...props} before explicit cancel and close props
  • Added launchModal to all hook dependency arrays

Naming Convention

All modal overlay components and exports follow the *ModalOverlay naming pattern:

  • Component exports: ExportApplicationModalOverlay, RollbackModalOverlay
  • Lazy exports: LazyExportApplicationModalOverlay, LazyRollbackModalOverlay

Test Plan

  • Export Application modal opens from topology toolbar (requires GitOps Primer operator)
  • Export Application modal opens from Add page card callback
  • Rollback modal opens from ReplicaSet kebab menu action
  • Rollback modal opens from ReplicationController kebab menu action
  • Rollback submission works for both Deployment and DeploymentConfig resources
  • No console errors or warnings related to modals
  • Lazy loading works correctly (check Network tab for separate chunks)
  • yarn lint passes
  • yarn test passes

Related

Assisted by Claude Code

Summary by CodeRabbit

  • Refactor
  • Updated modal system to use an overlay-based component architecture with lazy loading for rollback and export dialogs, improving code organization and performance.

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
Contributor

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

This pull request refactors the modal invocation system across OpenShift Console from direct function-based launchers (via createModalLauncher) to an overlay-based component pattern using OverlayComponent. Action hooks in rollback and export flows are updated to accept a launchModal callback parameter and invoke lazy-loaded overlay components instead of direct modal calls. New public exports include LazyRollbackModalOverlay, LazyExportApplicationModalOverlay, and corresponding overlay wrapper components, with updated type signatures for action parameters. The refactoring standardizes modal mounting through overlay providers while maintaining existing modal behavior.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main objective: migrating two modal components (ExportApplicationModal and rollback-modal) from createModalLauncher to the useOverlay pattern.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

Copy link
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

🧹 Nitpick comments (1)
frontend/packages/dev-console/src/actions/export-application.ts (1)

12-28: Extract shared export-modal launch flow to a single helper.

This try/catch launch sequence duplicates the logic in frontend/packages/topology/src/components/export-app/ExportApplication.tsx (Line 34-Line 46). Consolidating it would reduce drift risk for future changes (props, telemetry, fallback behavior).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/packages/dev-console/src/actions/export-application.ts` around lines
12 - 28, The export modal launch try/catch logic is duplicated; extract it into
a shared helper (e.g., launchExportModal) that both exportApplicationAction and
the ExportApplication React component call: the helper should accept (name,
namespace, toast, launchModal) and internally call getExportResource(name,
namespace) in a try/catch, then invoke
launchModal(LazyExportApplicationModalOverlay, { name, namespace,
exportResource?, toast }) passing exportResource only on success; place the
helper in a common util/module reachable by frontend/packages/dev-console and
frontend/packages/topology and replace the duplicated blocks in
exportApplicationAction and ExportApplication.tsx to call this helper.
🤖 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/topology/src/components/export-app/ExportApplicationModal.tsx`:
- Around line 251-258: The LazyExportApplicationModalOverlay lazy export is
defined inside ExportApplicationModal.tsx which prevents proper code splitting;
move that lazy wrapper into a new module (e.g., ExportApplicationModal.lazy.ts)
that imports React.lazy and dynamically imports './ExportApplicationModal' then
returns { default: m.ExportApplicationModalOverlay }, remove the
LazyExportApplicationModalOverlay export from ExportApplicationModal.tsx, and
update all callers (e.g., imports in ExportApplication.tsx and
export-application.ts) to import LazyExportApplicationModalOverlay from the new
ExportApplicationModal.lazy.ts so ExportApplicationModal.tsx is only loaded when
the modal is actually needed.

---

Nitpick comments:
In `@frontend/packages/dev-console/src/actions/export-application.ts`:
- Around line 12-28: The export modal launch try/catch logic is duplicated;
extract it into a shared helper (e.g., launchExportModal) that both
exportApplicationAction and the ExportApplication React component call: the
helper should accept (name, namespace, toast, launchModal) and internally call
getExportResource(name, namespace) in a try/catch, then invoke
launchModal(LazyExportApplicationModalOverlay, { name, namespace,
exportResource?, toast }) passing exportResource only on success; place the
helper in a common util/module reachable by frontend/packages/dev-console and
frontend/packages/topology and replace the duplicated blocks in
exportApplicationAction and ExportApplication.tsx to call this helper.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 9459e3a and bd16ea4.

📒 Files selected for processing (8)
  • frontend/packages/console-app/src/actions/hooks/useReplicaSetActions.ts
  • frontend/packages/console-app/src/actions/hooks/useReplicationControllerActions.ts
  • frontend/packages/dev-console/src/actions/export-application.ts
  • frontend/packages/dev-console/src/components/add/AddCardItem.tsx
  • frontend/packages/topology/src/components/export-app/ExportApplication.tsx
  • frontend/packages/topology/src/components/export-app/ExportApplicationModal.tsx
  • frontend/public/components/modals/index.ts
  • frontend/public/components/modals/rollback-modal.tsx

Comment on lines 251 to 258
// Lazy-loaded OverlayComponent for Export Application Modal
export const LazyExportApplicationModalOverlay = lazy(() =>
import('./ExportApplicationModal' /* webpackChunkName: "export-application-modal" */).then(
(m) => ({
default: m.ExportApplicationModalOverlay,
}),
),
);
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 25, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Step 1: Verify the export definition and structure
echo "=== Checking LazyExportApplicationModalOverlay export in ExportApplicationModal.tsx ==="
rg -n "export const LazyExportApplicationModalOverlay" frontend/packages/topology/src/components/export-app/ExportApplicationModal.tsx

echo ""
echo "=== Checking all exports from ExportApplicationModal.tsx ==="
rg -n "^export" frontend/packages/topology/src/components/export-app/ExportApplicationModal.tsx | head -20

echo ""
echo "=== Checking imports of LazyExportApplicationModalOverlay (callers) ==="
rg -n "LazyExportApplicationModalOverlay" --include="*.ts" --include="*.tsx" frontend/packages/topology/ frontend/packages/dev-console/

Repository: openshift/console

Length of output: 1124


🏁 Script executed:

#!/bin/bash
# Fix the command with correct rg syntax
echo "=== Searching for imports of LazyExportApplicationModalOverlay ==="
rg -n "LazyExportApplicationModalOverlay" -t ts -t tsx

echo ""
echo "=== Checking how LazyExportApplicationModalOverlay is imported (checking for 'from' statements) ==="
rg -n "from.*ExportApplicationModal.*LazyExportApplicationModalOverlay|import.*LazyExportApplicationModalOverlay" -t ts -t tsx

echo ""
echo "=== Reading ExportApplicationModal.tsx to understand full module structure ==="
wc -l frontend/packages/topology/src/components/export-app/ExportApplicationModal.tsx

Repository: openshift/console

Length of output: 465


🏁 Script executed:

#!/bin/bash
# Broader search without type restrictions
echo "=== Searching for any usage of LazyExportApplicationModalOverlay in entire repo ==="
rg "LazyExportApplicationModalOverlay"

echo ""
echo "=== Reading ExportApplicationModal.tsx to understand structure ==="
cat -n frontend/packages/topology/src/components/export-app/ExportApplicationModal.tsx | tail -20

Repository: openshift/console

Length of output: 1974


🏁 Script executed:

#!/bin/bash
# Check what ExportApplication.tsx imports from ExportApplicationModal.tsx
echo "=== Checking imports in ExportApplication.tsx ==="
rg -A 2 "from.*ExportApplicationModal" frontend/packages/topology/src/components/export-app/ExportApplication.tsx

echo ""
echo "=== Checking imports in export-application.ts ==="
rg -A 2 "from.*ExportApplicationModal" frontend/packages/dev-console/src/actions/export-application.ts

echo ""
echo "=== Checking if any other exports from ExportApplicationModal.tsx are used ==="
rg "ExportApplicationModal\b|ExportApplicationModalProps\b" frontend/packages/topology/src/components/export-app/ExportApplication.tsx frontend/packages/dev-console/src/actions/export-application.ts

Repository: openshift/console

Length of output: 953


Move lazy export to separate module for effective code splitting.

LazyExportApplicationModalOverlay is the only export from ExportApplicationModal.tsx that callers import, yet the static import still pulls the entire 258-line module into the parent chunk. The dynamic import inside lazy() is ineffective here—webpack already has access to ExportApplicationModalOverlay through the static import. Separating the lazy export to a dedicated file (e.g., ExportApplicationModal.lazy.ts) would allow ExportApplicationModal.tsx to load only when the modal is actually needed, enabling the intended code split.

Suggested approach

Create ExportApplicationModal.lazy.ts:

import { lazy } from 'react';

export const LazyExportApplicationModalOverlay = lazy(() =>
  import('./ExportApplicationModal').then((m) => ({
    default: m.ExportApplicationModalOverlay,
  })),
);

Then update imports in ExportApplication.tsx and export-application.ts to reference the new file instead of ExportApplicationModal.tsx.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@frontend/packages/topology/src/components/export-app/ExportApplicationModal.tsx`
around lines 251 - 258, The LazyExportApplicationModalOverlay lazy export is
defined inside ExportApplicationModal.tsx which prevents proper code splitting;
move that lazy wrapper into a new module (e.g., ExportApplicationModal.lazy.ts)
that imports React.lazy and dynamically imports './ExportApplicationModal' then
returns { default: m.ExportApplicationModalOverlay }, remove the
LazyExportApplicationModalOverlay export from ExportApplicationModal.tsx, and
update all callers (e.g., imports in ExportApplication.tsx and
export-application.ts) to import LazyExportApplicationModalOverlay from the new
ExportApplicationModal.lazy.ts so ExportApplicationModal.tsx is only loaded when
the modal is actually needed.

Copy link
Member

Choose a reason for hiding this comment

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

Since we weren't lazy loading before, let's undo that to simplify the changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rhamilto, understood! Removing the lazy loading will keep this migration focused on the core pattern change from createModalLauncher to useOverlay. You can export just the ExportApplicationModalOverlay component directly and have consumers import and use it synchronously—no need for the LazyExportApplicationModalOverlay wrapper.

This simplifies the PR and makes the migration more straightforward to review. Lazy loading optimizations can always be added as a separate follow-up if needed.


📝 Learnings were identified and not saved (knowledge base disabled). Enable

Copy link
Member

@rhamilto rhamilto left a comment

Choose a reason for hiding this comment

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

Thanks for picking these up, @sg00dwin. One comment that should simplify this.

Comment on lines 251 to 258
// Lazy-loaded OverlayComponent for Export Application Modal
export const LazyExportApplicationModalOverlay = lazy(() =>
import('./ExportApplicationModal' /* webpackChunkName: "export-application-modal" */).then(
(m) => ({
default: m.ExportApplicationModalOverlay,
}),
),
);
Copy link
Member

Choose a reason for hiding this comment

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

Since we weren't lazy loading before, let's undo that to simplify the changes.

@sg00dwin
Copy link
Member Author

tide/merge-method-squash

type ExportApplicationActionType = {
namespace: string;
toast: ToastContextType;
launchModal: (component: React.ComponentType<any>, props: Record<string, any>) => void;
Copy link
Member

@rhamilto rhamilto Feb 25, 2026

Choose a reason for hiding this comment

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

Suggested change
launchModal: (component: React.ComponentType<any>, props: Record<string, any>) => void;
launchModal: LaunchOverlay;

Copy link
Member

Choose a reason for hiding this comment

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

Whoops. Had the wrong suggestion. Fixed.

}: ExportApplicationActionType) => {
const name = EXPORT_CR_NAME;
return handleExportApplication(name, namespace, toast);
try {
Copy link
Member

Choose a reason for hiding this comment

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

You're duplicating code by removing handleExportApplication. Is there a reason for that?

Copy link
Member Author

Choose a reason for hiding this comment

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

No good reason. I've restored handleExportApplication as a shared helper (now accepting launchModal as a parameter instead of calling createModalLauncher internally), and updated both consumers to call it.

…cation

  Refactor handleExportApplication to accept launchModal as a parameter
  instead of calling createModalLauncher internally. Both ExportApplication
  and exportApplicationAction now call the shared helper rather than
  duplicating the try/catch + getExportResource + launchModal logic.

Assisted by Claude
toast,
});
} catch (err) {
// eslint-disable-next-line no-console
Copy link
Member

Choose a reason for hiding this comment

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

We should keep the console.warn?

@rhamilto rhamilto added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Feb 26, 2026
@rhamilto
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 26, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto, sg00dwin

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 26, 2026
@rhamilto
Copy link
Member

/retest

@rhamilto
Copy link
Member

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 27, 2026

@sg00dwin: The following test 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-gcp-console 5637028 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

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/dev-console Related to dev-console component/topology Related to topology jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants