Story
As an editor using VisualEditor,
I want to update all occurrences of a re-used sub-reference,
so that I don’t have to manually edit the sub-reference one at a time.
Design
See Figma file
No need to change the link text to "Learn more". Keep as in the current version.
Acceptance Criteria
Checkbox default: checked
Given a sub-reference is used more than once in the article
When I edit the sub-reference (via the footnote in the text)
Then a selected checkbox is shown with the copy ‘Edit all (n) uses of these details.’
Don’t show checkbox
Given a sub-ref is not re-used in the article
When I edit the sub-reference (via the footnote in the text)
Then I do not see a checkbox
Modify all occurrences
Given I am editing an existing re-used sub-reference (via the footnote in the text)
When I keep the checkbox selected and press ‘insert’
Then all the footnote markers get the new modifications AND the reference list shows the changes with re-use markers as backlinks.
Add only to this footnote marker (sub-reference)
Given am editing an existing re-used sub-reference (via the footnote in the text)
When I unselect the checkbox and press ‘insert’
Then only the footnote marker I am editing is updated AND the reference list shows a new sub-ref without re-use markers
Technical implementation
- display checkbox only for editing subrefs (not for main ref and not for adding subrefs)
- select checkbox by default
- get and display number of similar subrefs
- update all other occurrences if checkbox is selected
- keep current behavior (only update this subref) if checkbox is not selected
For review
To test the change you need to create a reuse in VE by copy pasting an existing subref. Then edit one of the now connected subrefs. You should see the checkbox there. The connection between the subrefs is currently only existing during the edit process. The ticket T406467 will implement that this also stays when the page is saved.
