Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/mosaic-user-profile-split-account-section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion packages/mosaic/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ branch on rather than two.
A controller whose own state is a single boolean is the same layer with `useState`
inside it — still no Clerk, still returning plain props. The async part goes to a
shared hook (`useForm` here) rather than a hand-rolled pending flag. From
`features/user-profile/user-profile-account-section/user-profile-edit-username.controller.ts`:
`features/user-profile/user-profile-profile-section/user-profile-edit-username.controller.ts`:

```tsx
export function useUserProfileEditUsernameController({ username = '', required = false, onSubmit }) {
Expand Down
2 changes: 1 addition & 1 deletion packages/mosaic/docs/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ where its effects come from.
Worked examples:

- `packages/mosaic/src/features/user-button/user-button.controller.tsx` — wraps a model
- `packages/mosaic/src/features/user-profile/user-profile-account-section/user-profile-edit-username.controller.ts`
- `packages/mosaic/src/features/user-profile/user-profile-profile-section/user-profile-edit-username.controller.ts`
— takes its one effect as a prop

See `packages/mosaic/ARCHITECTURE.md` → "Controllers" for the layer contract.
Expand Down
2 changes: 1 addition & 1 deletion packages/mosaic/docs/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ drops the fallback instead of holding the space open. Keep the two apart.
- A callback that backs a form wraps its Clerk call in `save(run, fields, params)`
from `utils/errors.ts`. It rethrows a Clerk error as a `SaveError` routed to
the form fields it names, which the form renders
(`user-profile-account-section.model.ts`).
(`user-profile-profile-section.model.ts`).
- No local UI state. What is open and what is in flight belong to the controller.
- No React state machinery beyond the Clerk hooks themselves; the model is a
derivation of what Clerk currently says. The exception is what to fetch: a
Expand Down
5 changes: 0 additions & 5 deletions packages/mosaic/eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
"count": 1
}
},
"src/features/user-profile/user-profile-account-section/user-profile-contact-row.view.tsx": {
"sonarjs/cognitive-complexity": {
"count": 1
}
},
"src/features/user-profile/user-profile-active-devices-section/user-profile-active-devices-section.model.ts": {
"@typescript-eslint/no-restricted-imports": {
"count": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { describe, expect, it, vi } from 'vitest';

import { UserProfileContactListRowView } from '../user-profile-account-section/user-profile-contact-list-row.view';
import { UserProfileContactListRowView } from '../user-profile-contact-list-row.view';

describe('UserProfileContactListRowView', () => {
it.each(['email', 'phone'] as const)('hides the menu when no %s action applies', kind => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';

import { toContacts } from '../user-profile-account-section/user-profile-account-section.utils';
import { toContacts } from '../user-profile-contact.utils';

type Contact = { id: string; verification: { status: 'verified' | 'unverified' | null; expireAt: Date | null } };

Expand Down

This file was deleted.

This file was deleted.

Loading
Loading