Files
temetro/.agents/skills/coss/references/primitives/spinner.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

1.5 KiB

coss Spinner

When to use

  • Indeterminate loading indicator for ongoing work.
  • Inline pending state in buttons, forms, and async panels.

Install

npx shadcn@latest add @coss/spinner

Manual deps from docs:

# No extra runtime dependency required for this primitive.

Canonical imports

import { Spinner } from "@/components/ui/spinner"

Minimal pattern

<div className="flex items-center gap-2">
  <Spinner aria-label="Loading" />
  <span className="text-sm text-muted-foreground">Loading data</span>
</div>

Patterns from coss particles

Key patterns

Spinner inside a button:

<Button disabled>
  <Spinner aria-hidden="true" />
  Loading...
</Button>

Standalone spinner with label:

<div className="flex items-center gap-2">
  <Spinner aria-label="Loading" />
  <span className="text-muted-foreground text-sm">Fetching data...</span>
</div>

Prefer button built-in loading UI where available over ad-hoc spinner wrappers.

More examples

See p-button-18 and p-input-12 for spinner-in-button and spinner-in-input-group patterns.

Common pitfalls

  • Using spinner without accessible label/context for screen readers.
  • Showing spinner with no cancel/retry pathway in long-running operations.
  • Using spinner when determinate progress value is available.

Useful particle references

  • input group: p-input-12
  • button: p-button-18
  • cross-primitive pending states: p-button-25, p-autocomplete-12, p-toast-3