fix(settings): validate the add-provider wizard step before advancing (#2813)#3100
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
ApprovabilityVerdict: Approved This is a straightforward bug fix that adds wizard step validation, preventing advancement when instance ID is invalid. The changes are self-contained to settings UI with comprehensive test coverage, and the commit author is the original file maintainer. You can customize Macroscope's approvability policy. Learn more. |
5442d1f to
f8fbf84
Compare
The Next button in the add-provider-instance dialog advanced the wizard unconditionally, so an empty or invalid Instance ID on the Identity step was only caught at the final Add instance step — where it silently no-ops, leaving the user with a dead button and no feedback. Gate advancing on the current step: the Identity step now blocks Next while the Instance ID is invalid and surfaces the existing inline error, matching the check handleSave already applies before submit. Fixes pingdotgg#2813.
Gate both footer and forward step-header navigation through Identity validation while preserving backward navigation. Keep the navigation rule independently testable and surface the existing inline error on blocked skips. Co-authored-by: codex <codex@users.noreply.github.com>
b1916da to
9f399ae
Compare
Dismissing prior approval to re-evaluate 9f399ae
…pingdotgg#2813) (pingdotgg#3100) Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com>
…pingdotgg#2813) (pingdotgg#3100) Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com>
Fixes #2813.
In the "Add provider instance" dialog, the Next button moved you to the next
step without checking anything. So if you leave the Instance ID empty (or
invalid) on the Identity step and click Next, the wizard happily advances — and
you only find out at the very end, where "Add instance" silently does nothing.
From the user's side it looks like a dead button with no explanation.
The fix gates advancing on the current step. The Identity step now refuses to
advance while the Instance ID is invalid and surfaces the inline error that
already exists — the same check "Add instance" applies before submitting. Steps
that don't own the Instance ID are unaffected, and once the id is valid Next
works as before.
I pulled the navigation decision into a small pure function
(advanceInstanceWizard) so the rule is testable on its own, matching how
validateInstanceId is already structured in this file. Added unit tests covering:
leaving the Driver step with an invalid id (allowed), being blocked on the
Identity step with an invalid id, advancing once it's valid, and not advancing
past the last step. typecheck, lint and formatting are clean.
Happy to add a short before/after screen recording if that helps.
Note
Low Risk
Settings UI-only validation and navigation refactor with no server or persistence changes beyond existing save checks.
Overview
Add provider instance wizard no longer advances past Identity with an invalid instance ID. Next and clicking the Config step header both go through shared
resolveWizardNavigationlogic; blocked moves stay on Identity and fliphasAttemptedSubmitso the existing inline error shows. Driver → Identity and backward navigation are unchanged.Wizard step labels move into
AddProviderInstanceWizardSteps, witharia-current="step"on the active step. Step list and navigation rules live inAddProviderInstanceDialog.logic.tswith unit tests for block/skip/advance/clamp behavior.Reviewed by Cursor Bugbot for commit 9f399ae. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Validate the add-provider wizard Identity step before advancing to Config
resolveWizardNavigationin AddProviderInstanceDialog.logic.ts to determine whether wizard navigation should proceed or be blocked based on instance id validation when moving past the Identity step.resolveWizardNavigation, reflecting step state viaaria-currentand check icons.applyWizardNavigation, which setshasAttemptedSubmiton a blocked result to surface the inline validation error.Macroscope summarized 9f399ae.