fix(dashboard): remove 10k character limit on proposal description - #2101
fix(dashboard): remove 10k character limit on proposal description#2101alextnetto wants to merge 1 commit into
Conversation
The create-proposal body field rejected descriptions over 10,000 characters at three layers: the zod schema, the canPublish gate, and the editor's limit counter. Long governance proposals were blocked from being published. The limit is removed; the editor footer now shows a plain character count.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db75781b4c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| }, "Must be a valid URL"), | ||
| body: z.string().min(1, "Required").max(10_000, "10,000 character limit"), | ||
| body: z.string().min(1, "Required"), |
There was a problem hiding this comment.
Align body validation with the draft storage limit
When a description exceeds 100,000 characters, this schema now accepts it and the form enables Save Draft and Share, but both operations send the body to the User API, whose CreateDraftBodySchema and UpdateDraftBodySchema still enforce BODY_MAX = 100_000 (apps/user-api/src/mappers/drafts/index.ts:51,59,68). Those users receive only the generic “Could not save draft” error and cannot share their otherwise-valid proposal; retain the service ceiling in the form or update the persistence contract alongside this change.
Useful? React with 👍 / 👎.
|
🚅 Deployed to the anticapture-pr-2101 environment in anticapture-infra
|
🎨 UI Review
Create Proposal form — Body fieldQuestion for author — this hotfix reverts a documented, acceptance-criteria-level product decision —
This PR removes exactly that: the Nice-to-have — the counter now gives zero feedback at any length — MobileNo layout or responsive-relevant code in this diff (only a validation rule and a counter's color logic changed) — nothing new to verify here. Design-system adherenceNo issues — the diff only removes conditional Tailwind classes on an existing Scope noteThis is a UI-only review (copy/product-fidelity vs. the linked spec, DS adherence, UX) — architecture, validation-layer design, and other code-quality concerns are left to the code reviewer. Generated by Claude Code |
|
🔍 Vercel preview: https://anticapture-3r6fw6c3i-ful.vercel.app |
Summary
Hotfix: the create-proposal form blocked proposal descriptions over 10,000 characters, preventing long governance proposals from being published. The limit is removed — the description now has no client-side length cap.
Changes
schema.ts— dropped.max(10_000)from thebodyfield validationProposalCreationForm.tsx— removed the<= 10_000condition from thecanPublishgateBodyField.tsx— replaced thex / 10,000limit counter (with warning/error colors) with a plain character countconstants.ts— removed the now-unusedBODY_CHAR_LIMITandBODY_WARNING_THRESHOLDschema.test.ts— flipped the limit test to assert bodies over 10k are acceptedNote for reviewers
The user-api drafts endpoint still caps
bodyat 100,000 characters (BODY_MAXinapps/user-api/src/mappers/drafts/index.ts) as a payload-size safeguard on the drafts store. That cap was left in place — it only affects saving drafts, not publishing, and removing a server-side abuse guard felt out of scope for this hotfix. Flag if it should go too.Verification
pnpm dashboard typecheck✅pnpm dashboard lint✅pnpm dashboard test— 44 suites, 266 tests, all passing ✅