Skip to content

Conversation

@IlyasLebleu
Copy link
Contributor

@IlyasLebleu IlyasLebleu commented Nov 21, 2025

Technically, there is already a delete button, but it is nearly invisible, doesn't delete talk pages and redirects, doesn't log, and only takes you to the (non-Twinkle) deletion interface. This is a much quicker and more visible delete button, plus an option to decline (removing the db template). Tested here.

image

@IlyasLebleu
Copy link
Contributor Author

Small mistake, accidentally pushed the reload timer on this branch rather than on its own separate branch. Forced pushed it back, so it should be all good now.

@NovemLinguae
Copy link
Member

This is a fairly visible change for users, so I am soliciting user feedback at https://en.wikipedia.org/wiki/Wikipedia_talk:Twinkle#speedy%3A_add_admin-only_%22Delete%22_and_%22Decline%22_buttons_for_quick_parsing

@siddharthvp
Copy link
Member

Opening CSD module on a nominated page already configures the dialog to delete based on the nomination. So "quick delete" is possible today with 3 clicks (TW > CSD > Delete). This patch introduces a 1-click way to do that. I'm skeptical of this being worth the added complexity. 3 clicks seems okay for deleting a page. How about just making the Delete button open the CSD dialog? That would make it 2 clicks and avoid most of the complexity.

The "Decline" button seems more useful, as there is no good way to do it today (except through another user script which is old and probably unmaintained).

buttonContainer.appendChild(buttonNodes.decline);

const contestButton = document.querySelector(
'table.ambox-speedy form[name="commentbox"].mw-inputbox-form-inline'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using such complex and fragile selectors, it's better to add a class or id to the button and target that

@@ -24,7 +24,10 @@ Twinkle.speedy = function twinklespeedy() {
return;
}

mw.loader.load('codex-styles');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be loaded only if needed (inside createCodexButton).

};

Twinkle.speedy.instantDecline = function twinklespeedyInstantDecline() {
const wikipediaPage = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Tagging page');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Tagging page" is not what this does

pageObj.setEditSummary('Declining speedy deletion (multiple criteria).');
}
pageObj.setChangeTags(Twinkle.changeTags);
pageObj.save(window.location.reload.bind(window.location));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We normally show a completion success message and then reload after a couple of seconds. Also, let's not use .bind - the same could have been written as () => window.location.reload().

} else {
pageObj.setEditSummary('Declining speedy deletion (multiple criteria).');
}
pageObj.setChangeTags(Twinkle.changeTags);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't handle watchlisting, which should be based on watchSpeedyPages pref, if not a new pref.

if (Twinkle.speedy.normalizeHash[splitTag] === 'db') {
pageObj.setEditSummary('Declining speedy deletion (no code provided).');
} else {
pageObj.setEditSummary('Declining speedy deletion ([[WP:CSD#' + Twinkle.speedy.normalizeHash[splitTag].toUpperCase() + '|CSD ' + Twinkle.speedy.normalizeHash[splitTag].toUpperCase() + ']]).');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit summary needs to include reason for declining. In other places we've done this using prompt().


if (splitTag in Twinkle.speedy.normalizeHash) {
if (Twinkle.speedy.normalizeHash[splitTag] === 'db') {
pageObj.setEditSummary('Declining speedy deletion (no code provided).');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"(no code provided)" is unnecessary

button.classList.add('cdx-button');

// Action classes
if (action !== 'neutral') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can drop all these ifs.

@NovemLinguae
Copy link
Member

Opening CSD module on a nominated page already configures the dialog to delete based on the nomination. So "quick delete" is possible today with 3 clicks (TW > CSD > Delete). This patch introduces a 1-click way to do that. I'm skeptical of this being worth the added complexity. 3 clicks seems okay for deleting a page. How about just making the Delete button open the CSD dialog? That would make it 2 clicks and avoid most of the complexity.

If the "Delete" button is only one click instead of two clicks, I'd recommend renaming it to "Quick Delete". This is similar to what XFDcloser does with its "Close" and "Quick Close" buttons.

We should decide if we want to only have a "Delete" button (2 clicks), only want to have a "Quick Delete" button (1 click), or have both.

@siddharthvp
Copy link
Member

We should decide if we want to only have a "Delete" button (2 clicks), only want to have a "Quick Delete" button (1 click), or have both.

I would suggest having only "Delete". The "Decline" button currently is really a "Quick Decline", but once a prompt() for reason is added, that would stop being the case.

@IlyasLebleu
Copy link
Contributor Author

Working on all the changes. Regarding "Delete" vs "Quick Delete", I don't see the point in making it two clicks instead of one. It makes sense for "Decline" since you'd want to input a reason, but "Delete" fundamentally means you agree with the speedy deletion tag, and adding an extra click would just make it more cumbersome (and defeat the original purpose of a shortcut button).

@siddharthvp
Copy link
Member

siddharthvp commented Dec 3, 2025

I think deleting a page is a serious thing and personally would prefer a 2-click process. XfdCloser has these quick actions but at least its interface makes it clear that the buttons are from a gadget. Here, the buttons look like a part of the template itself. I can't think of any other buttons on templates that cause an immediate write action (eg. the "create page" buttons from <inputbox> take you to page creation interface instead of directly creating), so folks may find it unexpected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants