User:DVRTed/sandbox/merge-helper-specs

in Main/Article and Talk namespaces

edit
  • add "Create merge proposal" option in Tools section
  • when clicked, go to Popup, step 1

Popup, step 1

edit
  • Show a popup that asks whether we're:
    • merging two articles together
    • merging many articles into an existing one
    • merging many articles into a page that doesn't exist yet
  • (clicking any of these goes to Popup, step 2)

Popup, step 2

edit

if merging two articles together

edit
  • two input fields: destination article name, source article name
    • (autofill either source or target input with current page name?)
  • a checkbox that says "Unclear which page should be merged and which should remain"
    • maybe change the label from source/destination to page one/page two when checked
  • when clicked continue, run Quickchecks

if merging many articles into an existing one/new one

edit
  • destination page input field
  • source page input field with a + button next to it to add more source pages
  • when clicked continue, run Quickchecks

Quickchecks

edit
  • ensure destination page(s) DOESN'T include the source page or source!==dest
  • ensure BOTH articles exist/ALL source pages exist
  • ensure destination page exists if `Unclear...` is unchecked
  • if OK, go to Popup, step 3

Popup, step 3

edit
SOURCE_PAGES: ["XYZ", "ABC"]/"XYZ", DESTINATION_PAGE: "XQC"
  • text that says "Discussion will be created on [...]"
  • two input fields: section title (autofilled: "Merge proposal") and merge rationale (section_title, merge_rationale)
    • if "unclear..." is checked, autofill merge_rationale
      • "I propose merging XYZ and XQC together because "
    • otherwise
      • "I propose merging XYZ, ABC into XQC because "
  • maybe a preview button?
  • when clicked continue

Popup, step 4

edit
  • run Operations WHILE:
    • displaying progress status of Operations
  • when finished, show final status and a "Close" button

Operations

edit
  • create an array of pages failed to edit due to edit protection?

if merging two articles together

edit
  • if "Unclear which page should be merged and which should remain" is checked
    • append ==section_title==\n merge_rationale to either source/destination page's Talk page
    • edit BOTH pages to prepend:
      • {{Merge|OTHERPAGE|discuss=Talk:(EITHER SOURCE/DESTINATION PAGE)#section_title|date=January 2026}}
        • (of course put the correct date)
    • EXIT Operations
  • if "Unclear which page should be merged and which should remain" is NOT checked
    • append ==section_title==\n merge_rationale to DESTINATION PAGE's Talk page
    • prepend {{Merge to|DESTINATIONPAGE|discuss=Talk:DESTINATIONPAGE#section_title|date=January 2026}} to SOURCE PAGE
    • prepend {{Merge from|SOURCEPAGE|discuss=Talk:DESTINATIONPAGE#section_title|date=January 2026}} to DESTINATION PAGE
    • EXIT Operations

if merging multiple articles into one

edit
  • if destination page doesn't exist
    • I guess the Talk page section goes to any one of the source pages? [ YES, that's correct ]
    • on ALL source pages prepend
      • {{Merge|target=DESTINATIONPAGE|SOURCEPAGE1|SOURCEPAGE2|...|discuss=Talk:SOURCEPAGE1#section_title|date=January 2026}}
  • if destination page exists
    • append ==section_title==\n merge_rationale to destination page Talk page
    • prepend on destination page:
      • {{Merge from|SOURCEPAGE1|SOURCEPAGE2|...|discuss=Talk:DESTINATIONPAGE#section_title|date=January 2026}}
    • prepend on ALL source pages:
      • {{Merge|sourcepages|...|target=DESTINATIONPAGE|discuss=Talk:DESTINATIONPAGE#section_title|date=January 2026}}
        • (dont forget to exclude currently editing page from sourcepages)
  • EXIT Operations