Skip to content

Deprecate old Wizard (HMS-10754)#4488

Open
regexowl wants to merge 5 commits into
osbuild:mainfrom
regexowl:deprecate-old-wizard
Open

Deprecate old Wizard (HMS-10754)#4488
regexowl wants to merge 5 commits into
osbuild:mainfrom
regexowl:deprecate-old-wizard

Conversation

@regexowl
Copy link
Copy Markdown
Collaborator

@regexowl regexowl commented Jun 1, 2026

This removes old Wizard from the code base and updates all references in the code base.

JIRA: HMS-10754

@regexowl
Copy link
Copy Markdown
Collaborator Author

regexowl commented Jun 1, 2026

/jira-epic RHIN-2262

@schutzbot schutzbot changed the title Deprecate old Wizard Deprecate old Wizard (HMS-10754) Jun 1, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

❌ Patch coverage is 87.61905% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.02%. Comparing base (4e26bdb) to head (12c12ff).

Files with missing lines Patch % Lines
...Components/CreateImageWizard/CreateImageWizard.tsx 87.61% 24 Missing and 2 partials ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4488      +/-   ##
==========================================
+ Coverage   75.34%   76.02%   +0.68%     
==========================================
  Files         229      224       -5     
  Lines        7446     7188     -258     
  Branches     2768     2657     -111     
==========================================
- Hits         5610     5465     -145     
+ Misses       1578     1482      -96     
+ Partials      258      241      -17     
Files with missing lines Coverage Δ
...reateImageWizard/components/CustomWizardFooter.tsx 100.00% <ø> (ø)
...reateImageWizard/components/ReviewWizardFooter.tsx 89.18% <ø> (ø)
src/Components/LandingPage/LandingPage.tsx 88.23% <ø> (+23.52%) ⬆️
...Components/CreateImageWizard/CreateImageWizard.tsx 85.83% <87.61%> (+28.12%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e26bdb...12c12ff. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@regexowl regexowl force-pushed the deprecate-old-wizard branch from 3661d27 to cfd24cd Compare June 1, 2026 09:36
@regexowl regexowl marked this pull request as ready for review June 1, 2026 10:22
@regexowl regexowl requested a review from a team as a code owner June 1, 2026 10:22
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • The query parameter handling for release, target, and arch (initializing state on open and cleaning them up on close) is now duplicated across multiple useEffect/helper blocks; consider extracting this into a small utility or hook so the behavior is defined in one place and easier to maintain.
  • The large JSX blocks that build the Base settings and Advanced settings steps repeat the same pattern of conditionally rendering multiple substeps with dividers; extracting a small helper/component to generate these sections would improve readability and make future adjustments to step ordering or layout less error-prone.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The query parameter handling for `release`, `target`, and `arch` (initializing state on open and cleaning them up on close) is now duplicated across multiple `useEffect`/helper blocks; consider extracting this into a small utility or hook so the behavior is defined in one place and easier to maintain.
- The large JSX blocks that build the Base settings and Advanced settings steps repeat the same pattern of conditionally rendering multiple substeps with dividers; extracting a small helper/component to generate these sections would improve readability and make future adjustments to step ordering or layout less error-prone.

## Individual Comments

### Comment 1
<location path="src/Components/CreateImageWizard/CreateImageWizard.tsx" line_range="359-360" />
<code_context>
+  const handleClose = () => {
+    dispatch(closeWizardModal());
+    dispatch(initializeWizard());
+    hasTrackedInitialStepRef.current = false;
+    hasTrackedWizardOpenedRef.current = false;
+
+    if (
</code_context>
<issue_to_address>
**issue (bug_risk):** Reset `hasInitialized` when closing the wizard so create-mode setup runs correctly on subsequent opens.

Because the create-mode setup is guarded by `hasInitialized.current`, closing the wizard without resetting this ref prevents the initialization (including registration defaults and URL param handling) from running on the next open. Add `hasInitialized.current = false;` in `handleClose` so reopening the create wizard triggers a full re-init.
</issue_to_address>

### Comment 2
<location path="src/Components/CreateImageWizard/CreateImageWizard.tsx" line_range="463" />
<code_context>
-            id='step-review'
-            footer={<ReviewWizardFooter />}
-          >
+          <Form>
+            <Content>
+              <Title headingLevel='h1' size='xl'>
</code_context>
<issue_to_address>
**issue (bug_risk):** Prevent default form submission on the base settings step to avoid accidental page reloads when pressing Enter.

On the other steps, the `<Form>` uses `onSubmit={handleFormSubmit}` (which calls `event.preventDefault()`), but the base settings `<Form>` has no `onSubmit` handler. This makes Enter behave differently here than on other steps and can trigger a native submit. To align behavior, wire this `<Form>` through `onSubmit={handleFormSubmit}` as well.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/Components/CreateImageWizard/CreateImageWizard.tsx
Comment thread src/Components/CreateImageWizard/CreateImageWizard.tsx Outdated
@regexowl
Copy link
Copy Markdown
Collaborator Author

regexowl commented Jun 1, 2026

  • The query parameter handling for release, target, and arch (initializing state on open and cleaning them up on close) is now duplicated across multiple useEffect/helper blocks; consider extracting this into a small utility or hook so the behavior is defined in one place and easier to maintain.

Can take a look at this in a separate PR, it's out of scope here.

@regexowl
Copy link
Copy Markdown
Collaborator Author

regexowl commented Jun 1, 2026

/retest

regexowl added 5 commits June 3, 2026 13:06
This removes old Wizard from the code base and updates all references in the code base.
This moves the new wizard files to the old wizard location to clean up the structure.
When navigating to `/imagewizard/invalid-id` the wizard opened in a permanent loading state.

This updates the behaviour to:
1. the wizard is closed
2. the invalid id gets cleared from the path
3. a notification informing the user about an invalid id gets dispatched
This ensures the behaviour is consistent with the other steps.
This resets the reference for Wizard initialization, so when the Wizard gets closed and re-opened, it will be initialized with fresh values.
@regexowl regexowl force-pushed the deprecate-old-wizard branch from 1629af1 to 12c12ff Compare June 3, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant