Skip to content

fix(core): show field label in default preview for long values - #8091

Open
sap1110 wants to merge 1 commit into
decaporg:mainfrom
sap1110:7532-preview-label-long-value
Open

sap1110 wants to merge 1 commit into
decaporg:mainfrom
sap1110:7532-preview-label-long-value

Conversation

@sap1110

@sap1110 sap1110 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Summary

In the default preview (no custom preview template), string/text/number fields only got their "Label:" prefix when the value was shorter than 50 characters, so longer values like URLs showed up without a label. Removed that length check so the label is always shown.

One side effect worth mentioning: long text values (like paragraphs) now also get the label in front. If you'd rather keep the old behaviour for the text widget I can limit this to string and number.

fixes #7532

Test plan

  • Ran the dev-test site and opened a new Kitchen Sink entry (no preview template). Put a ~66 char URL in the Text field: on main the preview shows just the URL, with this change it shows Text: <url>. Number field keeps its label either way.
  • pnpm run lint-quiet, pnpm run type-check and the Editor unit tests pass, no snapshot changes.

Checklist

The default preview only added the "Label:" prefix to string, text and
number fields when the value was under 50 characters, so longer values
like URLs showed up without their label.

Fixes decaporg#7532
@sap1110
sap1110 requested a review from a team as a code owner November 19, 2026 10:47
@netlify

netlify Bot commented Nov 19, 2026

Copy link
Copy Markdown

👷 Deploy request for decap-cms pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit e62265c

This branch has not been deployed

No deployments
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.

Collection label disappears when value is too long

1 participant