Skip to content

Preserve the non-blank label invariant for generated field insertion #287

Description

@brylie

Problem

insertCollectionField(..., { generateUniqueLabel: true }) normalizes a generated label through nextAvailableFieldLabel but does not reject a blank normalized base. A future caller can therefore persist an empty field label, bypassing the Collection schema invariant introduced by #205.

The current FieldMenu caller passes "New field", so this is not user-reachable in the released UI. It remains a data-layer correctness gap.

Outcome

Generated field insertion preserves the same non-blank, trimmed, case-insensitive unique-label contract as every other field write.

Acceptance criteria

  • A whitespace-only label with generateUniqueLabel: true throws ValidationError("Field label cannot be blank").
  • The failed transaction leaves the Collection schema unchanged.
  • Repeated non-blank generated insertion continues to produce New field, New field 2, and so on.

Evidence

Activity

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

    No labels
    No labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions