Skip to content

fix(frontend): Surface grader validation errors in test workspace#151

Merged
mattbrailsford merged 3 commits into
devfrom
feature/test-grader-validation-feedback
May 6, 2026
Merged

fix(frontend): Surface grader validation errors in test workspace#151
mattbrailsford merged 3 commits into
devfrom
feature/test-grader-validation-feedback

Conversation

@mattbrailsford
Copy link
Copy Markdown
Contributor

@mattbrailsford mattbrailsford commented May 6, 2026

Summary

  • Saving a test without graders previously showed only an "x" on the save button — no on-form indication of the failed rule.
  • uai-grader-config-builder now renders an invalid placeholder color and validation message once the user has submitted (driven by pristine === false && validity.valid === false).
  • The Grading workspace tab gets a red ! hint badge when the $.graders validation message is present, so users land on the right tab even if they were elsewhere when they hit save.

Changes

  • grader-config-builder.element.ts: render invalid styling + message text when invalid and not pristine.
  • test-grading-workspace-view.element.ts: drop unused UmbFormControlMixin plumbing; bind builder via umbBindToValidation(this, "$.graders", value).
  • test-workspace.context.ts: observe messagesOfPathAndDescendant("$.graders") and mirror messages into view.hints for the Grading tab; cleared automatically when the message list shrinks.
  • constants.ts / manifests.ts: lift Grading view alias into UAI_TEST_WORKSPACE_VIEW_GRADING_ALIAS so the context and the manifest share the same source.

Test plan

  • Open the test workspace for a new test, click save without adding any graders. Verify the save button shows error state.
  • Confirm the Grading tab now shows a red ! badge.
  • Switch to the Grading tab — verify the add-grader button is rendered with invalid color and the required message ("At least one grader is required" / localized) is shown beneath it.
  • Add a grader, confirm the badge clears and the invalid styling is removed.
  • Save successfully and confirm normal workflow still works.

Fixes: #145

🤖 Generated with Claude Code

mattbrailsford and others added 3 commits May 6, 2026 08:05
Saving a test without graders failed silently — the save button showed
an x but no feedback indicated where the validation rule lived. The
grader builder now renders an invalid state with the required message
when the user attempts to save, and the Grading workspace tab shows a
red badge so users on a different tab know which view to visit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ss tabs

The custom in-component validation message duplicated the one already
rendered by umb-property-layout's umb-form-validation-message.
Additionally, the form-control binding only registered when the Grading
view was mounted, so saving from the Settings tab never produced a
hint badge on Grading.

Drops the redundant message div and adds a workspace-level
UmbValueValidator that always runs against the model's graders, so the
tab hint reflects validity regardless of which view is open.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Prefix the workspace-level grader validation message with `#` so it is
resolved through the Umbraco localization system rather than stored as
a literal string in the validation context.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mattbrailsford mattbrailsford merged commit a9368ae into dev May 6, 2026
0 of 3 checks passed
@mattbrailsford mattbrailsford deleted the feature/test-grader-validation-feedback branch May 6, 2026 08:47
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.

[Tests] Cannot save new test - save button does not submit when all required fields are filled

1 participant