feat: translation flows, revision conflicts, delete scopes, article moves and a target site for new articles

This commit is contained in:
Florian Sylvain committed 2026-11-03 00:12:29 +01:00
1 parent 339e646eb8
commit 45fbbc33b1
93 files changed
+7630 -294

No files matched your search

+8 -9
View File
@@ -7,10 +7,9 @@ Only HomeView.vue is wired as a real `created` consumer in this slice: it listen
the `/article/new` route stay pointed at the current ArticleView.vue placeholder until that page
exists; don't wire a `created` handler there yet.
The modal is title-only: the First paragraph field is removed and the POST body is `{"title": "..."}`
with no `body` key (see features/article_body_unlimited.feature).
The First paragraph field is removed and the POST body carries no `body` key (see features/article_body_unlimited.feature). Since localization_translation_flows the modal also holds a Site field, a Language field and a Translation path: the body is `{"title": "..."}` only when GET /v1/site/ fails or is empty, otherwise it adds `site` (and `lang` when the Language field shows).
The confirm button's label is the design's "Create draft".
The confirm button's label is the design's "Create article".
The Created toast uses `useToast().add({ id: 'article-created-{id}', color: 'success', icon:
'i-lucide-circle-check', title: 'Draft created', description: '"{title}" is saved as a draft.' })`,
@@ -26,13 +25,13 @@ created article id 42, is_online false.
1. **Default state on open** — click "New article"; assert the modal shows title "New article",
the intro text, an empty focused Title field with counter "0 / 200" and help "3 to 200
characters.", "Cancel" and "Create draft", and no First paragraph field.
characters.", "Cancel" and "Create article", and no First paragraph field.
2. **Blur validation** — type "Ti" into Title and blur; assert the error "Use at least 3
characters." replaces the help text and the counter "2 / 200" is in its error style; assert no
`request` call.
3. **Submit with an invalid title** — Title "Ti", click "Create draft"; assert the error shows and
3. **Submit with an invalid title** — Title "Ti", click "Create article"; assert the error shows and
`request` is never called.
4. **Submitting state** — fill Title validly, click "Create draft"; assert `request` is called
4. **Submitting state** — fill Title validly, click "Create article"; assert `request` is called
once with `POST /v1/article/` and the JSON body exactly `{"title": "Choosing tiles for a small
bathroom"}`; assert Title and Cancel become disabled, the confirm button reads "Creating…";
assert pressing Escape and clicking the backdrop do not close the modal while unresolved.
@@ -48,7 +47,7 @@ created article id 42, is_online false.
`ApiError(500)`, (b) resolve it rejecting with `NetworkError`; in each, assert the title is
kept, the alert reads "Couldn't create the article. Your text is still here. Try again in a
moment.", and the field shows no error.
8. **Retry after Error succeeds** — from the Error state (500), click "Create draft" again; assert
8. **Retry after Error succeeds** — from the Error state (500), click "Create article" again; assert
`request` is called a second time with the same JSON body; resolve 201 with the fixture; assert
the modal closes, the router navigated to `/article/42/edit`, and the same "Draft created" toast
(id "article-created-42") is raised.
@@ -65,7 +64,7 @@ has no time-dependent content, so no fixed `now` is needed. The board frames may
line in Submitting, Title rejected and Error; the design .md files are authoritative for the
title-only modal and the boards are a known follow-up.
- [ ] Default: empty, focused Title with counter "0 / 200", help text, "Cancel" / "Create draft".
- [ ] Default: empty, focused Title with counter "0 / 200", help text, "Cancel" / "Create article".
- [ ] Validation: Title "Ti" with counter "2 / 200" in error and "Use at least 3 characters."
- [ ] Submitting: Title filled and disabled, confirm reads "Creating…" with its loading state.
- [ ] Title rejected (400): Title filled, error "Check this title and try again.", alert
@@ -73,7 +72,7 @@ title-only modal and the boards are a known follow-up.
- [ ] Error: Title filled, alert "Couldn't create the article. Your text is still here. Try
again in a moment.", no field-level error.
- [ ] Created: no board frame; verified by Vitest (toast copy + navigation).
- [ ] Keyboard/focus: Tab reaches Title (already focused on open) → Cancel → Create draft; Esc
- [ ] Keyboard/focus: Tab reaches Title (already focused on open) → Cancel → Create article; Esc
closes the modal in every dismissible state and is blocked while Submitting; the counter's
live region announces only when its error threshold is crossed, not on every keystroke,
per CharacterCounter's a11y spec.