-
Notifications
You must be signed in to change notification settings - Fork 143
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
batchdelete: allow deletion of subpages #581
batchdelete: allow deletion of subpages #581
Conversation
9b18a1a
to
4f117f3
Compare
Haha great minds: I'm on a bus with limited wifi, and figured this was an easy thing to whip up while watching Firefly. This is nearly exactly what I wrote up — I've got a couple longer comments I'll make when I get a chance, but overall structure is fine. |
This shouldn't be done in namespaces where subpages are not enabled, like ns:0 on enwiki. I think it would be better to have a selection like d-batch. Example case:
Similar things occur with templates where a template name contains a |
That basically covers what I was going to say, namely this ''needs'' to ignore Mainspace. I don't quite follow on templatespace, though — @JJMC89 do you have an example? I don't think there's a js variable exposed for this config, I can open a phab (though it won't help here). Anyway, the other major difference between this and my code was I tack on a That's straightforward enough, but the tricky issue is subpages of talk pages without corresponding pages, aka archives. I basically dealt with this by not dealing with it. I think we should include some notes/tooltips, but basically they're currently not being deleted anyway so it's no loss. Moreover, I don't know that we want to automatically remove all talk page archives, and I think it'd be better to have sysops have to explicitly note the existence of talk pages in their list. How's that sound @JJMC89? As for listing the individual subpages, what this code will do is briefly list the items as they are deleted, and then once deleted will collapse that to a single line saying something like "Deleting subpages of page (7/7)". That is obviously most efficient, and is similar to how we handle redirects in that there's no confirmation/etc., but I do share the concerns that there could be a lot of subpages deleted without knowing it. Basically, I'm worried that this is basically enabling the
|
I couldn't find the original example that I was thinking of, but Template:Yes/no (redirect to Template:Yesno) isn't related to Template:Yes.
I'm not really too concerned with talk archives. In most cases, pages being deleted don't have them.
I don't think deleting all subpages without confirming what is being deleted is a good idea, and I would prefer to be able to select which subpages to delete. |
I think this option is the way to go. I spent a couple of hours on this and hope to fix it up soon. I don't think there is a way to list out all the subpages of n different pages using a single API call; it requires n API calls. So @atlight's |
@JJMC89 I see now — the problem being, of course, that the software thinks [[Template:Yes/no]] is a subpage of [[Template:Yes]]. I think templatespace would be one of the man places this would be desirable, with so many /doc and other subpages frequently being left behind. Perhaps we'll have to rely upon sysops to be careful? I'm in favor of loading this up with a couple scary warnings. ETA: There's no wg for namespace with subpages, but I knew I'd seen something before; we can access it via API. A |
@Amorymeltzer @JJMC89 Done. The list of all subpages will now be displayed below the main list. Archives of talk pages won't be deleted. If we wish to delete them too, we'd have to query the list of subpages for all talk pages too, more than doubling the number of api calls. I've provided additional options for i) deletion of redirects of subpages, and ii) unlinking of subpages, but not for deletion of talk pages of subpages (which is done if main talk page deletion is checked). |
I'm heading to bed so can't do a full review, but this will display subpages of every page, regardless of whether they're checked or not, right? That seems problematic. I don't think we want to regenerate the subpage list on the fly whenever one of the top-level page boxes is checked or unchecked, but the list of subpages should respect that list somehow, most likely when the subpages box is checked. Open to brainstorming. Form looks gorgeous, though. |
0fe4e21
to
88f94e7
Compare
f351c88
to
801120b
Compare
Should have thought about that earlier. Fixed now. |
801120b
to
cdf2a5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay @siddharthvp — I got busy, this got complicated, and it's a (comparatively) weird code structure I'm less familiar with. I'll try and tackle this this week.
@siddharthvp I don't have the time/brainpower to delve into the code atm, but from a quick look and test, there's something weird happening when checking/unchecking boxes. Test page has two pages linked, one mainspace and one user, the latter with subpages.
If I toggle a page on or off before toggling subpages, there's no issue, but it seems toggling the subpage box will retain a page's unchecked status if reached once the subpages menu is triggered. |
Did you use the Select All/Deselect All buttons any time during the above tests? I belatedly realised that those buttons don't work properly in the presence of subpage checkboxes. I will fix that. I also plan to add arrow |
No, just the checkboxes. And no rush, thanks for letting me know. |
Add an optional that runs after the batch has processed. To be used in twinklebatchdelete.js
cdf2a5e
to
fdb5547
Compare
fdb5547
to
01322ed
Compare
I've just pushed a new version, which is hopefully bug-free. Fixed the issue that you pointed out in bullet point 4 above. Fixed the select all/deselect all buttons. Fixed the issue with shiftclick support. Added |
In order to fix the issue of shiftclick support to the main page list (when subpages are present), I have provided a fix in |
In the present scheme, the subpages are being deleted only after all the main pages (along with main pages' talkpages and redirects) have been deleted. It'd be better to delete subpages along with their parent page. But there seems to be no easy way of identifying which subpages belong to which page at evaulate-time. |
3d31a32
to
d856319
Compare
note: I deleted the commit that added |
Have now tested this using the newly-gained admin bit on testwiki. Everything seems to work as intended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great code @siddharthvp, glad you ended up doing this since it turned out to be so involved! Only a few minor changes/questions needed here. One big issue though, that I haven't run down yet: I can't seem to get it to delete talk pages of subpages being deleted! Nope, I was in userspace, dumb move on my part. 🤕 Works like a charm!
My only other real nitpick is that if someone opens the dbatch menu, loads the subpage box, closes the dbatch menu, then re-opens it, the whole subpage function doesn't work. That's not something IMO that should block this, but I think it's a definite bug to deal with at some point. |
d856319
to
ad142f9
Compare
Nice catch! Fixed. Will look at other comments when I have time. |
ad142f9
to
fa04471
Compare
all resolved. |
Rather than just marking the checkboxes as checked/unchecked, trigger the click event on the checkboxes, so that the click event listeners are activated in addtion to checkboxes being marked as checked/unchecked. While using quickForm for example, the event listener shows/hides the subgroup.
Lists of subpages for each page are listed on the interface, with checkboxes for subpages being in subgroupof the checkbox for main page. A link is provided for each page next to it.
fa04471
to
d39cd4f
Compare
💯 work on this |
… intentionally limited - Actual code changes are two in `twinkledeprod`, one in `twinklespeedy`, and two in `twinklexfd` (similar work done in wikimedia-gadgets#568 and wikimedia-gadgets#581) - Exceptions are four `rvlimit`s in `twinklearv` and one `rvlimit` in `twinklefluff`, all related to sequentially processing revisions. - Unified comments: - `max`: `// 500 is max for normal users, 5000 for bots and sysops` - non-max: `// intentionally limited` - Removed erroneous comments for `batchMax` (holdover from [2007](https://en.wikipedia.org/w/index.php?title=User%3AAzaToth%2Ftwinklebatchdelete.js&diff=prev&oldid=169056183))
Trying to solve #305. Though I can't be sure whether this works without having the sysop bit.
This handles the subpages just as the redirects are being handled (they are deleted without being listed, so individual pages can't be de-selected). We may need to think about whether sysops ought to be deleting subpages without knowing anything about which are the subpages or how many of them are there (until they see the "Deleting ___" status messages). If deemed necessary, this can be tweaked to list out all the subpages along with the main pages (so that they are known to the user beforehand, and can be de-selected).