Skip to content

Wizard: Review step revamp (HMS-10785)#4594

Merged
ksiekl merged 2 commits into
mainfrom
review-revamp
Jul 9, 2026
Merged

Wizard: Review step revamp (HMS-10785)#4594
ksiekl merged 2 commits into
mainfrom
review-revamp

Conversation

@ksiekl

@ksiekl ksiekl commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Edit the Review step according to mocks.

Renamed required to isStandalone in RestrictionStrategy. The field controls whether the Users customization gets its own wizard step instead of being nested under Advanced Settings. The old name suggested a data validation constraint, but it actually determines where the section is placed in the UI.

review-revamp

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.50575% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.56%. Comparing base (d2fc091) to head (ceeaa42).
⚠️ Report is 51 commits behind head on main.

Files with missing lines Patch % Lines
...mponents/AdvancedSettings/components/Firstboot.tsx 63.63% 4 Missing ⚠️
...Components/CreateImageWizard/CreateImageWizard.tsx 66.66% 3 Missing ⚠️
...ponents/AdvancedSettings/components/Filesystem.tsx 92.50% 2 Missing and 1 partial ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4594      +/-   ##
==========================================
- Coverage   77.92%   74.56%   -3.37%     
==========================================
  Files         255      259       +4     
  Lines        7118     7854     +736     
  Branches     2654     2874     +220     
==========================================
+ Hits         5547     5856     +309     
- Misses       1440     1780     +340     
- Partials      131      218      +87     
Flag Coverage Δ
playwright 61.40% <72.72%> (+0.05%) ⬆️
vitest 71.54% <88.50%> (-0.37%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...omponents/AdvancedSettings/components/Firewall.tsx 100.00% <ø> (ø)
...omponents/AdvancedSettings/components/Hostname.tsx 100.00% <ø> (ø)
.../components/AdvancedSettings/components/Kernel.tsx 100.00% <100.00%> (ø)
.../components/AdvancedSettings/components/Locale.tsx 100.00% <100.00%> (ø)
...omponents/AdvancedSettings/components/Services.tsx 100.00% <ø> (ø)
...omponents/AdvancedSettings/components/Timezone.tsx 100.00% <ø> (ø)
...ponents/AdvancedSettings/components/UserGroups.tsx 100.00% <100.00%> (ø)
...w/components/AdvancedSettings/components/Users.tsx 100.00% <100.00%> (ø)
...steps/Review/components/AdvancedSettings/index.tsx 100.00% <100.00%> (ø)
...rd/steps/Review/components/ImageOverview/index.tsx 100.00% <100.00%> (ø)
... and 4 more

... and 49 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2fc091...ceeaa42. 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.

@ksiekl ksiekl marked this pull request as ready for review July 7, 2026 13:25
@ksiekl ksiekl requested a review from a team as a code owner July 7, 2026 13:25
@ksiekl ksiekl requested review from ochosi, regexowl and tkoscieln July 7, 2026 13:25

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

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:

  • In Firewall.tsx, selectFirewallEnabled / isEnabled is now unused; either remove it or use it to control whether the section renders or to indicate enabled/disabled status so the state is reflected in the new UI.
  • The Firstboot truncation logic currently splits the script into two separate CodeBlockCode sections, so when expanded the user sees only the tail; consider showing the full script when expanded (e.g., by toggling between truncated and complete content) to avoid losing context.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `Firewall.tsx`, `selectFirewallEnabled` / `isEnabled` is now unused; either remove it or use it to control whether the section renders or to indicate enabled/disabled status so the state is reflected in the new UI.
- The `Firstboot` truncation logic currently splits the script into two separate `CodeBlockCode` sections, so when expanded the user sees only the tail; consider showing the full script when expanded (e.g., by toggling between truncated and complete content) to avoid losing context.

## Individual Comments

### Comment 1
<location path="src/Components/CreateImageWizard/steps/Review/components/AdvancedSettings/components/Filesystem.tsx" line_range="84-87" />
<code_context>
+          }
+        />
+      )}
+      {mode === 'advanced' && diskMinsize && (
+        <ReviewGroup
+          heading='Minimum disk size'
+          description={`${diskMinsize} ${diskUnit}`}
+        />
+      )}
</code_context>
<issue_to_address>
**issue (bug_risk):** Use an explicit undefined check for diskMinsize to avoid skipping valid falsy values

This condition hides the "Minimum disk size" section when `diskMinsize` is `0`, even though `0` may be valid. Basic mode already uses `minSize !== undefined` instead of a truthy check. For consistency and to avoid hiding a configured value, update this to an explicit undefined check (e.g. `diskMinsize !== undefined`) so `0` still renders.
</issue_to_address>

