Files
temetro/.agents/skills/coss/references/primitives/fieldset.md
T
Khalid Abdi 929bec8f31 feat: AI-added records save with placeholders + "Added by AI" provenance
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>
2026-06-14 19:27:17 +03:00

70 lines
1.3 KiB
Markdown

# coss Fieldset
## When to use
- Grouped related controls under one legend/description.
- Complex forms requiring semantic grouping for radios/checkboxes.
## Install
```bash
npx shadcn@latest add @coss/fieldset
```
Manual deps from docs:
```bash
npm install @base-ui/react
```
## Canonical imports
```tsx
import { Fieldset, FieldsetLegend } from "@/components/ui/fieldset"
```
## Minimal pattern
```tsx
<Fieldset>
<FieldsetLegend>Fieldset legend</FieldsetLegend>
</Fieldset>
```
## Patterns from coss particles
### Key patterns
Fieldset grouping related fields:
```tsx
<Fieldset>
<FieldsetLegend>Personal Information</FieldsetLegend>
<Field name="firstName">
<FieldLabel>First name</FieldLabel>
<Input type="text" />
</Field>
<Field name="lastName">
<FieldLabel>Last name</FieldLabel>
<Input type="text" />
</Field>
</Fieldset>
```
Always include `FieldsetLegend` as the accessible group heading.
### More examples
See `p-fieldset-1` for the core pattern.
## Common pitfalls
- Using ad-hoc div wrappers instead of semantic fieldset for grouped controls.
- Omitting `FieldsetLegend`, reducing accessibility context.
- Placing unrelated controls inside one fieldset, hurting form clarity.
## Useful particle references
- core patterns: `p-fieldset-1`
- form composition references: `p-form-1`, `p-form-2`, `p-input-group-24`