Skip to content

Browser wizard: a corrected model or dataset field stays marked invalid until the step re-renders #952

Closed

Description

@cemililik

Found while verifying #950 in Chromium. It is older than that change: development at 5111d58 behaves the same.

What happens

  1. In the browser wizard, choose Custom on the Model step, leave the model id empty and press Next. The field gets a red border, aria-invalid="true" and an error message (role="alert").
  2. Type a valid id such as org/model.
  3. The border, aria-invalid="true" and the message stay. They clear only when something else re-renders the step.

The Dataset step's dataset-name field behaves the same way.

Why

Both input handlers mean to re-render once the value validates, but they compute the "before" state after assigning the new value:

  • model id:

    ForgeLM/site/js/wizard.js

    Lines 1620 to 1633 in 5111d58

    input.addEventListener('input', function () {
    state.model = input.value.trim();
    persist();
    // If the operator was previously blocked on this field but
    // their new value now validates, drop the error visual on
    // next render (handled by re-running validation in render()).
    var prevErr = fieldHasError(state, 'model', 'model');
    var stillErr = validateStep(state, 'model').some(function (e) { return e.field === 'model'; });
    if (prevErr && !stillErr) {
    // Re-render to clear the error state cleanly. Cheap because
    // the only thing that changes is the .is-invalid class.
    rerender();
    return;
    }
  • dataset name:

    ForgeLM/site/js/wizard.js

    Lines 1690 to 1698 in 5111d58

    nameInput.addEventListener('input', function () {
    state.datasetName = nameInput.value.trim();
    persist();
    var prevErr = fieldHasError(state, 'dataset', 'datasetName');
    var stillErr = validateStep(state, 'dataset').some(function (e) { return e.field === 'datasetName'; });
    if (prevErr && !stillErr) {
    rerender();
    return;
    }

prevErr = fieldHasError(state, …) validates the value that was just assigned, so it always equals stillErr, and prevErr && !stillErr is never true. The fields on the Compliance and Operations steps clear their errors another way and are not affected.

Acceptance criteria

  • When a flagged model id or dataset name becomes valid, its is-invalid class, aria-invalid="true" and error row clear at once, and focus and the caret stay in the field.
  • A field that is still invalid keeps its error while the user types.
  • A regression test under tests/site/ fails on the current code and passes with the fix. Once the pull request for Associate wizard form labels with their conditional input controls #950 lands, the controller harness in tests/site/wizard_harness.cjs (bootWizard) can open the step, press Next and type into the field.

Activity

  1. added
    bug
    on Oct 16, 2026
  2. added a commit that references this issue on Oct 16, 2026
    abd9fd0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions