Skip to content

Commit 54db5cb

Browse files
committed
ENGAGE-243
1 parent 8123278 commit 54db5cb

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Orcid Angular — Agent Notes
2+
3+
Monorepo: main app (`src/`, project `ng-orcid`), docs (`projects/orcid-ui-docs`), and libraries. Use this for fast orientation.
4+
5+
> **Note for future agents:** This file is intended to be edited over time. Any section—relevant or not—may be updated, trimmed, or reorganized so the document stays lean and useful for future agents. Prefer keeping only what helps the next AI work effectively with this project.
6+
7+
## Quick reference: libraries
8+
9+
- **@orcid/ui**`projects/orcid-ui` — Agnostic UI components, design tokens, modal shell. See `projects/orcid-ui/AGENTS.md`.
10+
- **@orcid/registry-ui**`projects/orcid-registry-ui` — Registry-specific components (e.g. import-works-dialog). See `projects/orcid-registry-ui/AGENTS.md`.
11+
12+
Both are path-mapped from repo root (`tsconfig.json`). Main app and docs consume them from source.
13+
14+
## When changing a library component’s API
15+
16+
Update the main app and that component’s doc page (usage snippet, inputs list, examples).
17+
18+
## If component styles differ between docs and main app
19+
20+
If a library component (e.g. in orcid-registry-ui) looks correct in the docs app but wrong in the main app (e.g. missing margins or spacing), try **resetting the main project**: clean build artifacts, reinstall, or reset local overrides. Stale or inconsistent build/cache state in the main app can cause component styles to not apply as in docs; a fresh build often resolves it.
21+
22+
23+
## Dialogs and async data
24+
25+
When a dialog or view needs data from an HTTP (or other async) call, opening the dialog only after the request completes can feel slow. Consider opening the dialog **immediately** with skeleton or static data (e.g. labels, empty lists, or a `loading: true` flag), then assigning the full payload to the dialog’s component instance when the observable emits. The dialog can show placeholders or a loading state until then.

projects/orcid-registry-ui/AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This package (`projects/orcid-registry-ui`, published as `@orcid/registry-ui`) c
1616
- **Components**: `projects/orcid-registry-ui/src/lib/components/**`
1717
- Prefer **standalone components**. Use `@orcid/ui` for base primitives (modals, action surfaces, etc.) and **orcid-tokens** CSS variables for layout/color/typography.
1818
- Dialogs that use the shared modal chrome should use `OrcidModalComponent` and `ORCID_MODAL_DIALOG_PANEL_CLASS` from `@orcid/ui` when opening with `MatDialog`.
19+
- **Dialog data (MAT_DIALOG_DATA):** If the host may open the dialog first and assign full data later (e.g. after an async request), the data interface can include an optional flag (e.g. `loading?: boolean`) so the dialog can show a skeleton or placeholder until the host sets the complete data.
1920

2021
## Dependencies
2122

@@ -26,6 +27,10 @@ This package (`projects/orcid-registry-ui`, published as `@orcid/registry-ui`) c
2627

2728
- From repo root: `ng build orcid-registry-ui` (or use the npm script if defined).
2829

30+
## When changing this library’s API
31+
32+
If you add or change **inputs**, **data types**, or **public behavior** in a registry-ui component, update **both** the main app usage (under `src/`) and the component’s doc page (usage snippet, inputs list, examples) so they stay in sync.
33+
2934
## Docs site (`projects/orcid-ui-docs`)
3035

3136
Registry-ui doc pages live under **`src/app/pages/orcid-registry-ui/`** (orcid-ui pages live under `pages/orcid-ui/`). When adding a new registry-ui component doc:

projects/orcid-ui/AGENTS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Use this document as a fast orientation and a checklist for making safe, consist
2323
- `projects/orcid-tokens/tokens.scss` (SCSS source-of-truth)
2424
- `projects/orcid-tokens/tokens.css` (CSS variables used by apps/docs)
2525
- `projects/orcid-tokens/tokens.json` (structured token map)
26-
- Keep `projects/orcid-ui-docs` updated with a docs page + route + sidebar link.
26+
- Keep `projects/orcid-ui-docs` updated with a docs page + route + sidebar link. When you **change a component’s API** (inputs, data types, public behavior), update the main app (or other consumers) and that component’s doc page (usage snippet, inputs list, examples).
2727
- Verify builds:
2828
- `npm run build:tokens`
2929
- `npm run build:ui`
@@ -43,6 +43,10 @@ Use this document as a fast orientation and a checklist for making safe, consist
4343
- Some SCSS (typography/theme helpers) imports token SCSS.
4444
- Prefer token variables over hard-coded colors/sizes.
4545

46+
### Loading and placeholder states
47+
48+
- Prefer existing **skeleton/placeholder components** from this library (e.g. `SkeletonPlaceholderComponent`) for loading or empty states so loading UIs stay consistent. Check `public-api.ts` and the docs before adding new spinners or custom placeholders.
49+
4650
## MCP Figma-to-code workflow used in this repo
4751

4852
When the user provides a Figma URL:

0 commit comments

Comments
 (0)