mirror of
https://github.com/temetro/temetro.git
synced 2026-08-31 04:47:57 +00:00
929bec8f31
Stop blocking AI imports/proposals on missing non-critical fields. Records the chat agent drafts now save with safe placeholders, auto-generated file numbers, and a source="ai" marker that surfaces an "Added by AI" badge so a clinician can review/edit them later. Backend: - add `source` (manual|ai) column to patients/appointments/prescriptions (migration 0014) + canonical types, services, validation schemas - relax patient/appointment validation: empty file number allowed, demographic + type/provider/initials fall back to placeholders (initials derived from name) - patients.generateFileNumber() auto-assigns an MRN when one is missing - proposeAppointment accepts a name when no file number resolves; AI commits + /api/ai/import stamp source="ai" Frontend: - `source` on Appointment/Patient/Prescription types; AI commits send source="ai" - reusable <AiBadge> shown on the Patients table/detail and prescriptions list Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.9 KiB
1.9 KiB
coss Textarea
When to use
- Multi-line text entry (notes, feedback, descriptions).
- Comment/message inputs where text length is variable.
Install
npx shadcn@latest add @coss/textarea
Manual deps from docs:
npm install @base-ui/react
Canonical imports
import { Textarea } from "@/components/ui/textarea"
Minimal pattern
<Textarea aria-label="Message" placeholder="Write your message" />
For form fields, prefer wrapping Textarea with Field + FieldLabel + FieldError so labels, validation, and errors stay semantically linked.
Textarea already wraps Base UI Field.Control internally, so it works as a form control directly inside Field (no need to manually use FieldControl + render just to mount a textarea).
Patterns from coss particles
Key patterns
Textarea in a field with label:
<Field name="bio">
<FieldLabel>Bio</FieldLabel>
<Textarea placeholder="Tell us about yourself..." />
<FieldDescription>Max 500 characters.</FieldDescription>
<FieldError />
</Field>
Sizes: sm, default, lg on Textarea.
Textarea wraps Base UI Field.Control internally, so it works as a form control directly inside Field.
More examples
See p-textarea-1 through p-textarea-6 for sizes, disabled, label, and form integration patterns.
Common pitfalls
- Using textarea when a constrained single-line input is expected.
- Missing labels/descriptions for required long-form fields.
- Forgetting explicit submit button type handling in textarea forms.
- Using
FieldControl render={<textarea .../>}for basic textarea fields whenTextareaalready provides the correct control integration.
Useful particle references
- small size:
p-textarea-2 - large size:
p-textarea-3 - disabled:
p-textarea-4 - with label:
p-textarea-5 - form integration:
p-textarea-6