Skip to content

[WIP] CONSOLE-4447: Migrate modals to modern PatternFly Modal components#16015

Open
rhamilto wants to merge 3 commits intoopenshift:mainfrom
rhamilto:CONSOLE-4447
Open

[WIP] CONSOLE-4447: Migrate modals to modern PatternFly Modal components#16015
rhamilto wants to merge 3 commits intoopenshift:mainfrom
rhamilto:CONSOLE-4447

Conversation

@rhamilto
Copy link
Member

@rhamilto rhamilto commented Feb 10, 2026

This is the first of what will be many PRs.

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Before
Screenshot 2026-02-10 at 1 50 08 PM

After
Screenshot 2026-02-10 at 1 42 27 PM

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by blurring focus

Modals look the same.

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Before
Screenshot 2026-02-10 at 1 52 31 PM

After
Screenshot 2026-02-12 at 9 55 57 AM

Note the after error message contents are different because they were taken while running development code. In production, _HttpError: will not be part of the error message.

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with 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 10, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 10, 2026

@rhamilto: This pull request references CONSOLE-4447 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:

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by closing Help dropdown and blurring focus

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with 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 cajieh and rawagner February 10, 2026 18:41
@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Feb 10, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto

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/knative Related to knative-plugin approved Indicates a PR has been approved by an approver from all required OWNERS files. component/metal3 Related to metal3-plugin component/olm Related to OLM component/shared Related to console-shared labels Feb 10, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 10, 2026

@rhamilto: This pull request references CONSOLE-4447 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:

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by closing Help dropdown and blurring focus

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • Added a dedicated error content component for consistent error message display across modals.

  • Guided tour now closes help dropdown when launched.

  • Improvements

  • Standardized modal structure and composition across the application.

  • Updated Cancel button styling to link variant for improved visual consistency.

  • Enhanced error rendering in modal dialogs for better user experience.

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 10, 2026

📝 Walkthrough

Walkthrough

This pull request migrates modal implementations across OpenShift Console from a custom Modal wrapper component to PatternFly's native Modal composition (ModalHeader, ModalBody, ModalFooter). Changes include: removing the deprecated custom Modal from console-shared; introducing a new ModalErrorContent component for centralized error rendering; refactoring existing modal structures in multiple packages to use PatternFly's composed modal API; standardizing Cancel button styling from secondary to link variant across modals; updating modal imports and class names; and adjusting modal event handling and closure logic. The custom modal export is removed from the components barrel file.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The PR title clearly identifies the main objective: migrating modals to modern PatternFly Modal components, directly reflecting the primary purpose of this substantial refactoring across the codebase.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/packages/console-app/src/components/tour/TourStepComponent.tsx (1)

112-120: 🛠️ Refactor suggestion | 🟠 Major

Restructure modal composition to comply with PatternFly v6 patterns—do not nest ModalHeader/ModalBody/ModalFooter inside another ModalBody.

PatternFly v6 Modal expects direct children: <ModalHeader> (optional), <ModalBody> (required), <ModalFooter> (optional). The current nested structure violates this pattern and introduces semantic issues (duplicate role="main") and potential a11y/styling regressions.

🛠️ Refactor option: use plain divs for nested content layout
-      <ModalBody>
-        <Grid hasGutter>
+      <Grid hasGutter>

Then replace nested PF components with plain wrappers:

-            <ModalHeader>{header}</ModalHeader>
-            <ModalBody>{stepContent}</ModalBody>
-            <ModalFooter>{footer}</ModalFooter>
+            <div className="co-tour-step-component__header">{header}</div>
+            <div className="co-tour-step-component__body">{stepContent}</div>
+            <div className="co-tour-step-component__footer">{footer}</div>

This preserves layout flexibility while maintaining proper Modal composition semantics.

