From 110b655d5e32baee2cdda2f35e2dfbfc8446a44a Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Wed, 30 Sep 2026 00:09:22 -0500 Subject: [PATCH 1/4] Mark the message (and a request's name) as required on the forms The send button waits for 10 characters of message; the field now says Required, and a note under it counts down what's still needed. The request form's name field is marked too. Co-Authored-By: Claude Opus 5.5 --- src/pages/sections/FeedbackForm.tsx | 26 ++++++++++++++++++++++++-- src/pages/sections/RequestForm.tsx | 7 +++++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/pages/sections/FeedbackForm.tsx b/src/pages/sections/FeedbackForm.tsx index 0ced647..ec31dac 100644 --- a/src/pages/sections/FeedbackForm.tsx +++ b/src/pages/sections/FeedbackForm.tsx @@ -51,6 +51,26 @@ export function OptionalTag() { ); } +/* On a field the send button waits for. */ +export function RequiredTag() { + return ( + + Required + + ); +} + +/* Under a message box: how many more characters it needs, until it + has them (the send button stays off until then). */ +export function MinimumNote({ length, min }: { length: number; min: number }) { + if (length >= min) return null; + return ( + + {length === 0 ? `At least ${min} characters` : `${min - length} more character${min - length === 1 ? "" : "s"} needed`} + + ); +} + export function FieldError({ id, children }) { if (!children) return null; return ( @@ -356,6 +376,7 @@ export default function FeedbackForm({ fixedType }: { fixedType?: string } = {}) className="text-base font-semibold text-body" > {request ? "Your request" : "Tell us more"} +

{request @@ -381,6 +402,7 @@ export default function FeedbackForm({ fixedType }: { fixedType?: string } = {}) />

{fieldErrors.message} + {!fieldErrors.message && } {request - ? "Write at least a sentence and give an email address to send." - : "Choose a type and write at least a sentence to send."} + ? `Write at least ${MIN_MESSAGE} characters and give an email address to send.` + : `Choose a type and write at least ${MIN_MESSAGE} characters to send.`}

)}
diff --git a/src/pages/sections/RequestForm.tsx b/src/pages/sections/RequestForm.tsx index 7df43ad..5e90291 100644 --- a/src/pages/sections/RequestForm.tsx +++ b/src/pages/sections/RequestForm.tsx @@ -22,7 +22,7 @@ import { ApiError, upload } from "../../lib/api.ts"; import { accentText, BRAND } from "../../lib/color.ts"; import { REQUEST_FILES } from "../../lib/site.ts"; import { REQUEST_TYPES, type RequestAction } from "../../data/requestTypes.ts"; -import { FieldError, OptionalTag, TilePicker, errorFieldClass, fieldClass } from "./FeedbackForm.tsx"; +import { FieldError, MinimumNote, OptionalTag, RequiredTag, TilePicker, errorFieldClass, fieldClass } from "./FeedbackForm.tsx"; const MUTED = "var(--color-muted)"; const MAX_CHARS = 5000; @@ -206,6 +206,7 @@ export default function RequestForm() {