11 KiB
State matrix and error copy
Every state is drawn at desktop and mobile on the screen boards, with final copy. Each screen's file in screens/ has the full copy per state.
| Screen | Route | State | Trigger | Spec |
|---|---|---|---|---|
| App boot | any verified route |
Checking session | First navigation, while GET /v1/auth/me is pending | boot |
| App boot | any verified route |
Verified | 200 with is_verified: the route renders | boot |
| App boot | any verified route |
Unverified | 200 with is_verified false: goes to /register/pending | boot |
| App boot | any verified route |
No session | 401: goes to /login?redirect= | boot |
| Log in | /login |
Default | Registration closed | log-in |
| Log in | /login |
Fresh install | registration.open is true | log-in |
| Log in | /login |
Validation errors | Client rules fail on submit | log-in |
| Log in | /login |
Submitting | Request in flight | log-in |
| Log in | /login |
Wrong credentials | 403 | log-in |
| Log in | /login |
Too many attempts | 429 with Retry-After | log-in |
| Log in | /login |
Session expired | ?reason=expired from a 401 | log-in |
| Log in | /login |
Password changed | ?reason=password-changed | log-in |
| Log in | /login |
Server error | 500 or network | log-in |
| Register | /register |
Default | Open instance | register |
| Register | /register |
Validation errors | Client rules fail | register |
| Register | /register |
Submitting | In flight | register |
| Register | /register |
Registration closed | 403 | register |
| Register | /register |
Server error | 500 or network | register |
| Pending | /register/pending |
Default | After registering (email known) | pending |
| Pending | /register/pending |
Email unknown | After logging in unverified | pending |
| Pending | /register/pending |
Confirm cancel | Cancel registration clicked | pending |
| Pending | /register/pending |
Cancelling | DELETE in flight | pending |
| Pending | /register/pending |
Cancelled | 200: /register with toast | pending |
| Pending | /register/pending |
Already verified | 403: /home with toast | pending |
| Verify | /register/validate?c= |
Verifying | On load | verify |
| Verify | /register/validate?c= |
Success | 200: /home with toast | verify |
| Verify | /register/validate?c= |
Invalid or expired | 403 | verify |
| Verify | /register/validate?c= |
No session | 401: inline log in, then retry | verify |
| Verify | /register/validate?c= |
Missing code | No c parameter | verify |
| Forgot password | /register/reset/request |
Default | Page load | forgot-password |
| Forgot password | /register/reset/request |
Validation | Invalid email | forgot-password |
| Forgot password | /register/reset/request |
Submitting | In flight | forgot-password |
| Forgot password | /register/reset/request |
Sent | Any 200 (neutral copy) | forgot-password |
| Forgot password | /register/reset/request |
Too many attempts | 429 | forgot-password |
| Forgot password | /register/reset/request |
Server error | 500 or network | forgot-password |
| Reset password | /register/reset/validate |
Default | c and email present | reset-password |
| Reset password | /register/reset/validate |
Too short | Under 8 characters | reset-password |
| Reset password | /register/reset/validate |
Mismatch | Confirm field differs | reset-password |
| Reset password | /register/reset/validate |
Submitting | In flight | reset-password |
| Reset password | /register/reset/validate |
Success | 200: /login?reason=password-changed | reset-password |
| Reset password | /register/reset/validate |
Invalid or expired | 403 | reset-password |
| Reset password | /register/reset/validate |
Missing parameters | No c or no email | reset-password |
| Home | /home |
Loading | List in flight (after 150 ms) | home |
| Home | /home |
Default | List loaded | home |
| Home | /home |
Empty | Zero articles | home |
| Home | /home |
Error | 500 or network | home |
| Articles | /article |
Loading | List in flight | articles |
| Articles | /article |
Default | Loaded | articles |
| Articles | /article |
Empty | Zero articles | articles |
| Articles | /article |
No results | Search matches nothing | articles |
| Articles | /article |
Empty tab | No drafts, or nothing online | articles |
| Articles | /article |
Row busy | Publish or unpublish in flight | articles |
| Articles | /article |
Action failed | 500 or network: toast with Retry | articles |
| Articles | /article |
Row vanished | 404 on any row action | articles |
| Articles | /article |
Delete confirm, in progress, failed, done | ConfirmDialog, then DELETE: 204 or 500 | articles |
| New article | modal · /article/new |
Default | Opened | new-article |
| New article | modal · /article/new |
Validation | Title under 3 or body empty | new-article |
| New article | modal · /article/new |
Submitting | POST in flight | new-article |
| New article | modal · /article/new |
Title rejected | Server 400 | new-article |
| New article | modal · /article/new |
Error | 500 or network | new-article |
| New article | modal · /article/new |
Created | 201: editor, with a toast | new-article |
| Editor | /article/:id/edit |
Loading | GET in flight | editor |
| Editor | /article/:id/edit |
Not found | 404 | editor |
| Editor | /article/:id/edit |
Saved | Clean | editor |
| Editor | /article/:id/edit |
Unsaved | Any edit | editor |
| Editor | /article/:id/edit |
Saving | PATCH in flight | editor |
| Editor | /article/:id/edit |
Save failed | 500 or network | editor |
| Editor | /article/:id/edit |
Near the limit | At least 9 000 HTML characters | editor |
| Editor | /article/:id/edit |
Too long | Over 10 000: Save and Publish disabled | editor |
| Editor | /article/:id/edit |
Preview | Switch on | editor |
| Editor | /article/:id/edit |
Uploading, rejected, inserted | ImageUploader | editor |
| Editor | /article/:id/edit |
Publishing, unpublishing | PATCH publish or unpublish | editor |
| Editor | /article/:id/edit |
Leave guard | Navigating away while dirty | editor |
| Editor | /article/:id/edit |
Offline | navigator.onLine is false | editor |
| Editor | /article/:id/edit |
Deleted | 204: /article with toast | editor |
| Editor | /article/:id/edit |
Session expired | 401: draft kept in sessionStorage, then /login | editor |
| Integration | /integration |
Default | Page load | integration |
| Integration | /integration |
Copied | Copy clicked (2 s) | integration |
HTTP status to copy
Response bodies are plain text and are never shown. useApi throws an ApiError with the status and a context key, and each screen maps them to this copy.
| Status | Where | Copy | Surface |
|---|---|---|---|
| 400 | Any form | The field error from the client rules. A server 400 that got through: "Something in the form isn't valid. Check the highlighted fields." | Field + alert |
| 401 | Any back-office call | Goes to /login?redirect=&reason=expired. "Your session expired. Log in again to pick up where you left off." | Redirect + alert |
| 401 | Verify | "Log in to finish verifying." Inline log in, then retry | Inline form |
| 403 | Log in | "That username and password don't match. Check both and try again." | Alert |
| 403 | Register | "This site already has an owner. Log in instead." | ResultPanel |
| 403 | Any back-office call | Unverified: goes to /register/pending | Redirect |
| 403 | Verify | "This verification link doesn't work." Offers Cancel registration and start over | ResultPanel |
| 403 | Cancel registration | "Your account is already verified." Goes to /home | Toast |
| 403 | Reset confirm | "This reset link has expired." Offers Request a new link | ResultPanel |
| 404 | Editor load | "This article doesn't exist." Offers All articles | ErrorView |
| 404 | Row or editor action | "That article no longer exists." The row is removed | Toast |
| 404 | Unknown route | "Page not found" | ErrorView |
| 429 | Log in, reset request | "Too many attempts. For your security, wait a moment before trying again." With a countdown | Alert + disabled button |
| 500 | Save | "Save failed" + Retry. Changes are kept | SaveStatus |
| 500 | Publish / unpublish | "Couldn't publish" / "Couldn't unpublish" + Retry | Toast |
| 500 | Delete | "Couldn't delete the article, so it's still there. Try again in a moment." | Inline in dialog |
| 500 | Upload | "Upload failed. The server didn't accept the file. Your article hasn't changed." | ImageUploader |
| network | Anywhere | "Couldn't reach RenewCMS. Check your connection and try again." Offline: banner | Alert / toast / banner |
API the design marked pending
All four now exist: GET /v1/auth/me, GET /v1/auth/registration, 429 with Retry-After on /v1/auth/login and /v1/auth/password-reset, and /static/uploadedImages/*. Still not supported, so shown disabled or omitted:
Renaming a title (shown read-only, with an explanation in Details), resending the verification email (the pending page explains how to start over), changing the password while logged in, editing the profile or email, listing or deleting individual images, multiple users.