mirror of
https://github.com/temetro/temetro.git
synced 2026-08-29 11:56:54 +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>
73 lines
1.5 KiB
Markdown
73 lines
1.5 KiB
Markdown
# coss Progress
|
|
|
|
## When to use
|
|
|
|
- Task completion and async operation progress bars.
|
|
- Indeterminate or determinate status during loading pipelines.
|
|
|
|
## When NOT to use
|
|
|
|
- If displaying a bounded measurement (not task completion) -> use Meter instead.
|
|
- If the loading state is indeterminate with no percentage -> consider Spinner.
|
|
|
|
## Install
|
|
|
|
```bash
|
|
npx shadcn@latest add @coss/progress
|
|
```
|
|
|
|
Manual deps from docs:
|
|
|
|
```bash
|
|
npm install @base-ui/react
|
|
```
|
|
|
|
## Canonical imports
|
|
|
|
```tsx
|
|
import {
|
|
Progress,
|
|
ProgressLabel,
|
|
ProgressValue,
|
|
} from "@/components/ui/progress"
|
|
```
|
|
|
|
## Minimal pattern
|
|
|
|
```tsx
|
|
<Progress value={40} />
|
|
```
|
|
|
|
## Patterns from coss particles
|
|
|
|
### Key patterns
|
|
|
|
Progress with label and value display:
|
|
|
|
```tsx
|
|
<Progress value={60}>
|
|
<div className="flex justify-between text-sm">
|
|
<ProgressLabel>Uploading...</ProgressLabel>
|
|
<ProgressValue />
|
|
</div>
|
|
</Progress>
|
|
```
|
|
|
|
Determinate progress: bind a numeric `value` (0-100) for known completion states.
|
|
Indeterminate loading: omit `value` or pass `null` when progress cannot be measured.
|
|
|
|
### More examples
|
|
|
|
- with label and value: `p-progress-2`
|
|
- with formatted value: `p-progress-3`
|
|
|
|
## Common pitfalls
|
|
|
|
- Using progress without text/context for what operation is progressing.
|
|
- Using determinate values when state is actually unknown/indeterminate.
|
|
- Using progress for static score displays that should use `Meter`.
|
|
|
|
## Useful particle references
|
|
|
|
See `p-progress-1` through `p-progress-3` for animated, labeled, and formatted value patterns.
|