Skip to content

Limit Event description field to 200 characters (#1099)#1150

Open
rustynwac wants to merge 1 commit into
mainfrom
claude/event-description-limit-1099
Open

Limit Event description field to 200 characters (#1099)#1150
rustynwac wants to merge 1 commit into
mainfrom
claude/event-description-limit-1099

Conversation

@rustynwac

@rustynwac rustynwac commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Description

Long event descriptions overflow the event preview UI (see #1099). This caps the Events description field 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 — add maxLength: 200 to the description textarea and change its admin description from "Short description/summary for event previews" to "Short description/summary for event previews. Limit 200 characters.". Payload enforces maxLength both 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 on Event.description.

How to test

  1. pnpm seed, open localhost:3000/admin, create/edit an Event.
  2. The Description field shows the "Limit 200 characters." helper text; entering more than 200 characters fails validation on save.

Automated / verification:

  • pnpm tsc, pnpm lint, pnpm test (525 passing), pnpm fallow:audit — all clean.
  • pnpm payload migrate:create reports no schema changes (maxLength is validation-only; the SQLite column is unchanged), so no migration is included.
  • Ran a throwaway Local API script against a seeded DB: a 200-char description is accepted and a 201-char description is rejected (The following field is invalid: Description).

Migration Explanation

None required — maxLength adds validation only and does not alter the database schema.

Future enhancements / Questions

  • The Courses collection has a description field 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.
  • ⚠️ Drift note: docs/events-and-courses.md is drift-bound to Events/index.ts, so the drift check will flag it as stale from this change. The doc prose is still accurate (it lists description as 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 the drift binary isn't installed there and couldn't be fetched.

🤖 Generated with Claude Code

https://claude.ai/code/session_016s7MJjeP8Mr3KRiRA22WwJ


Generated by Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

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
@github-actions

Copy link
Copy Markdown
Contributor

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.

Field limit on Event Description field

2 participants