Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-fill "unlink" summary #370

Open
owcz opened this issue Dec 21, 2016 · 3 comments
Open

Auto-fill "unlink" summary #370

owcz opened this issue Dec 21, 2016 · 3 comments

Comments

@owcz
Copy link

owcz commented Dec 21, 2016

I imagine the most common use for the "unlink" tab is unlinking articles deleted at AfD. When a page is deleted, it would be helpful to auto-populate the unlink summary with the text of the most recent deletion rationale (usually a variant of "[[Wikipedia:Articles for deletion/Example]] closed as delete").

@Amorymeltzer
Copy link
Collaborator

Amorymeltzer commented Feb 21, 2019

Maybe, but given that most XfD deletions (and thus subsequent unlinks) are now done via XfDCloser, I think any need for this is fairly diminished; moreover, it is autofilled if a sysop navigates to it after speedy deleting the page. We could autofill if we're on a a non-log AfD subpage, I suppose, but is it frequent where someone goes to the AfD to cleanup after a sysop has chosen not to do so? Not sure we should encourage that.

@owcz
Copy link
Author

owcz commented Feb 21, 2019

I wasn't thinking about the AfD subpage itself but when I visit the deleted page, and want to clear out any remaining unlinks (e.g., if the close was done manually or failed for whatever reason), I have to manually copy the AfD link into the unlinker's edit summary each time rather than it autopopulating.

Also before Evad's tool added automatic unlinking, many admins did not bother cleaning up links after AfDs so there is ostensibly a lot of unlinking left to do :)

@Amorymeltzer
Copy link
Collaborator

Something like this in Twinkle.unlink would be roughly what's needed:

var presetReason;
if (mw.config.get('wgArticleId') === 0 &&
	$('.mw-warning-with-logexcerpt li')[0].className === 'mw-logline-delete' &&
	mw.config.get('wgNamespaceNumber') === 0) {
	var reg = new RegExp(RegExp.escape('Wikipedia:Articles for deletion/' + Morebits.pageNameNorm, true), 'i');
	if (reg.test($('.mw-logline-delete span.comment').first().html())) {
		presetReason = '[[' + Morebits.pageNameNorm + ']] deleted at AfD';
	}
}

Twinkle.addPortletLink(Twinkle.unlink.callback(presetReason), 'Unlink', 'tw-unlink', 'Unlink backlinks');

It only detects cases where an AfD is physically linked in the description, and doesn't attempt to actually use that link.

It's not the end of the world, but it's far from perfect. Maybe net positive?

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

No branches or pull requests

2 participants