### Comment 2
<location path="src/Components/CreateImageWizard/steps/Review/components/AdvancedSettings/tests/AdvancedSettings.test.tsx" line_range="442-445" />
<code_context>
         },
       );

+      expect(screen.getByText('Languages')).toBeInTheDocument();
       expect(screen.getByText('en_US.UTF-8')).toBeInTheDocument();
       expect(screen.getByText('es_ES.UTF-8')).toBeInTheDocument();
       expect(screen.getByText('fr_FR.UTF-8')).toBeInTheDocument();
</code_context>
<issue_to_address>
**suggestion (testing):** Add a test case for single-language locale to assert the singular "Language" heading

Current tests cover multiple languages (asserting `Languages`) and zero languages (asserting neither heading). Please add a test where exactly one language is configured and assert that the singular `Language` heading is rendered, to cover the `languages.length > 1` branch and guard against regressions.

Suggested implementation:

```typescript
      expect(screen.queryByText('Language')).not.toBeInTheDocument();
    });

    test('displays singular Language heading when a single language is configured', () => {
      // Render AdvancedSettings with exactly one language configured
      renderAdvancedSettings({
        languages: ['en_US.UTF-8'],
      });

      // Singular heading should be present
      expect(screen.getByText('Language')).toBeInTheDocument();

      // The single language should be rendered
      expect(screen.getByText('en_US.UTF-8')).toBeInTheDocument();

      // Plural heading should not be present when there is only one language
      expect(screen.queryByText('Languages')).not.toBeInTheDocument();

```

Because the surrounding context of the test file is partially shown, please verify and adjust the following when integrating this change:
1. Ensure `renderAdvancedSettings` is the correct helper used by the existing language-related tests. If a different helper is used (e.g. `renderReview`, `renderWithProviders`, etc.), replace `renderAdvancedSettings` with that helper and pass the `languages` configuration in the same way as the multi-language test.
2. Confirm that the inserted closing `});` aligns with the end of the preceding test. If there is already a `});` directly after the original `expect(screen.queryByText('Language')).not.toBeInTheDocument();`, remove the extra one to avoid a syntax error.
3. Place this new test near the other language-related tests (between the multi-language test and the zero-language test, if they are separate), to keep the file organized and consistent.
</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.

@kingsleyzissou kingsleyzissou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice, this is looking good. I had a few inline suggestions

oscapServices,
}: AdvancedSettingsOverviewProps) => {
const usersHidden =
restrictions.users.shouldHide || restrictions.users.required;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These are kind of opposites though. If users are required, then restrictions.users.shouldHide should be false.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This was a headwrecker, but I've gone through the code and tested it and it all works

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for looking into it! It sure was 🤓

oscapServices={oscapServices}
/>
<Firewall shouldHide={restrictions.firewall.shouldHide} />
{hasUserGroups && (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This could get moved into the shouldHide prop because it's doing the same thing

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Other components like Locale have their own ReviewSection internally and return null when hidden, so no
empty heading/divider renders.

Users and UserGroups can't do the same because ImageOverview also renders them, without a ReviewSection wrapper. Since both places share the same component, the ReviewSection has to stay outside in the AdvancedSettings index, and the conditional rendering stays too to avoid an empty heading and divider.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thinking about this further (and this can absolutely be a follow up since this works). Maybe we should lift the should hide to the ReviewSection component? And that could return the null there? I guess the tradeoff is we'd be passing it down through two components.

But that shouldn't block this PR. And it was a bit of a thought in terms of keeping things consistent

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

sounds nice, I'll check it out in a follow up then

Edit the Review step according to mocks
The name change reflects the usage better - the Users were not really
required, but only moved to different parts of the Review steps based on
bunch of conditions.

@kingsleyzissou kingsleyzissou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good.

Maybe we could possibly add a margin top to the line separator, to give a little bit more breathing room, but I know that's a bit tricky because a lot of the content is dynamic here.

Screenshot for reference (timezone in this one):

Image

@ksiekl

ksiekl commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

We could, I will also look into it in another PR, this is huge as is. Thank you for review!

@ksiekl ksiekl added this pull request to the merge queue Jul 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 8, 2026
@ksiekl ksiekl added this pull request to the merge queue Jul 9, 2026
Merged via the queue into main with commit 12b6034 Jul 9, 2026
37 checks passed
@ksiekl ksiekl deleted the review-revamp branch July 9, 2026 08:10
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.

2 participants