26 lines
2.4 KiB
Markdown
26 lines
2.4 KiB
Markdown
# New article
|
||
|
||
Route: `modal from anywhere · /article/new`. API: POST /v1/article/.
|
||
|
||
Recommendation: a modal. Title is the only field. The body is not asked for here; it is written in the editor, which opens straight after. Keeping the page underneath means cancelling costs nothing. /article/new opens the same modal over the article list, so it can be linked to and the back button closes it. A successful create always makes a draft and goes to the editor.
|
||
|
||
Visual reference: `RenewCMS Screens Back-office.dc.html`, groups "New article". Frames: `AppFrame.dc.html` (shell, sidebar, topbar, drawer) plus the screen frame where listed in components.md.
|
||
|
||
## Copy per state (generated from the board source, pass 2)
|
||
|
||
Every state below is drawn in light and dark (theme switch on the board), at 1440×900 and 390×844 (both frames sit side by side). Board: `RenewCMS Screens Back-office.dc.html`. Copy is exact; where a cell is empty the state reuses the fixed copy.
|
||
|
||
### New article (group "New article", 5 states)
|
||
|
||
Route: `modal from anywhere · /article/new`. API: POST /v1/article/.
|
||
|
||
Recommendation: a modal. Title is the only field. The body is not asked for here; it is written in the editor, which opens straight after. Keeping the page underneath means cancelling costs nothing. /article/new opens the same modal over the article list, so it can be linked to and the back button closes it. A successful create always makes a draft and goes to the editor.
|
||
|
||
| # | State | Trigger | Copy |
|
||
|---|---|---|---|
|
||
| 1 | Default | "New article" from Home, Articles or the empty state. | |
|
||
| 2 | Validation | On submit or blur. Nothing is sent. | "Use at least 3 characters." |
|
||
| 3 | Submitting | Request in flight. Fields are disabled and the dialog can't be dismissed. | "Creating…" / "Choosing tiles for a small bathroom" / "Small rooms show every grout line, so we start with the floor." |
|
||
| 4 | Title rejected (400) | A server 400 that got past the browser checks. The raw error isn't shown. | "Something in the form isn't valid. Check the highlighted fields." / "Choosing tiles for a small bathroom" / "Small rooms show every grout line, so we start with the floor." / "Check this title and try again." |
|
||
| 5 | Error | 500 or network failure. | "Couldn't create the article. Your text is still here. Try again in a moment." / "Choosing tiles for a small bathroom" / "Small rooms show every grout line, so we start with the floor." |
|