Skip to content

fix: focus invalid HTTP target field after validation failure - #3831

Merged
Richard Lundeen (richlundeen) merged 7 commits into
microsoft:mainfrom
mikemikimike:codex/3710-a11y-error
Nov 11, 2026
Merged

Richard Lundeen (richlundeen) merged 7 commits into
microsoft:mainfrom
mikemikimike:codex/3710-a11y-error

Conversation

@mikemikimike

Copy link
Copy Markdown
Contributor

Summary

  • Focus the Http Request field after an HTTPTarget HTTP 400 and associate the server validation detail with that field.
  • Preserve a focused form-level alert for other failures, clear stale field errors when the request is edited, and prevent target-type changes while submission is pending.
  • Add a keyboard regression for invalid input, recovery, and a non-field HTTP 500 error.

Testing

  • npm test -- --runInBand (172 suites, 4,039 tests passed)
  • npm run test:coverage -- --runInBand (172 suites, 4,039 tests passed)
  • npm run type-check
  • npm run lint
  • npm run build
  • Playwright e2e/config.spec.ts and e2e/accessibility.spec.ts (30 tests passed)

Issue: #3710

Fixes #3710

Copilot AI balanced review requested due to automatic review settings November 2, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A stale HTTP request error can hide the current fractional-rate validation error and focus the wrong field because it is not cleared when metadata validation fails.

1 open issue
What changed in this PR

This PR addresses #3710 by improving keyboard focus and accessible validation feedback in the target-creation dialog.

Changes:

  • Associates HTTPTarget HTTP 400 errors with the Http Request field and focuses it; other failures use a focused form-level alert.
  • Clears stale request errors on edits and disables target-type changes during submission.
  • Adds regression coverage for keyboard submission, field-error recovery, and HTTP 500 handling.
File Description
frontend/​src/​components/​Parameters/​ParameterField.tsx Supports external validation messages and a multiline-control focus ref.
frontend/​src/​components/​Config/​CreateTargetDialog.tsx Connects validation errors to focus handling and guards pending submissions.
frontend/​src/​components/​Config/​CreateTargetDialog.test.tsx Tests error accessibility, focus, recovery, and disabled controls.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.

@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Nov 11, 2026
Merged via the queue into microsoft:main with commit 16a00a9 Nov 11, 2026
58 checks passed
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.

Target creation failure drops keyboard focus and does not announce the error

3 participants