Skip to content

Add validation to settings forms - #361

Closed
vibhorgupta96 wants to merge 1 commit into
truefoundry:mainfrom
vibhorgupta96:codex/issue-359-form-validations
Closed

vibhorgupta96 wants to merge 1 commit into
truefoundry:mainfrom
vibhorgupta96:codex/issue-359-form-validations

Conversation

@vibhorgupta96

@vibhorgupta96 vibhorgupta96 commented Aug 19, 2026 •

Copy link
Copy Markdown

Summary

Add consistent client-side validation to settings forms so invalid values are rejected before submission and actionable errors appear beside the affected fields. Server-side schemas remain authoritative and independently enforced.

Closes #359

Changes

  • add shared accessible field-error and touched-state helpers for settings forms
  • validate required values, URLs, resource identifiers, git fields, HTTP header names, numeric ranges, and duplicate names or models
  • cover MCP servers, connector credentials, model providers, sandbox providers, and GitHub skill imports
  • add focused component and validation tests plus a patch changeset for @truefoundry/trueforge-ui

Screenshot

Inline validation errors in the Add MCP server form

How was this tested?

  • pnpm build
  • pnpm test
  • pnpm typecheck
  • pnpm format:check
  • pnpm --filter @truefoundry/trueforge-ui lint
  • git diff --check

pnpm lint:ci still reports eight errors in five untouched backend files: the four catalog implementations under packages/trueforge/src/catalog and packages/trueforge/src/sandbox/local/core/CodeModeUdsTransport.ts. The changed UI source and tests pass the scoped package lint command.

Checklist

  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally (all pass except the unrelated root lint errors noted above)
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed (not applicable; no configuration interface changed)

@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f261947

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-ui Patch
frontend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@innoavator

innoavator commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for sending this PR @vibhorgupta96. Can you please add screenshots with the validation error messages? cc @sajal-truefoundry @govindavashishtha to review futher.

@vibhorgupta96

Copy link
Copy Markdown
Author

Added a screenshot to the PR description showing the inline validation messages and disabled submission state in the Add MCP server form.

@chiragjn chiragjn added the ui label Aug 21, 2026
@sajal-truefoundry

Copy link
Copy Markdown
Contributor

It's in the roadmap to bring validations on the UI. But we cannot keep the mappings on FE.
We'll come up with a way for the BE to send proper validation schema so that both FE and BE have a common source of truth as well as it's easier to maintain.

@vibhorgupta96

Copy link
Copy Markdown
Author

Hi @sajal-truefoundry , the issue #359 clearly mentions that "Server-side validation still enforced independently"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add form validations

4 participants