Extract shared DeletePageDialog; fix delete-button styling and Special:Schemas i18n#1129
Merged
Conversation
The component backs the save/create dialogs today and will also back the delete confirmation dialogs, so the edit-specific name no longer fits. Pure mechanical rename: the component symbol, its file, its LESS class prefix, and the public-api export. The neowiki-edit-summary-* message keys are left unchanged — they remain the component's default label. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The field is hardwired to the "Edit summary" wording. To let the delete confirmation dialog reuse this component and label the field a "reason", expose optional `label` and `placeholder` props that fall back to the existing edit-summary messages, so every current caller is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract the page-deletion confirmation shared by Special:Schemas, Special:Layouts, and Special:Mappings into a self-contained component: a confirmation dialog wrapping SummaryAction (destructive action + trash icon, "reason" label) that performs the delete via the API and notifies. Introduce a generic neowiki-delete-* message set keyed on the page name, replacing the need for per-entity delete wording. The three pages are migrated onto this component in the following commit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the duplicated delete-confirmation dialog and executeDelete logic in all three special pages with the shared DeletePageDialog, and retire the 18 now-unused per-entity delete messages in favour of the generic neowiki-delete-* set. The per-entity row-button aria-labels (neowiki-<entity>-delete) stay, since the trigger button lives on each page. Also register neowiki-schema-delete, which was defined but never added to the ResourceLoader module: the Schemas delete button aria-label (and, via the old per-entity keys, its whole confirmation dialog) rendered raw message keys. This is the reported "Special:Schemas is missing the i18n messages" bug. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add LayoutsPage.spec.ts. LayoutsPage had no spec, so its delete wiring
(`Layout:${name}` -> DeletePageDialog) was the one untested page after
the migration; a wrong namespace prefix could ship silently. Mirrors
the Schemas/Mappings "opens the delete confirmation" coverage.
- Rename the leftover mountDialogWithRealEditSummary helper in
MappingCreatorDialog.spec.ts to mountDialogWithRealSummaryAction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"The page EDM will be permanently deleted" was doubly wrong: users do
not necessarily know a Schema/Layout/Mapping is stored as a page, and
"permanently" is false in MediaWiki (a deleted revision is retained and
can be undeleted).
The message now reads "The <type> <name> will be deleted" (e.g. "The
mapping EDM will be deleted"), with the name kept bold. DeletePageDialog
gains a typeLabel prop; each page passes its entity noun via the new
neowiki-{schema,layout,mapping}-noun messages.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
alistair3149
marked this pull request as ready for review
July 22, 2026 17:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Extracts the page-deletion confirmation shared by
Special:Schemas,Special:Layouts, andSpecial:Mappingsinto one component, and fixes two bugs found.What this changes
components/common/DeletePageDialog.vue— a self-contained confirmation dialog (CdxDialog+ generic delete message + aSummaryActionfooter configured destructive + trash icon with a "Reason" field) that performsaction=deleteand notifies. Replaces three byte-identical dialogs +executeDeletebodies.progressive/cdxIconCheck.Special:Schemasdelete UI rendered raw message keys. Root cause was ResourceLoader registration, not missing messages: theneowiki-schema-delete-*dialog keys and theneowiki-schema-deletearia-label were absent from theext.neowikimodule'smessageslist. The refactor replaces the per-entity dialog keys with a single genericneowiki-delete-*set (registered once) and registers the orphanedneowiki-schema-delete.EditSummary→SummaryAction(no longer edit-specific) + add optionallabel/placeholderprops so the delete dialog can label the field "Reason".neowiki-{schema,layout,mapping}-delete-{confirm-*,summary-default,success,error}keys for ~8 generic ones. The confirmation message names the entity type ("The mapping EDM will be deleted") — it avoids exposing that a Schema/Layout/Mapping is stored as a page, and drops "permanently" (untrue for MediaWiki's soft delete). Each page supplies its noun vianeowiki-{schema,layout,mapping}-noun. Per-entity row-button aria-labels (neowiki-<entity>-delete) stay, since the trigger button lives on each page.Commits (ordered for review)
EditSummary→SummaryAction(pure rename).label/placeholderprops toSummaryAction.DeletePageDialog+ genericneowiki-delete-*messages.neowiki-schema-delete.Judgment calls
SummaryActionstays bundled (field + button); no reshape. Splitting the button out to useCdxDialog's nativeprimaryAction/defaultActionwas considered but rejected: those props are label-only and cannot carry the trash/checkmark icons these buttons rely on.@deleted.Known / out of scope
error instanceof Error ? … : String(error)handler is carried over verbatim;mw.Api().post()rejects with a(code, result)pair, so a real API failure shows a raw code. This predates the PR and affects every create/delete dialog uniformly — left for a separate fix.public-api.tsbreaking rename. TheEditSummaryexport becomesSummaryAction. No in-repo consumer imports it and NeoWiki is pre-production, but an external extension importingEditSummarywould break — heads-up for HW.Verification
make ts-build,make ts-lint, and the full vitest suite (110 files, 1109 tests) pass. New/updated tests:DeletePageDialog.spec(delete flow + destructive/trash wiring),SummaryActionlabel/placeholder cases,LayoutsPage.spec(delete wiring), and the Schemas/Mappings page specs.Manual Browser Check
Verified live on the dev wiki as an admin. To reproduce on each of
Special:Schemas,Special:Mappings,Special:Layouts:⟨neowiki-…⟩keys (this was broken on Schemas, including the row Delete button's label).Verified end-to-end: Schemas ("The schema Company will be deleted."), Mappings ("The mapping EDM will be deleted."), Layouts ("The layout CompanyOverview will be deleted."). Nothing was actually deleted during verification.