Skip to content

Wizard: Update package step (HMS-10579)#4494

Open
regexowl wants to merge 1 commit into
osbuild:mainfrom
regexowl:packages-updates
Open

Wizard: Update package step (HMS-10579)#4494
regexowl wants to merge 1 commit into
osbuild:mainfrom
regexowl:packages-updates

Conversation

@regexowl
Copy link
Copy Markdown
Collaborator

@regexowl regexowl commented Jun 1, 2026

This:

  • adds a placeholder to the package search
  • adds a required label

as per revamp SPUR.

@regexowl regexowl added 🔍 SPUR 🍼 simple Simple and quick to review labels Jun 1, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.34%. Comparing base (4e26bdb) to head (5a5712f).

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4494   +/-   ##
=======================================
  Coverage   75.34%   75.34%           
=======================================
  Files         229      229           
  Lines        7446     7447    +1     
  Branches     2768     2771    +3     
=======================================
+ Hits         5610     5611    +1     
  Misses       1578     1578           
  Partials      258      258           
Files with missing lines Coverage Δ
...Wizard/steps/Packages/components/PackageSearch.tsx 80.92% <ø> (ø)
...Wizard/steps/Packages/components/PackagesTable.tsx 77.66% <100.00%> (+0.21%) ⬆️

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...5a5712f. 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.

This:
- adds a placeholder to the package search
- adds a required label

as per revamp SPUR.
@regexowl regexowl force-pushed the packages-updates branch from d39cc4e to 5a5712f Compare June 3, 2026 10:50
@regexowl regexowl changed the title Wizard: Update package step Wizard: Update package step (HMS-10579) Jun 3, 2026
@regexowl regexowl marked this pull request as ready for review June 3, 2026 11:03
@regexowl regexowl requested a review from a team as a code owner June 3, 2026 11:03
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 1 issue, and left some high level feedback:

  • The new placeholder='Add packages' is hard-coded and not aligned with the dynamic packageTypeLabel used in the aria-label; consider deriving the placeholder from packageTypeLabel (or making it a prop) so it stays consistent and easier to adjust per package type.
  • For the Required label next to pkg.name, consider whether this should have a specific variant (e.g. variant='outline' or color if supported) or a dedicated class for spacing/visual distinction so it doesn’t visually merge with longer package names.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `placeholder='Add packages'` is hard-coded and not aligned with the dynamic `packageTypeLabel` used in the `aria-label`; consider deriving the placeholder from `packageTypeLabel` (or making it a prop) so it stays consistent and easier to adjust per package type.
- For the `Required` label next to `pkg.name`, consider whether this should have a specific variant (e.g. `variant='outline'` or `color` if supported) or a dedicated class for spacing/visual distinction so it doesn’t visually merge with longer package names.

## Individual Comments

### Comment 1
<location path="src/Components/CreateImageWizard/steps/Packages/components/PackagesTable.tsx" line_range="242-243" />
<code_context>
             >
               <Td>&nbsp;</Td>
-              <Td>{pkg.name}</Td>
+              <Td>
+                {pkg.name} {isRequired && <Label isCompact>Required</Label>}
+              </Td>
               <Td>{pkg.stream ? pkg.stream : '--'}</Td>
</code_context>
<issue_to_address>
**suggestion:** Consider how the inline `Required` label affects localization and layout consistency.

This introduces a new visible string and changes the row layout. If the wizard is localized, this label should use the existing translation mechanism. Also consider how multiple `Required` labels in a column affect density; a shorter token, icon with accessible text, or a standardized PatternFly label variant (e.g., `variant="outline"`) may keep the layout more compact and consistent.

Suggested implementation:

```typescript
import { Content, Label } from '@patternfly/react-core';
import { useIntl } from 'react-intl';

```

```typescript
              <Td>
                {pkg.name}{' '}
                {isRequired && (
                  <Label
                    isCompact
                    variant="outline"
                    data-testid="required-package-label"
                  >
                    {intl.formatMessage({
                      id: 'wizard.packages.required',
                      defaultMessage: 'Required',
                    })}
                  </Label>
                )}
              </Td>

```

1. Ensure that this component (or a parent in the same file) initializes `intl` via `const intl = useIntl();`. If it's not present yet, add it at the top level of the functional component body.
2. If your project uses a specific message catalog or ID convention, adjust the `id: 'wizard.packages.required'` to match your existing i18n keys.
</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 on lines +242 to +243
<Td>
{pkg.name} {isRequired && <Label isCompact>Required</Label>}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Consider how the inline Required label affects localization and layout consistency.

This introduces a new visible string and changes the row layout. If the wizard is localized, this label should use the existing translation mechanism. Also consider how multiple Required labels in a column affect density; a shorter token, icon with accessible text, or a standardized PatternFly label variant (e.g., variant="outline") may keep the layout more compact and consistent.

Suggested implementation:

import { Content, Label } from '@patternfly/react-core';
import { useIntl } from 'react-intl';
              <Td>
                {pkg.name}{' '}
                {isRequired && (
                  <Label
                    isCompact
                    variant="outline"
                    data-testid="required-package-label"
                  >
                    {intl.formatMessage({
                      id: 'wizard.packages.required',
                      defaultMessage: 'Required',
                    })}
                  </Label>
                )}
              </Td>
  1. Ensure that this component (or a parent in the same file) initializes intl via const intl = useIntl();. If it's not present yet, add it at the top level of the functional component body.
  2. If your project uses a specific message catalog or ID convention, adjust the id: 'wizard.packages.required' to match your existing i18n keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍼 simple Simple and quick to review 🔍 SPUR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant