Missing optional fields show "Not provided" or "Suggest an edit", not broken UI
Why it matters
Rendering a literal undefined or an empty <p> tag in place of a missing field makes the listing look broken and signals to users that the directory does not maintain its data. Empty gaps collapse layout, CLS scores rise, and users lose confidence that any field on the page is reliable. An explicit Not provided with a Suggest an edit call-to-action converts the absence into a contribution opportunity, which is how crowd-sourced directories keep fields populated over time.
Severity rationale
High because broken UI and visible `undefined` strings erode trust on the canonical listing view users land on from search.
Remediation
Guard every optional field render with a truthiness check and decide between hiding the row or showing a suggest-an-edit prompt. Standardize the fallback in a small FieldOrSuggest component so the copy and link stay consistent across the detail page at src/components/listings/field-or-suggest.tsx.
export function FieldOrSuggest({ value, label, slug }: Props) {
if (value) return <p><strong>{label}:</strong> {value}</p>
return (
<p className="text-gray-500">
{label} not provided · <a href={`/listings/${slug}/suggest-edit`}>Suggest one</a>
</p>
)
}
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Listing Data & Schema Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from directory-listing-schema·automated