mirror of
https://github.com/temetro/temetro.git
synced 2026-09-04 23:05:35 +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.6 KiB
1.6 KiB
coss Avatar
When to use
- Identity visuals for users/teams in compact spaces.
- Image + fallback initials patterns in cards, lists, and menus.
Install
npx shadcn@latest add @coss/avatar
Manual deps from docs:
npm install @base-ui/react
Canonical imports
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
Minimal pattern
<Avatar>
<AvatarImage src="/avatars/01.png" alt="User avatar" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
Patterns from coss particles
Key patterns
Custom size via Tailwind class:
<Avatar className="size-16">
<AvatarImage src="/avatar.png" alt="User avatar" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
Stacked avatar group:
<div className="flex -space-x-3">
<Avatar className="ring-2 ring-background">
<AvatarImage src="/user-1.png" alt="User 1" />
<AvatarFallback>U1</AvatarFallback>
</Avatar>
<Avatar className="ring-2 ring-background">
<AvatarImage src="/user-2.png" alt="User 2" />
<AvatarFallback>U2</AvatarFallback>
</Avatar>
</div>
More examples
See p-avatar-1 through p-avatar-5 for sizes, radii, fallback-only, and group patterns.
Common pitfalls
- Omitting
AvatarFallback, causing broken image states with no identity fallback. - Using non-descriptive
alttext onAvatarImagein accessible contexts. - Relying on oversized custom wrappers instead of built-in size variants/classes.
Useful particle references
- fallback only:
p-avatar-2 - different sizes:
p-avatar-3 - different radius:
p-avatar-4 - group avatars:
p-avatar-5