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

+15 -13
View File
@@ -11,10 +11,12 @@ Feature: Creating a new article from NewArticleModal
button, desktop header button, and the empty state's "New article" action), per
docs/design/routes.md and docs/design/screens/new-article.md; the Articles-page trigger and
the /article/new deep link are out of scope for this slice, deferred until ArticlesPage exists
And every time it opens, it starts in the Default state: title "New article", text "It's
saved as a draft. Titles can't be changed later, so check it now.", an empty, focused Title
And every time it opens, it starts in the Default state: title "New article", text "Give the
article a title. You can write the rest in the editor." (superseding "It's saved as a draft.
Titles can't be changed later, so check it now."; the Site and Language fields and the
translation path are defined by localization_translation_flows), an empty, focused Title
field with placeholder "e.g. Choosing tiles for a small bathroom", a CharacterCounter
reading "0 / 200" and help "3 to 200 characters.", a "Cancel" button and a "Create draft"
reading "0 / 200" and help "3 to 200 characters.", a "Cancel" button and a "Create article"
button; there is no body or First paragraph field
And the Title field is sent as the request's title and is validated required, 3 to 200
characters, counted the same way as the CharacterCounter ([...str].length, which is rune
@@ -24,7 +26,7 @@ Feature: Creating a new article from NewArticleModal
And the Title field validates on blur and again on submit; submitting while it is invalid
sends no request: a title under 3 characters shows "Use at least 3 characters." in place of
its help text, with the counter in its error style
And activating "Create draft" while the title is valid sends POST /v1/article/ with JSON
And activating "Create article" while the title is valid sends POST /v1/article/ with JSON
{"title": "<title>"}; while the request is in flight the Title field and both buttons are
disabled, the confirm button reads "Creating…" with a loading indicator, and the modal
cannot be dismissed by Cancel, Esc or a backdrop click
@@ -49,11 +51,11 @@ Feature: Creating a new article from NewArticleModal
Scenario: Opening the modal shows the Default state
Given the user is on /home
When the user activates "New article"
Then NewArticleModal opens with title "New article" and the text "It's saved as a draft.
Titles can't be changed later, so check it now."
Then NewArticleModal opens with title "New article" and the text "Give the article a title.
You can write the rest in the editor."
And the Title field is empty, focused, and its counter reads "0 / 200"
And there is no First paragraph field
And "Create draft" is present but the form has not been submitted
And "Create article" is present but the form has not been submitted
Scenario: Validation — a title under 3 characters on blur
Given the modal is open
@@ -64,13 +66,13 @@ Feature: Creating a new article from NewArticleModal
Scenario: Validation — submitting an invalid title sends nothing
Given the modal is open with Title "Ti"
When the user activates "Create draft"
When the user activates "Create article"
Then the Title field shows "Use at least 3 characters."
And POST /v1/article/ is never sent
Scenario: Submitting disables the form and cannot be dismissed
Given the modal is open with Title "Choosing tiles for a small bathroom"
When the user activates "Create draft"
When the user activates "Create article"
Then POST /v1/article/ is sent with JSON {"title": "Choosing tiles for a small bathroom"}
And the Title field becomes disabled, "Cancel" becomes disabled, and the confirm button reads
"Creating…" with a loading indicator
@@ -78,7 +80,7 @@ Feature: Creating a new article from NewArticleModal
Scenario: A successful create closes the modal and hands off to the editor with a toast
Given the user is on /home with the modal open, Title "Choosing tiles for a small bathroom",
and "Create draft" has been activated
and "Create article" has been activated
When POST /v1/article/ resolves 201 with the created article, id 42, is_online false
Then the modal closes
And the app navigates to /article/42/edit
@@ -88,14 +90,14 @@ Feature: Creating a new article from NewArticleModal
Scenario: Title rejected — a 400 that got past this form's own check
Given the modal is open with Title "Choosing tiles for a small bathroom" (already valid by
this form's own rule), and "Create draft" has been activated
this form's own rule), and "Create article" has been activated
When POST /v1/article/ resolves 400
Then the modal re-enables, keeping the title
And the Title field shows "Check this title and try again." in place of its help text
And an alert reads "Something in the form isn't valid. Check the highlighted fields."
Scenario Outline: Error — a 500 or a network failure keeps the text and offers to retry
Given the modal is open with Title "Choosing tiles for a small bathroom", and "Create draft"
Given the modal is open with Title "Choosing tiles for a small bathroom", and "Create article"
has been activated
When POST /v1/article/ <failure>
Then the modal re-enables, keeping the title
@@ -111,7 +113,7 @@ Feature: Creating a new article from NewArticleModal
Scenario: Retrying after an Error succeeds
Given the modal is in the Error state after a 500, with Title "Choosing tiles for a small
bathroom" still in the field
When the user activates "Create draft" again
When the user activates "Create article" again
Then POST /v1/article/ is sent again with the same JSON body
When it resolves 201 with the created article, id 42
Then the modal closes, the app navigates to /article/42/edit, and a toast appears: color