Skip to content

fix(settings): validate the add-provider wizard step before advancing (#2813)#3100

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
leorivastech:fix/validate-add-provider-wizard-step
Jul 22, 2026
Merged

fix(settings): validate the add-provider wizard step before advancing (#2813)#3100
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
leorivastech:fix/validate-add-provider-wizard-step

Conversation

@leorivastech

@leorivastech leorivastech commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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 resolveWizardNavigation logic; blocked moves stay on Identity and flip hasAttemptedSubmit so the existing inline error shows. Driver → Identity and backward navigation are unchanged.

Wizard step labels move into AddProviderInstanceWizardSteps, with aria-current="step" on the active step. Step list and navigation rules live in AddProviderInstanceDialog.logic.ts with 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

  • Introduces resolveWizardNavigation in AddProviderInstanceDialog.logic.ts to determine whether wizard navigation should proceed or be blocked based on instance id validation when moving past the Identity step.
  • Extracts step header rendering into a new AddProviderInstanceWizardSteps.tsx component that delegates click events through resolveWizardNavigation, reflecting step state via aria-current and check icons.
  • Updates AddProviderInstanceDialog.tsx so the Next button and step header clicks both call applyWizardNavigation, which sets hasAttemptedSubmit on a blocked result to surface the inline validation error.
  • Behavioral Change: clicking Next or a later step header while the instance id is invalid now redirects to the Identity step instead of advancing.

Macroscope summarized 9f399ae.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 146fd24d-d60e-4084-ad71-d3406e78fd54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jun 16, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 16, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@juliusmarminge
juliusmarminge force-pushed the fix/validate-add-provider-wizard-step branch from 5442d1f to f8fbf84 Compare June 16, 2026 17:31
leorivastech and others added 2 commits July 22, 2026 14:27
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>
@juliusmarminge
juliusmarminge force-pushed the fix/validate-add-provider-wizard-step branch from b1916da to 9f399ae Compare July 22, 2026 12:52
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 22, 2026 12:52

Dismissing prior approval to re-evaluate 9f399ae

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jul 22, 2026
@juliusmarminge
juliusmarminge merged commit 282ecb3 into pingdotgg:main Jul 22, 2026
16 checks passed
UNN-Devotek pushed a commit to unn-corp/t3code that referenced this pull request Jul 23, 2026
…pingdotgg#2813) (pingdotgg#3100)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
AnanduB13 pushed a commit to AnanduB13/t3code that referenced this pull request Jul 23, 2026
…pingdotgg#2813) (pingdotgg#3100)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: validation bug in add provider instance form

2 participants