Skip to content

EDM-3426: Correctly place message and disable steps after device is bound#548

Open
celdrake wants to merge 1 commit intoflightctl:mainfrom
celdrake:EDM-3426-tooltip-for-disabled-steps
Open

EDM-3426: Correctly place message and disable steps after device is bound#548
celdrake wants to merge 1 commit intoflightctl:mainfrom
celdrake:EDM-3426-tooltip-for-disabled-steps

Conversation

@celdrake
Copy link
Collaborator

@celdrake celdrake commented Feb 25, 2026

The tooltip that should have been displayed when by editing a device it becomes bound to a fleet, was being displayed wrongly positioned and when device was not becoming bound to a fleet.

icons-fixed

Summary by CodeRabbit

  • New Features

    • Wizard now respects a "fleetless" state to enable/disable template and update steps and adjust navigation behavior.
    • Step labels use a unified renderer that shows contextual icons and tooltips only when appropriate.
  • Accessibility

    • Improved disabled-step handling for better screen reader semantics and keyboard navigation.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 03135e24-fa4f-4d2a-b1e9-2f96de0e6b84

📥 Commits

Reviewing files that changed from the base of the PR and between 5967892 and 5cd07d0.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • libs/i18n/locales/en/translation.json
  • libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx
  • libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx
✅ Files skipped from review due to trivial changes (1)
  • libs/i18n/locales/en/translation.json

Walkthrough

Refactors EditDeviceWizard and EditDeviceWizardNav to introduce an explicit isFleetless flag (derived from values.fleetMatch) replacing canEditTemplate, adjust step-enable/disable logic to use it, add an internal StepNavContent helper for label+tooltip rendering, update the nav component signature to accept isFleetless, and add a new i18n string for the tooltip.

Changes

Cohort / File(s) Summary
Device Wizard Logic Updates
libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx
Replaced canEditTemplate with isFleetless (from values.fleetMatch). Updated isTemplateStepDisabled and isUpdateStepDisabled logic to require validation plus isFleetless. Forwarded isFleetless prop to EditDeviceWizardNav.
Navigation UI Refactoring
libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx
Component signature changed to accept isFleetless: boolean (public API change). Added StepNavContent helper for step label + conditional tooltip/icon rendering (tooltip shown when a step is disabled and not fleetless). Replaced prior disabled-reason handling, added PatternFly Flex imports, and switched to aria-disabled usage.
Localization
libs/i18n/locales/en/translation.json
Added new translation key: "Why this step is disabled" used by the tooltip content.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: correcting the placement and behavior of disabled-step messaging when a device becomes bound to a fleet.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@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)
libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx (1)

63-92: ⚠️ Potential issue | 🟠 Major

Replace aria-disabled prop with isDisabled on WizardNavItem components.

aria-disabled is not a supported prop in PatternFly's WizardNavItem API. Lines 73 and 86 use aria-disabled={isEditTemplateDisabled} and aria-disabled={isDeviceUpdatesDisabled}, but these props will be ignored. The correct approach (shown on line 97) is to use the isDisabled prop instead:

- aria-disabled={isEditTemplateDisabled}
+ isDisabled={isEditTemplateDisabled}

and

- aria-disabled={isDeviceUpdatesDisabled}
+ isDisabled={isDeviceUpdatesDisabled}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx`
around lines 63 - 92, The WizardNavItem instances are using an unsupported
aria-disabled prop; update the two occurrences (the WizardNavItem with
stepIndex={deviceTemplateStepIndex} that uses isEditTemplateDisabled, and the
WizardNavItem with stepIndex={deviceUpdatesStepIndex} that uses
isDeviceUpdatesDisabled) to pass the boolean via the isDisabled prop instead of
aria-disabled so the PatternFly API recognizes and disables the nav items
(ensure you pass the same isEditTemplateDisabled / isDeviceUpdatesDisabled
values to isDisabled).
🧹 Nitpick comments (1)
libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx (1)

12-43: Optional: unnecessary <Flex> wrapper in the isDisabled && isFleetless branch.

When isDisabled=true and isFleetless=true, StepNavContent renders the step name wrapped in a <Flex>/<FlexItem> layout with no tooltip — the extra layout primitives add no value over a plain string return.

♻️ Proposed simplification
  if (!isDisabled) {
    return stepName;
  }
+ if (isFleetless) {
+   return stepName;
+ }
  return (
    <Flex>
      <FlexItem>{stepName}</FlexItem>
-     {!isFleetless && (
        <FlexItem>
          <Tooltip
            content={t(
              'The device will be bound to a fleet. As a result, its configurations cannot be edited directly.',
            )}
          >
            <Icon status="info" size="sm">
              <InfoCircleIcon />
            </Icon>
          </Tooltip>
        </FlexItem>
-     )}
    </Flex>
  );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx`
