From 30156ebd60ef9319986e89a26bdfc20a4be52412 Mon Sep 17 00:00:00 2001 From: Daniel Volz Date: Sun, 28 Dec 2025 13:51:57 +0100 Subject: [PATCH] feat(ui): increase notes character limit to 2000 and add auto-resize functionality for textareas --- backend/src/routes/medications.ts | 2 +- frontend/src/App.tsx | 14 +++++++++-- frontend/src/styles.css | 42 +++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/backend/src/routes/medications.ts b/backend/src/routes/medications.ts index ef31f4c..2af7a5c 100644 --- a/backend/src/routes/medications.ts +++ b/backend/src/routes/medications.ts @@ -28,7 +28,7 @@ const medicationSchema = z.object({ looseTablets: z.number().int().min(0).default(0), pillWeightMg: z.number().int().min(1).nullable().optional(), expiryDate: z.string().nullable().optional(), - notes: z.string().max(500).nullable().optional(), + notes: z.string().max(2000).nullable().optional(), intakeRemindersEnabled: z.boolean().default(false), blisters: z.array(blisterSchema).min(1).max(12), }); diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 21f119c..3bb5be4 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1482,7 +1482,9 @@ function AppContent() { onChange={(e) => handleValueChange("notes", e.target.value)} placeholder={t('form.placeholders.notes')} rows={2} - maxLength={500} + maxLength={2000} + className="auto-resize" + onInput={(e) => { const t = e.target as HTMLTextAreaElement; t.style.height = 'auto'; t.style.height = t.scrollHeight + 'px'; }} /> @@ -2450,7 +2452,15 @@ function AppContent() {