Display server validation field errors inline in forms#126
Draft
Copilot wants to merge 3 commits intofix-validation-errorsfrom
Draft
Display server validation field errors inline in forms#126Copilot wants to merge 3 commits intofix-validation-errorsfrom
Copilot wants to merge 3 commits intofix-validation-errorsfrom
Conversation
Agent-Logs-Url: https://github.com/medium-tech/mspec/sessions/3730ceb5-8473-4879-ab95-1b08c9e56d0b Co-authored-by: b-rad-c <25362581+b-rad-c@users.noreply.github.com>
Agent-Logs-Url: https://github.com/medium-tech/mspec/sessions/3730ceb5-8473-4879-ab95-1b08c9e56d0b Co-authored-by: b-rad-c <25362581+b-rad-c@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update UI to display validation error response from server
Display server validation field errors inline in forms
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the server returns a
VALIDATION_ERROR(HTTP 400), the UI now shows per-field error messages in the third column of the form table (red, bold) in addition to the existing status-area message.Changes
browser2/js/src/markup.jscrud.create/crud.update: Extractfield_errorsfromVALIDATION_ERRORresponses; always includefield_errors: {}in all return objects (clears errors on success/network error)createFormElement: After rendering each field row, append aspan.field-errorwith the field's error message ifcurrentState.field_errors[fieldKey]is setbrowser2/js/src/style.css.field-error { color: red; font-weight: bold; }Page spec state defaults
builtin-mapp-model.json→create_model_state: addedfield_errors: {}builtin-mapp-model-instance.json→model_instance: addedfield_errors: {}Both are required so the lingo state type system accepts
field_errorsas a valid struct field when CRUD responses set it. Field errors are cleared automatically on successful create/update.Tests (
templates/mapp-py/tests/crud.spec.js,templates/sosh-net/tests/crud.spec.js)Added
test validation errors are displayed in form: mocks aVALIDATION_ERRORPOST response withfield_errors, submits the form, and asserts both the status message and.field-errorspan are visible with the correct content.Example response handled
{ "error": { "code": "VALIDATION_ERROR", "message": "This model has failed validation", "field_errors": { "x_bool": "Must be a boolean value", "x_int": "Must be an integer" } } }Each key in
field_errorsmaps to its form row's third column; fields without an entry show their description as before.