Commit 1ab419f
feat(ui): rough in the user-profile account section flow
Adds the view layer for every action on the account section that opens a
dialog: adding and verifying an email address or phone number, removing one,
promoting one to primary, and editing the name, username and profile picture.
That is the whole of `UserProfileAccountSection`, which is what the flow is
named for — the intent is one flow per section, each named after the section
component it drives.
The views are pure. Each branches on a snapshot and sends events back, holding
no flow state of its own, so the layer that decides when a step changes can be
swapped without touching them. Today that layer is a simulated backend in
swingset, with configurable latency, injected failures and a reverification
gate; later it is a state machine and its Clerk controller. Every delay in the
harness maps to an invoke, every branch to a guard.
Legacy `packages/ui/src/components/UserProfile` is the spec. All three email
verification strategies are covered, since the instance picks between them
rather than the user: a code, an email link with its own waiting screen and
throttled resend, and enterprise SSO. Set-as-primary gains a confirmation it
does not have today, where its pending and failed states can live.
The dialog chrome, the reverification challenge and the shared flow types sit
apart from the account-specific dialogs, since the next section's flow will
reuse them.
Inputs Mosaic does not have yet — the code field, the country picker, the file
picker, the unattributed-error banner, and the dialog header/body/footer — are
hand-rolled and marked with TODOs naming their replacements.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent ea8cb05 commit 1ab419f
16 files changed
Lines changed: 4268 additions & 0 deletions
File tree
- .changeset
- packages
- swingset/src
- components
- lib
- stories
- ui/src/mosaic/user-profile
- __tests__
- dialogs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
| |||
291 | 297 | | |
292 | 298 | | |
293 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
294 | 306 | | |
295 | 307 | | |
296 | 308 | | |
| |||
359 | 371 | | |
360 | 372 | | |
361 | 373 | | |
| 374 | + | |
362 | 375 | | |
363 | 376 | | |
364 | 377 | | |
| |||
0 commit comments