From 694c2a2292de3167e9e8213cb500eb9fe58c9ba5 Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 9 Nov 2026 16:07:42 +0200 Subject: [PATCH] Improve book-in form field clarity Restyle booking fields as high-contrast cards, add visible required/optional indicators and ARIA requirements, and make lookup and form errors more prominent. --- .../repairs-app/book-in-form.tsx | 98 ++++++++++++++----- 1 file changed, 73 insertions(+), 25 deletions(-) diff --git a/src/app/(repairs-app)/repairs-app/book-in-form.tsx b/src/app/(repairs-app)/repairs-app/book-in-form.tsx index 9129630..4283bbb 100644 --- a/src/app/(repairs-app)/repairs-app/book-in-form.tsx +++ b/src/app/(repairs-app)/repairs-app/book-in-form.tsx @@ -16,6 +16,28 @@ import type { Customer, Supplier } from "@/lib/types"; /** Ten photos is plenty for one booking. */ const MAX_PHOTOS = 10; +/** Fields stand out from their card: white well, firm border. */ +const FIELD = + "min-h-[56px] border-2 border-foreground/30 bg-background text-base shadow-sm focus-visible:border-primary"; +const AREA = + "border-2 border-foreground/30 bg-background text-base shadow-sm focus-visible:border-primary"; +const PICKER = + "min-h-[56px] w-full border-2 border-foreground/30 bg-background text-base shadow-sm"; +const CARD = "space-y-2 rounded-2xl border border-foreground/15 bg-muted/60 p-4 shadow-sm"; + +/** Says out loud whether a field has to be filled in. */ +function Tag({ required }: { required?: boolean }) { + return required ? ( + + Required + + ) : ( + + Optional + + ); +} + type Lookups = { customers: Customer[]; suppliers: Supplier[] }; /** @@ -239,8 +261,11 @@ export function BookInForm() { Photos first: the machine is in front of you when you start, and the photo is the one thing the form will not book in without. */} -
- +
+
+ + +

Take a photo of the machine as it arrived.

@@ -257,7 +282,7 @@ export function BookInForm() { )} {lookupsError?.which === "customer" ? ( -

+

{lookupsError.message}

) : null}
-
- +
+
+ + +
setMachine(e.target.value)} placeholder="e.g. Welding machine" - className="min-h-[56px] text-base" + className={FIELD} />
-
- +
+
+ + +
setSerialNo(e.target.value)} placeholder="e.g. WM-9" - className="min-h-[56px] text-base" + className={FIELD} />
-
- +
+
+ + +