From 42f26acb49da24e657ce324be551dd5c719ffbc9 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 23:29:10 +0000 Subject: [PATCH] Add FormDescription hints across fields Enhance forms by adding descriptive hints (with examples) to all fields (website URLs, heights, speeds, lengths, etc.) using the existing enhanced validation system. Includes updating ParkForm and RideForm to display field-specific guidance (and field hints for URLs, measurements, and submission notes), leveraging field hints generated from enhancedValidation. --- src/components/admin/ParkForm.tsx | 7 +++++-- src/components/admin/RideForm.tsx | 13 +++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/admin/ParkForm.tsx b/src/components/admin/ParkForm.tsx index d8f83f8e..fb8cdbcf 100644 --- a/src/components/admin/ParkForm.tsx +++ b/src/components/admin/ParkForm.tsx @@ -617,6 +617,7 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }: {...register('website_url')} placeholder="https://..." /> +

{fieldHints.websiteUrl}

{errors.website_url && (

{errors.website_url.message}

)} @@ -629,6 +630,7 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }: {...register('phone')} placeholder="+1 (555) 123-4567" /> +

{fieldHints.phone}

@@ -639,6 +641,7 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }: {...register('email')} placeholder="contact@park.com" /> +

{fieldHints.email}

{errors.email && (

{errors.email.message}

)} @@ -670,7 +673,7 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }: placeholder="https://example.com/article" />

- Where did you find this information? (e.g., official website, news article, press release) + {fieldHints.sourceUrl}

{errors.source_url && (

{errors.source_url.message}

@@ -692,7 +695,7 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }: maxLength={1000} />

- {watch('submission_notes')?.length || 0}/1000 characters + {fieldHints.submissionNotes} ({watch('submission_notes')?.length || 0}/1000 characters)

{errors.submission_notes && (

{errors.submission_notes.message}

diff --git a/src/components/admin/RideForm.tsx b/src/components/admin/RideForm.tsx index 8de50a0c..17b65cee 100644 --- a/src/components/admin/RideForm.tsx +++ b/src/components/admin/RideForm.tsx @@ -775,10 +775,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }: {...register('height_requirement', { setValueAs: (v) => v === "" ? undefined : parseFloat(v) })} placeholder={measurementSystem === 'imperial' ? 'e.g. 47' : 'e.g. 120'} /> -
- -

Minimum height to ride. Values automatically convert to {measurementSystem === 'imperial' ? 'inches' : 'cm'}.

-
+

{fieldHints.heightRequirement}

@@ -1370,6 +1367,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }: {...register('capacity_per_hour', { setValueAs: (v) => v === "" ? undefined : parseFloat(v) })} placeholder="e.g. 1200" /> +

{fieldHints.capacity}

@@ -1381,6 +1379,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }: {...register('duration_seconds', { setValueAs: (v) => v === "" ? undefined : parseFloat(v) })} placeholder="e.g. 180" /> +

{fieldHints.duration}

@@ -1393,6 +1392,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }: {...register('max_speed_kmh', { setValueAs: (v) => v === "" ? undefined : parseFloat(v) })} placeholder={measurementSystem === 'imperial' ? 'e.g. 50' : 'e.g. 80.5'} /> +

{fieldHints.speed}

@@ -1428,6 +1428,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }: {...register('inversions', { setValueAs: (v) => v === "" ? undefined : parseFloat(v) })} placeholder="e.g. 7" /> +

{fieldHints.inversions}

@@ -1481,7 +1482,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }: placeholder="https://example.com/article" />

- Where did you find this information? (e.g., official website, news article, press release) + {fieldHints.sourceUrl}

{errors.source_url && (

{errors.source_url.message}

@@ -1503,7 +1504,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }: maxLength={1000} />

- {watch('submission_notes')?.length || 0}/1000 characters + {fieldHints.submissionNotes} ({watch('submission_notes')?.length || 0}/1000 characters)

{errors.submission_notes && (

{errors.submission_notes.message}