🤖 Fix all issues with AI agents
In `@frontend/packages/console-app/src/components/favorite/FavoriteButton.tsx`:
- Around line 161-190: The form id "confirm-favorite-form" and the Button's form
prop "confirm-favorite" do not match, so clicking Save won't trigger native form
submission/validation; update the Button's form attribute to
"confirm-favorite-form" (the Form with id="confirm-favorite-form") so the Save
Button (the Button that calls handleConfirmStar) is properly bound to the form
and native validation/submission works.
🧹 Nitpick comments (1)
frontend/packages/console-shared/src/components/modals/CreateProjectModal.tsx (1)

121-130: LGTM – Cancel button variant updated.

The change aligns with the PR's modal standardization. Button ordering follows PatternFly guidelines.

Minor observation: The Cancel button uses disabled (line 124) while the primary button uses isDisabled (lines 112-113). Both work, but isDisabled is the PatternFly standard prop. This is a pre-existing inconsistency and outside the scope of this PR, but worth addressing in a future cleanup.

Comment on lines 161 to 190
<Form id="confirm-favorite-form" onSubmit={handleConfirmStar}>
<FormGroup label={t('Name')} isRequired fieldId="input-name">
<TextInput
id="confirm-favorite-form-name"
data-test="input-name"
name="name"
type="text"
onChange={(e, v) => handleNameChange(v)}
value={name || ''}
autoFocus
required
/>
{error && (
<FormHelperText>
<HelperText>
<HelperTextItem variant="error">{error}</HelperTextItem>
</HelperText>
</FormHelperText>
)}
</FormGroup>
</Form>
</ModalBody>
<ModalFooter>
<Button
key="confirm"
variant="primary"
onClick={handleConfirmStar}
form="confirm-favorite"
>
{t('Save')}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the form id mismatch so the Save button is bound to the form.

Right now the form id is confirm-favorite-form, but the button references confirm-favorite, so click won’t trigger native form validation or submission semantics. Update the button’s form attribute to match.

🔧 Suggested fix
-            <Button
+            <Button
               key="confirm"
               variant="primary"
               onClick={handleConfirmStar}
-              form="confirm-favorite"
+              form="confirm-favorite-form"
             >
📝 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
<Form id="confirm-favorite-form" onSubmit={handleConfirmStar}>
<FormGroup label={t('Name')} isRequired fieldId="input-name">
<TextInput
id="confirm-favorite-form-name"
data-test="input-name"
name="name"
type="text"
onChange={(e, v) => handleNameChange(v)}
value={name || ''}
autoFocus
required
/>
{error && (
<FormHelperText>
<HelperText>
<HelperTextItem variant="error">{error}</HelperTextItem>
</HelperText>
</FormHelperText>
)}
</FormGroup>
</Form>
</ModalBody>
<ModalFooter>
<Button
key="confirm"
variant="primary"
onClick={handleConfirmStar}
form="confirm-favorite"
>
{t('Save')}
<Form id="confirm-favorite-form" onSubmit={handleConfirmStar}>
<FormGroup label={t('Name')} isRequired fieldId="input-name">
<TextInput
id="confirm-favorite-form-name"
data-test="input-name"
name="name"
type="text"
onChange={(e, v) => handleNameChange(v)}
value={name || ''}
autoFocus
required
/>
{error && (
<FormHelperText>
<HelperText>
<HelperTextItem variant="error">{error}</HelperTextItem>
</HelperText>
</FormHelperText>
)}
</FormGroup>
</Form>
</ModalBody>
<ModalFooter>
<Button
key="confirm"
variant="primary"
onClick={handleConfirmStar}
form="confirm-favorite-form"
>
{t('Save')}
🤖 Prompt for AI Agents
In `@frontend/packages/console-app/src/components/favorite/FavoriteButton.tsx`
around lines 161 - 190, The form id "confirm-favorite-form" and the Button's
form prop "confirm-favorite" do not match, so clicking Save won't trigger native
form submission/validation; update the Button's form attribute to
"confirm-favorite-form" (the Form with id="confirm-favorite-form") so the Save
Button (the Button that calls handleConfirmStar) is properly bound to the form
and native validation/submission works.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 10, 2026

