Windows managed local account: design feedback on the Users tab and error tooltip - #50675
Conversation
…rror tooltip Keep the Windows tab visible when Windows MDM is off rather than hiding it, and disable Create hidden admin with a tooltip pointing at Windows MDM, matching how the macOS tab already behaves. Hiding the tab left an admin with no way to discover the setting or learn what to turn on to reach it. Reword the password-policy error fleetd reports so it reads as sentences. The whole string is generated by Fleet, not by Windows, and it is now shown to admins verbatim in the Show managed account tooltip, so it is written for that surface rather than in the usual lowercase Go error style. Left-align that tooltip. Dropdown option tooltips are centered by default, which reads poorly for several sentences of prose. Scoped to this one tooltip: the centering rule is shared by every dropdown option tooltip in Fleet, so changing it globally is a much larger visual change than this warrants.
|
@coderabbitai full review |
|
/agentic_review |
✅ Action performedFull review finished. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #50675 +/- ##
==========================================
+ Coverage 68.31% 68.34% +0.03%
==========================================
Files 3953 3955 +2
Lines 252735 253395 +660
Branches 13372 13522 +150
==========================================
+ Hits 172659 173190 +531
- Misses 64637 64710 +73
- Partials 15439 15495 +56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
WalkthroughThe Windows tab and account panel now render regardless of Windows MDM availability. The managed-account checkbox is disabled when Windows MDM is unavailable or GitOps mode is enabled. Apple and Windows MDM tooltip behavior now uses a shared wrapper. Host error tooltips display detailed managed-account errors when available. Windows managed-account operation and password-policy error messages were revised. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the Windows managed local account UX to be discoverable even when Windows MDM is off, and improves how managed-account failure details are presented to admins.
Changes:
- Always render the Windows tab in the Users card and disable “Create hidden admin” with a tooltip linking to Windows MDM when not configured.
- Reword the Windows password-policy failure string produced by orbit so it reads as admin-facing sentences.
- Left-align the managed-account failure tooltip text in the Host actions dropdown (scoped to that one tooltip).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| orbit/pkg/managedaccount/managedaccount_windows.go | Adjusts Windows managed-account error strings surfaced to the server/UI. |
| frontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/UsersForm.tsx | Always shows the Windows tab/panel and wires Windows MDM configured state into the section. |
| frontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/UsersForm.tests.tsx | Updates tests to reflect Windows tab always present + checkbox disabled/enabled behavior. |
| frontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/components/WindowsAccountSection/WindowsAccountSection.tsx | Adds Windows MDM gating tooltip and disables managed-account checkbox when not configured. |
| frontend/pages/hosts/details/HostDetailsPage/HostActionsDropdown/helpers.tsx | Wraps reported managed-account failure detail to allow custom alignment styling. |
| frontend/pages/hosts/details/HostDetailsPage/HostActionsDropdown/_styles.scss | Adds left-alignment styling for the managed-account failure tooltip content. |
Suppressed comments (2)
orbit/pkg/managedaccount/managedaccount_windows.go:171
- The new password-policy message no longer mentions checking the minimum password length, even though
NERR_PasswordTooShortis one of the handled return codes. Adding it back keeps the guidance actionable for the most common cause while preserving the sentence-style formatting.
return fmt.Errorf(
"%s. This device's password policy rejected the generated %d-character password. "+
"Check any custom password filter on the host.",
op, passwordLen)
orbit/pkg/managedaccount/managedaccount_windows.go:158
- Similar to the reset path, "Creating …" becomes a standalone first sentence in the password-policy error. Using a failure phrasing makes the surfaced message read more naturally.
if ret != 0 {
return accountError(fmt.Sprintf("Creating %s", username), ret, len(password))
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review by Qodo
1. GitOps tooltip masked
|
| // Drop the stale highlight for as long as a disabled option is hovered. | ||
| .actions-dropdown-select__menu-list:has(.actions-dropdown-select__option--is-disabled:hover) | ||
| .actions-dropdown-select__option--is-focused { | ||
| background-color: transparent; | ||
| } |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/components/ActionsDropdown/_styles.scss`:
- Around line 35-39: Update the `.actions-dropdown-select__option--is-focused`
background override in the dropdown styles so it applies only during pointer
interaction, not when keyboard focus is active. Reuse the existing
`isKeyboardFocus` state or pointer-mode class from `ActionsDropdown.tsx`, while
preserving the stale-highlight removal for hovered disabled options.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 72b5c514-29aa-46b3-8df5-bac06b124dca
📒 Files selected for processing (9)
frontend/components/ActionsDropdown/_styles.scssfrontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/UsersForm.tests.tsxfrontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/components/EndUserAuthSection/EndUserAuthSection.tsxfrontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/components/LocalAccountSection/LocalAccountSection.tsxfrontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/components/TurnOnMdmTooltipWrapper/TurnOnMdmTooltipWrapper.tsxfrontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/components/TurnOnMdmTooltipWrapper/index.tsfrontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/components/WindowsAccountSection/WindowsAccountSection.tsxfrontend/pages/hosts/details/HostDetailsPage/HostActionsDropdown/_styles.scssfrontend/pages/hosts/details/HostDetailsPage/HostActionsDropdown/helpers.tsx
💤 Files with no reviewable changes (1)
- frontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/UsersForm.tests.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
- frontend/pages/hosts/details/HostDetailsPage/HostActionsDropdown/_styles.scss
- frontend/pages/ManageControlsPage/SetupExperience/cards/Users/components/UsersForm/components/WindowsAccountSection/WindowsAccountSection.tsx
- frontend/pages/hosts/details/HostDetailsPage/HostActionsDropdown/helpers.tsx
| // Drop the stale highlight for as long as a disabled option is hovered. | ||
| .actions-dropdown-select__menu-list:has(.actions-dropdown-select__option--is-disabled:hover) | ||
| .actions-dropdown-select__option--is-focused { | ||
| background-color: transparent; | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve the keyboard focus indicator.
Lines 36-38 clear .actions-dropdown-select__option--is-focused whenever a disabled option is hovered. This also occurs during keyboard navigation if the pointer remains over a disabled option. The focused option then has no visible state.
Scope this override to pointer interaction. Reuse the existing isKeyboardFocus behavior in ActionsDropdown.tsx, or apply a pointer-mode class before clearing the background.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@frontend/components/ActionsDropdown/_styles.scss` around lines 35 - 39,
Update the `.actions-dropdown-select__option--is-focused` background override in
the dropdown styles so it applies only during pointer interaction, not when
keyboard focus is active. Reuse the existing `isKeyboardFocus` state or
pointer-mode class from `ActionsDropdown.tsx`, while preserving the
stale-highlight removal for hovered disabled options.
Fixes from @melpike's feedback.
Keep the Windows tab visible when Windows MDM is off rather than hiding it, and disable Create hidden admin with a tooltip pointing at Windows MDM, matching how the macOS tab already behaves.
TurnOnMdmTooltipWrapperto reduce code duplicationReword the password-policy error fleetd reports so it reads as sentences. The whole string is generated by Fleet, not by Windows, and it is now shown to admins verbatim in the Show managed account tooltip.
Left-align that tooltip.
Related issue: Resolves #43488
Checklist for submitter
Testing
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes