Page MenuHomePhabricator

[Stretch] Allow adding new Abstract Content sections with Wikidata-backed titles
Closed, InvalidPublic

Assigned To
Authored By
DSmit-WMF
Mar 10 2026, 12:35 PM
Referenced Files
F72792636: Screenshot 2026-03-10 at 13.40.27.png
Mar 10 2026, 12:41 PM
F72792546: Screenshot 2026-03-10 at 13.31.56.png
Mar 10 2026, 12:35 PM
F72792542: Screenshot 2026-03-10 at 13.31.49.png
Mar 10 2026, 12:35 PM
F72792535: Screenshot 2026-03-10 at 13.31.43.png
Mar 10 2026, 12:35 PM
F72792533: Screenshot 2026-03-10 at 13.31.35.png
Mar 10 2026, 12:35 PM
F72792531: Screenshot 2026-03-10 at 13.31.28.png
Mar 10 2026, 12:35 PM
F72792526: Screenshot 2026-03-10 at 13.31.19.png
Mar 10 2026, 12:35 PM

Description

Currently, the Abstract Content editor only displays the LEAD paragraph section. There is no way in the UI to add a new section for a Wikidata item, nor to choose which Wikidata item should be used as the section title.

This task is to extend the Abstract Content editor so that users can:

  • Add a new section
  • Select a Wikidata item to serve as that section’s title (label + Q-id)
  • Edit the new section’s fragments using the existing fragment-editing UI

User story

As an editor creating or improving an Abstract Content page,
I want to add additional sections whose titles are defined by Wikidata items,
so that I can structure the abstract with multiple, well-labelled sections (e.g. "History", "Geography", etc.).

Proposed approach (high level)

  • Frontend
    • In the Abstract view (wl-abstract-view → wl-abstract-content), add an "Add section" area that is only shown in edit mode.
    • This area should:
      • Use a Wikidata entity selector to pick the section title item (Q-id).
      • Show the selected item’s label and Q-id.
      • Provide an "Add section" button that, when clicked, creates a new section for that Q-id in the Abstract Content data structure.
    • After creation, the new section should appear in the list of sections, using:
      • The Wikidata label as its displayed title.
      • The existing wl-abstract-content-section component and fragment UI for editing the section value.

NB!

  • This UX is to be designed and can change perhaps.
  • Deletion and editing is a different ticket. [TBD]

Acceptance criteria

  • In the Abstract Content editor (edit mode), there is a visible control to add a new section.
  • The control lets the user search/select a Wikidata item.
  • The user can only add a section when:
    • A Wikidata item is selected, and
    • That Q-id is not already present as an existing section.
  • After clicking "Add section":
    • A new section appears in the list.
    • Its title shows the Wikidata label and Q-id.
    • The section contains an empty (but valid) fragment list that can be edited via the existing fragment UI.
  • Reloading the page after saving the Abstract Content shows the newly added section and its fragments correctly.
  • Adding a new section does not break existing sections, fragment previews, or publishing.

Open questions

  • Should any specific Q-ids (e.g. lede/intro) be treated specially or restricted from being added? Do we want a fixed list of allowed QIDs for sections?

Storyboard Edit

Screenshot 2026-03-10 at 13.31.19.png (2,534×1,328 px, 284 KB)
Screenshot 2026-03-10 at 13.31.28.png (2,544×1,384 px, 286 KB)
Screenshot 2026-03-10 at 13.31.35.png (2,576×1,934 px, 438 KB)
Screenshot 2026-03-10 at 13.31.43.png (2,586×1,464 px, 289 KB)
Screenshot 2026-03-10 at 13.31.49.png (2,552×1,520 px, 308 KB)
Screenshot 2026-03-10 at 13.31.56.png (2,568×1,830 px, 353 KB)
Step 1 - try to add already existing sectionStep 2 - Section already existsStep 3 - choose 'History'Step 4 - Add 'History' sectionStep 5 - 'History' section addedStep 6 - added a fragment

Storyboard Read

Screenshot 2026-03-10 at 13.40.27.png (2,094×1,428 px, 305 KB)
New section visible