@rhamilto: This pull request references CONSOLE-4447 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:

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Before
Screenshot 2026-02-10 at 1 50 08 PM

After
Screenshot 2026-02-10 at 1 42 27 PM

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by closing Help dropdown and blurring focus

Modals look the same.

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Before
Screenshot 2026-02-10 at 1 52 31 PM

After
Screenshot 2026-02-10 at 1 44 12 PM

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with 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 10, 2026

@rhamilto: This pull request references CONSOLE-4447 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:

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Before
Screenshot 2026-02-10 at 1 50 08 PM

After
Screenshot 2026-02-10 at 1 42 27 PM

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by closing Help dropdown and blurring focus

Modals look the same.

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Before
Screenshot 2026-02-10 at 1 52 31 PM

After
Screenshot 2026-02-10 at 1 44 12 PM

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with 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.

@rhamilto rhamilto changed the title CONSOLE-4447: Migrate modals to modern PatternFly Modal components [WIP] CONSOLE-4447: Migrate modals to modern PatternFly Modal components Feb 10, 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 Feb 10, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 10, 2026

@rhamilto: This pull request references CONSOLE-4447 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:

This is the first of what will be many PRs.

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Before
Screenshot 2026-02-10 at 1 50 08 PM

After
Screenshot 2026-02-10 at 1 42 27 PM

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by closing Help dropdown and blurring focus

Modals look the same.

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Before
Screenshot 2026-02-10 at 1 52 31 PM

After
Screenshot 2026-02-10 at 1 44 12 PM

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with 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 10, 2026

@rhamilto: This pull request references CONSOLE-4447 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:

This is the first of what will be many PRs.

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Before
Screenshot 2026-02-10 at 1 50 08 PM

After
Screenshot 2026-02-10 at 1 42 27 PM

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by blurring focus

Modals look the same.

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Before
Screenshot 2026-02-10 at 1 52 31 PM

After
Screenshot 2026-02-10 at 1 44 12 PM

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with 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.

@rhamilto
Copy link
Member Author

/retest

1 similar comment
@rhamilto
Copy link
Member Author

/retest

@rhamilto
Copy link
Member Author

/retest

2 similar comments
@rhamilto
Copy link
Member Author

/retest

@rhamilto
Copy link
Member Author

/retest

@rhamilto
Copy link
Member Author

/retest

Update Cancel button variants from "secondary" to "link" in modern
PatternFly modals to follow PatternFly standards.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… wrapper

- Migrate useCopyCodeModal, FavoriteButton, and TourStepComponent from
  deprecated Modal wrapper to modern PatternFly Modal components
- Remove deprecated Modal wrapper (packages/console-shared/src/components/modal/)
- Migrate CatalogDetailsModal and operator-hub-items from deprecated
  PatternFly Modal to modern Modal components
- Preserve ocs-modal CSS class for catalog modal positioning
- Fix FavoriteButton form submission bug by adding preventDefault
- Fix Guided Tour accessibility warning by closing Help dropdown and
  blurring focus before starting tour

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 12, 2026

@rhamilto: This pull request references CONSOLE-4447 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:

This is the first of what will be many PRs.

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Before
Screenshot 2026-02-10 at 1 50 08 PM

After
Screenshot 2026-02-10 at 1 42 27 PM

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by blurring focus

Modals look the same.

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Before
Screenshot 2026-02-10 at 1 52 31 PM

After
Uploading Screenshot 2026-02-12 at 9.55.57 AM.png…

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with 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 12, 2026

@rhamilto: This pull request references CONSOLE-4447 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:

This is the first of what will be many PRs.

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Before
Screenshot 2026-02-10 at 1 50 08 PM

After
Screenshot 2026-02-10 at 1 42 27 PM

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by blurring focus

Modals look the same.

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Before
Screenshot 2026-02-10 at 1 52 31 PM

After
Screenshot 2026-02-12 at 9 55 57 AM

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with 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 12, 2026

@rhamilto: This pull request references CONSOLE-4447 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:

This is the first of what will be many PRs.

Summary

