concrete/contract/cap
Every generated text value has one character budget, declared on its slot, and a fill cap may only be lower.
Every generated text value has one character budget, declared on its slot, and a fill cap may only be lower.
Graded by the contracts stage of concrete check, in the contract venue. A violation reports this id and the file it failed at — see every rule and concrete check.
Reason
A text value's character budget is one number, and it lives on the kind: the editor
bounds what a user may type by it, and the model filling the slot is asked to write
to it. A filled text slot — or a written list's item: text.short({ cap }) — that
declares no cap leaves both of them guessing, so the budget is required rather than
defaulted.
No fill takes a cap of its own: the budget is the kind's, stated once. A section
built by a Concrete older than 9.0 may still carry one on its decision, and it is
graded as it always was — legal only strictly below the slot's, because one above
it is prose the executor trims away at fill time, invisibly, and one equal to it is a
restatement, and a restated number is one that drifts. A stored cap on a fill that
writes no characters — a pick of keys, photos or rows, a find of places, or a
list of objects at its own level — or that writes a url, date, email or
phone, whose form bounds its length, is an option nothing honours, and is refused
rather than ignored. An object item's text fields each take their own.
Check-caught. cap is an ordinary numeric option on the slot, so a missing budget is
not a type error.
Fix
Declare cap on the text slot, or on a written
list's item (item: text.short({ cap: 40 })). A stored fill's own cap
goes: lower the slot's instead, or say the shorter length in the brief.
Before and after
import { fact, fill, text } from "@homepages/concrete";
text.medium({
label: "Headline",
source: fill.write({
reads: [fact.property.address, fact.property.description],
brief: "A marketing headline in one sentence. Confident, no exclamation marks.",
}),
});import { fact, fill, text } from "@homepages/concrete";
text.medium({
label: "Headline",
cap: 60,
source: fill.write({
reads: [fact.property.address, fact.property.description],
brief: "A marketing headline in one sentence. Confident, no exclamation marks.",
}),
});