Skip to content

Commit 0db312f

Browse files
chore(mosaic): format contributor guide table
1 parent 4fa1675 commit 0db312f

1 file changed

Lines changed: 31 additions & 31 deletions

File tree

‎packages/mosaic/AGENTS.md‎

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,37 @@ A flow lives in `src/features/<feature>/`. The **model** (`*.model.ts(x)`) is th
3232

3333
Most problems a feature hits already have a shared answer. Find the row for your problem and use it. Do not write a local version, even a small one.
3434

35-
| Problem | Use |
36-
| ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
37-
| An async action from a button or row: pending, an error, one lock | `usePendingAction` (`src/hooks/`) |
38-
| A form: values, validation, submit, field errors, success UI | `useForm` (`src/components/form/`), with `validateAsync` for server checks and `onSuccess` for mounted success UI |
39-
| A `<form>` element, without the browser's validation popup | `Form` (`src/primitives/form/`) |
40-
| A model save whose Clerk errors should land on form fields | `save` (`src/utils/errors.ts`) in the model, or reject with `FormSubmitError` |
41-
| A confirm step before an action | `useConfirmController` (`src/blocks/confirm/`) with `Confirmation` (`src/blocks/confirmation/`) |
42-
| A delete that needs the user to type a phrase | `useConfirmController` (`src/blocks/confirm/`) with `Destructive` (`src/blocks/destructive/`) |
43-
| An action that may need step-up verification | `useReverificationFlow` (`src/features/reverification/`) in the model, passed to `useConfirmController` |
44-
| A direct action that needs step-up verification | `useReverificationFlow` in the model, with `ReverificationDialog` (`src/blocks/reverification/`) in the view |
45-
| Showing any error to the user | One of the owners above. They call `toLocalizableError` (or `toLocalizableErrors` for all errors) and resolve copy with `useErrorText` |
46-
| Moving focus after a list row is removed | `useListRemovalFocus` (`src/hooks/`) |
47-
| A debounced, abortable async check as the user types | `useDebouncedAsync` (`src/hooks/`) |
48-
| A spinner that should not flash or flicker | `useSpinDelay` (`src/hooks/`) |
49-
| A placeholder for content that is still loading | `Skeleton` (`src/components/skeleton/`), see [Skeletons](docs/skeletons.md) |
50-
| A date shown to the user | `formatDate` (`src/utils/format-date.ts`) |
51-
| A value turned into kebab case, e.g. for a `data-*` attribute | `kebabCase` (`src/utils/kebab-case.ts`) |
52-
| Current time for display labels | `useNow` (`src/hooks/`) |
53-
| Whether enterprise SSO permits adding another identification | `allowsIdentificationCreation` (`src/utils/allows-identification-creation.ts`) |
54-
| An inline message row; height is undefined until measured | `useHeldMessage`, `useMessageHeight`, `FeedbackBody` (`src/utils/feedback.tsx`) + `src/styles/feedback.styles.ts` |
55-
| Data read from a Clerk resource that should be cached across mounts | A query hook in `src/queries/`, called from the model (`src/queries/use-user-sessions-query.ts`) |
56-
| An item changed in place in an infinite list, kept until the next reload | `replaceInPages` (`src/utils/infinite-pages.ts`), passed to the list's `setData` |
57-
| An organization permission checked with `checkAuthorization` | `ORGANIZATION_PERMISSIONS` (`src/utils/permissions.ts`) |
58-
| A verification code's length or resend cooldown | `CODE_LENGTH`, `CODE_RESEND_SECONDS` (`src/utils/verification.ts`) |
59-
| An avatar or logo file picker and its rejection errors | `AVATAR_UPLOAD`, `AVATAR_REJECTION_ERRORS` (`src/utils/avatar-upload.ts`) |
60-
| Siblings that slide when an item is added or removed | `useLayoutAnimation` (`src/primitives/hooks/`) |
61-
| An input that reformats as the user types without moving the caret | `useFormattedInput` (`src/primitives/hooks/`) |
62-
| A panel that animates open and closed to its measured size | `usePanelSize` (`src/primitives/hooks/`) |
63-
| One screen replacing another on the same card or dialog | `Flow` (`src/components/flow/`), see [Views](docs/views.md) |
64-
| An interaction with an async lifecycle or two values that move together | A machine in the controller file, via `setup()` (`src/machine/`) |
65-
| Styles several components share | `src/styles/*.styles.ts` |
35+
| Problem | Use |
36+
| ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
37+
| An async action from a button or row: pending, an error, one lock | `usePendingAction` (`src/hooks/`) |
38+
| A form: values, validation, submit, field errors, success UI | `useForm` (`src/components/form/`), with `validateAsync` for server checks and `onSuccess` for mounted success UI |
39+
| A `<form>` element, without the browser's validation popup | `Form` (`src/primitives/form/`) |
40+
| A model save whose Clerk errors should land on form fields | `save` (`src/utils/errors.ts`) in the model, or reject with `FormSubmitError` |
41+
| A confirm step before an action | `useConfirmController` (`src/blocks/confirm/`) with `Confirmation` (`src/blocks/confirmation/`) |
42+
| A delete that needs the user to type a phrase | `useConfirmController` (`src/blocks/confirm/`) with `Destructive` (`src/blocks/destructive/`) |
43+
| An action that may need step-up verification | `useReverificationFlow` (`src/features/reverification/`) in the model, passed to `useConfirmController` |
44+
| A direct action that needs step-up verification | `useReverificationFlow` in the model, with `ReverificationDialog` (`src/blocks/reverification/`) in the view |
45+
| Showing any error to the user | One of the owners above. They call `toLocalizableError` (or `toLocalizableErrors` for all errors) and resolve copy with `useErrorText` |
46+
| Moving focus after a list row is removed | `useListRemovalFocus` (`src/hooks/`) |
47+
| A debounced, abortable async check as the user types | `useDebouncedAsync` (`src/hooks/`) |
48+
| A spinner that should not flash or flicker | `useSpinDelay` (`src/hooks/`) |
49+
| A placeholder for content that is still loading | `Skeleton` (`src/components/skeleton/`), see [Skeletons](docs/skeletons.md) |
50+
| A date shown to the user | `formatDate` (`src/utils/format-date.ts`) |
51+
| A value turned into kebab case, e.g. for a `data-*` attribute | `kebabCase` (`src/utils/kebab-case.ts`) |
52+
| Current time for display labels | `useNow` (`src/hooks/`) |
53+
| Whether enterprise SSO permits adding another identification | `allowsIdentificationCreation` (`src/utils/allows-identification-creation.ts`) |
54+
| An inline message row; height is undefined until measured | `useHeldMessage`, `useMessageHeight`, `FeedbackBody` (`src/utils/feedback.tsx`) + `src/styles/feedback.styles.ts` |
55+
| Data read from a Clerk resource that should be cached across mounts | A query hook in `src/queries/`, called from the model (`src/queries/use-user-sessions-query.ts`) |
56+
| An item changed in place in an infinite list, kept until the next reload | `replaceInPages` (`src/utils/infinite-pages.ts`), passed to the list's `setData` |
57+
| An organization permission checked with `checkAuthorization` | `ORGANIZATION_PERMISSIONS` (`src/utils/permissions.ts`) |
58+
| A verification code's length or resend cooldown | `CODE_LENGTH`, `CODE_RESEND_SECONDS` (`src/utils/verification.ts`) |
59+
| An avatar or logo file picker and its rejection errors | `AVATAR_UPLOAD`, `AVATAR_REJECTION_ERRORS` (`src/utils/avatar-upload.ts`) |
60+
| Siblings that slide when an item is added or removed | `useLayoutAnimation` (`src/primitives/hooks/`) |
61+
| An input that reformats as the user types without moving the caret | `useFormattedInput` (`src/primitives/hooks/`) |
62+
| A panel that animates open and closed to its measured size | `usePanelSize` (`src/primitives/hooks/`) |
63+
| One screen replacing another on the same card or dialog | `Flow` (`src/components/flow/`), see [Views](docs/views.md) |
64+
| An interaction with an async lifecycle or two values that move together | A machine in the controller file, via `setup()` (`src/machine/`) |
65+
| Styles several components share | `src/styles/*.styles.ts` |
6666

6767
## Signs you are about to invent a pattern
6868

0 commit comments

Comments
 (0)