around lines 12 - 43, StepNavContent currently always wraps the disabled state
in a <Flex> with <FlexItem> even when isFleetless is true, producing unnecessary
layout; update StepNavContent so that when isDisabled && isFleetless it returns
stepName directly (like the non-disabled branch) and only uses the
<Flex>/<FlexItem> + Tooltip rendering when isDisabled && !isFleetless,
preserving the t(...) tooltip text and Icon rendering in that branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx`:
- Around line 116-118: The Updates-step enablement is missing a dependency on
the General step; update the boolean expression that computes
isUpdateStepDisabled in EditDeviceWizard.tsx so the Updates step is only enabled
when the General step and the Template step are both valid and the device is
fleetless — i.e. change the logic that sets isUpdateStepDisabled (currently
based on templateStepValid and isFleetless) to include generalStepValid as well
so it becomes disabled unless generalStepValid && templateStepValid &&
isFleetless.

---

Outside diff comments:
In
`@libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx`:
- Around line 63-92: The WizardNavItem instances are using an unsupported
aria-disabled prop; update the two occurrences (the WizardNavItem with
stepIndex={deviceTemplateStepIndex} that uses isEditTemplateDisabled, and the
WizardNavItem with stepIndex={deviceUpdatesStepIndex} that uses
isDeviceUpdatesDisabled) to pass the boolean via the isDisabled prop instead of
aria-disabled so the PatternFly API recognizes and disables the nav items
(ensure you pass the same isEditTemplateDisabled / isDeviceUpdatesDisabled
values to isDisabled).

---

Nitpick comments:
In
`@libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx`:
- Around line 12-43: StepNavContent currently always wraps the disabled state in
a <Flex> with <FlexItem> even when isFleetless is true, producing unnecessary
layout; update StepNavContent so that when isDisabled && isFleetless it returns
stepName directly (like the non-disabled branch) and only uses the
<Flex>/<FlexItem> + Tooltip rendering when isDisabled && !isFleetless,
preserving the t(...) tooltip text and Icon rendering in that branch.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a79e591 and 3f03f40.

📒 Files selected for processing (2)
  • libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx
  • libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx

@celdrake celdrake changed the title EDM-3426: Correctly place and disable steps after device is bound EDM-3426: Correctly place message and disable steps after device is bound Feb 26, 2026
@celdrake celdrake force-pushed the EDM-3426-tooltip-for-disabled-steps branch from 3f03f40 to 5967892 Compare February 26, 2026 08:08
Copy link

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx`:
- Around line 29-35: The tooltip is attached to a non-focusable Icon in
EditDeviceWizardNav.tsx so keyboard users can't discover it; make the tooltip
anchor focusable by either adding tabIndex={0} (and a suitable aria-label or
aria-describedby) to the Icon element or wrapping <Icon><InfoCircleIcon/></Icon>
in a focusable element (e.g., <span> or <button>) with role="button" and
tabIndex={0}, so the Tooltip component receives focus events and the tooltip
shows on keyboard focus; ensure the accessible name (aria-label) describes the
disabled reason for screen readers.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f03f40 and 5967892.

📒 Files selected for processing (2)
  • libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx
  • libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx

@celdrake celdrake force-pushed the EDM-3426-tooltip-for-disabled-steps branch from 5967892 to 5cd07d0 Compare March 4, 2026 07:56
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