This PR migrates several modals from deprecated modal components to modern PatternFly v6 Modal components and updates button variants to follow PatternFly standards.

Changes

Commit 1: Update modal Cancel buttons to use variant="link" (10 files)

Updates Cancel button variants from "secondary" to "link" in modern PatternFly modals to follow PatternFly standards:

  • public/components/modals/delete-namespace-modal.tsx
  • public/components/secrets/create-secret/SecretFormWrapper.tsx
  • packages/console-app/src/components/modals/add-group-users-modal.tsx - Also fixed button order (Primary first, Cancel second)
  • packages/console-shared/src/components/modals/CreateNamespaceModal.tsx
  • packages/console-shared/src/components/modals/CreateProjectModal.tsx
  • packages/metal3-plugin/src/components/modals/PowerOffHostModal.tsx
  • packages/metal3-plugin/src/components/modals/RestartHostModal.tsx
  • packages/metal3-plugin/src/components/modals/StartNodeMaintenanceModal.tsx
  • packages/knative-plugin/src/components/test-function/TestFunctionModal.tsx
  • packages/operator-lifecycle-manager/src/components/registry-poll-interval-details.tsx

Before
Screenshot 2026-02-10 at 1 50 08 PM

After
Screenshot 2026-02-10 at 1 42 27 PM

Commit 2: Migrate modals to modern PatternFly Modal and remove deprecated Modal wrapper (10 files)

  • Migrates useCopyCodeModal, FavoriteButton, and TourStepComponent from deprecated Modal wrapper to modern PatternFly Modal
  • Removes deprecated Modal wrapper (packages/console-shared/src/components/modal/)
  • Migrates CatalogDetailsModal and operator-hub-items from deprecated PatternFly Modal to modern Modal
  • Preserves ocs-modal CSS class for catalog modal positioning
  • Fixes FavoriteButton form submission bug by adding preventDefault
  • Fixes Guided Tour accessibility warning by blurring focus

Modals look the same.

Commit 3: Migrate DeleteModal and related modals to modern PatternFly Modal (5 files)

  • Migrates DeleteModal from deprecated factory/modal components to modern PatternFly v6 Modal
  • Creates reusable ModalErrorContent component for error display in modal bodies
  • Updates configure-count-modal and configure-machine-autoscaler-modal to use modern Modal and ModalErrorContent
  • Migrates delete-modal to modern PatternFly Modal with proper error handling

Before
Screenshot 2026-02-10 at 1 52 31 PM

After
Screenshot 2026-02-12 at 9 55 57 AM

Note the after error message contents are different because they were taken while running development code. In production, _HttpError: will not be part of the error message.

Key Migration Patterns

  1. Error handling: Moved from ModalFooter to end of ModalBody using ModalErrorContent component
  2. Button order: Primary/Danger action button comes first, Cancel button second
  3. Cancel button variant: Uses variant="link" (PatternFly standard)
  4. Modal structure: Uses ModalHeader instead of ModalTitle
  5. Close handler: Adds onClose prop to Modal for X button

Testing

  • Tested DeleteModal error states
  • Tested FavoriteButton favorite addition/removal
  • Tested Guided Tour launch (accessibility warning fixed)
  • Tested catalog modal rendering
  • Verified button variants across all updated modals

Related Issues

🤖 Generated with 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.

@rhamilto rhamilto force-pushed the CONSOLE-4447 branch 2 times, most recently from 81869e8 to 6ff28cc Compare February 12, 2026 15:20
- Migrate DeleteModal from deprecated factory/modal components to
  modern PatternFly v6 Modal components
- Create reusable ModalErrorContent component for error display
- Update configure-count-modal and configure-machine-autoscaler-modal
  to use modern Modal components and ModalErrorContent
- Fix button order in add-group-users-modal (Primary first, Cancel second)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rhamilto
Copy link
Member Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 12, 2026

@rhamilto: 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 36f553a 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/knative Related to knative-plugin component/metal3 Related to metal3-plugin component/olm Related to OLM component/shared Related to console-shared do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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.

2 participants