Limit Event description field to 200 characters (#1099)#1150
Open
rustynwac wants to merge 1 commit into
Open
Conversation
Long event descriptions overflow the event preview UI. Cap the Events `description` textarea at 200 characters via Payload's maxLength (enforced in the admin and on save) and update the field's admin description to "Short description/summary for event previews. Limit 200 characters." No migration: maxLength is validation-only and does not change the SQLite column (migrate:create reports no schema changes). The regenerated payload-types.ts picks up the new field description as a JSDoc comment. Fixes #1099 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016s7MJjeP8Mr3KRiRA22WwJ
Contributor
|
Preview deployment: https://claudexevent-description-limit-1099.preview.avy-fx.org |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Long event descriptions overflow the event preview UI (see #1099). This caps the Events
descriptionfield at 200 characters and updates the field's admin helper text so editors know the limit up front.Related Issues
Fixes #1099
Key Changes
src/collections/Events/index.ts— addmaxLength: 200to thedescriptiontextarea and change its admin description from"Short description/summary for event previews"to"Short description/summary for event previews. Limit 200 characters.". Payload enforcesmaxLengthboth in the admin UI and on save (Local/REST API).src/payload-types.ts— regenerated; the field's admin description flows through as the JSDoc comment onEvent.description.How to test
pnpm seed, openlocalhost:3000/admin, create/edit an Event.Automated / verification:
pnpm tsc,pnpm lint,pnpm test(525 passing),pnpm fallow:audit— all clean.pnpm payload migrate:createreports no schema changes (maxLength is validation-only; the SQLite column is unchanged), so no migration is included.The following field is invalid: Description).Migration Explanation
None required —
maxLengthadds validation only and does not alter the database schema.Future enhancements / Questions
Coursescollection has adescriptionfield with the same original helper text but was left unchanged, since this issue is specifically about Events. Happy to apply the same cap there if wanted.docs/events-and-courses.mdis drift-bound toEvents/index.ts, so the drift check will flag it as stale from this change. The doc prose is still accurate (it listsdescriptionas a field but doesn't document length constraints), so it just needs a re-link:drift link docs/events-and-courses.md src/collections/Events/index.ts --doc-is-still-accurate. I couldn't run this in my environment because thedriftbinary isn't installed there and couldn't be fetched.🤖 Generated with Claude Code
https://claude.ai/code/session_016s7MJjeP8Mr3KRiRA22WwJ
Generated by Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.