XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

New Features: Quick Flags; Mass Labeler

Open marcustyphoon opened this issue 3 years ago • 8 comments

Description

This creates a script to quickly toggle the mature content ~~community~~ labels on your ~~original posts~~ posts and reblogs.

It implements a Quick Tags-style dropdown that lets the user label an individual post and a bulk-edit sidebar option and modal form to easily retroactively flag every post with certain tags or the user's entire blog.

Continuation of #771.

  • [x] import #839 with slight modifications
  • ~~skip attempts to edit legacy posts (https://discord.com/channels/104051306309644288/327155782934200320/1074380420361224272)~~ no longer needed
  • [x] use the mass post editor endpoints
  • [x] update UI logic for virtual scroller (probably simplify)
  • [x] check error handling code
  • [x] #1450

This PR can be split into two (quick reblogs / mass labeler) or three (two stacked PRs on a util implementation PR) on request; it's quite easy for me to do so feel free to do so. While it's not under active review I find it less maintenance to have it as a single PR to reduce work keeping it up to date.

Testing steps

Quick Flags: Enable the feature and confirm that...

  • Quick Flags buttons are added to editable post/post draft footers with all relevant footer-related account flags
  • Quick Flags buttons are not added to ask/submission footers with all relevant footer-related account flags
  • Quick Flags buttons open UI when clicked that accurately reflects post community label status
  • Quick Flags can be used to:
    • add the mature label to an unlabelled post
    • add a category to an unlabelled post, which will also add the mature label
    • remove a category from a labelled post
    • remove the mature label from a labelled post, which will also remove all categories
  • After using Quick Flags, Quick Flags buttons open UI when clicked that accurately reflect new post community label status
  • After using Quick Flags, an indicator is shown if the new post community label status differs from that shown by the Tumblr UI
  • After using Quick Flags, an indicator is not shown if the new post community label status does not differ from that shown by the Tumblr UI, e.g. if using Quick Flags to set back the original post state
  • Indicators persist if posts are scrolled far off the screen and back with endless scrolling enabled
  • An error message appears and Quick Flags checkboxes do not become out of sync if the bulkCommunityLabel API fetch fails (disconnected network, etc)

Mass Labeler: Enable the feature and confirm that...

  • A Mass Labeler sidebar item appears on the "channel" pages' "posts" views
  • The Mass Labeler form appears and has the current blog selected when opened
  • Mass Labeler adds content labels to posts
  • Mass Labeler adds content labels to only posts with the selected tags/in the selected time range
  • Mass Labeler adds only the chosen content labels. For example, if the "violence" category is added, at the same time, to a post with the "drug/alcohol" label and a different post with the "sexual themes" label, each post should only have its label and the added label.
  • An error message appears if the bulkCommunityLabel API fetch fails (disconnected network, etc)

marcustyphoon avatar Nov 16 '22 08:11 marcustyphoon

I was going to update this to use the mass post editor endpoint (https://www.tumblr.com/changes/715595761003429888/tuesday-april-25th-2023) to perform the edits in batches of 100, but the page actually uses a legacy SVC endpoint at the moment, which we can't realistically make use of.

Edit: It was fixed not to use internal blog IDs, but it currently overwrites label categories rather than adding to them. This makes it difficult to use in a bulk scenario, as multiple posts which begin with different categories cannot be edited correctly in the same API request.

marcustyphoon avatar May 05 '23 22:05 marcustyphoon

The mass post editor continues to overwrite rather than add, unlike what its UI suggests. Using its endpoint correctly would therefore require sorting posts by their current labels, which I actually am happy to code.

This is, on the one hand, a lot of coding effort (sure) and testing/maintenance effort (problematic) for a feature that I would be surprised if many people used.

On the other hand, I think this existing is good for the completeness of the ecosystem; if we really want to encourage people to community label their content comprehensively, better tools to do that seem like good messaging.

marcustyphoon avatar Sep 22 '23 23:09 marcustyphoon

👍 I feel like if I ever have a baby I'll need to message you for naming suggestions.

marcustyphoon avatar Apr 29 '24 08:04 marcustyphoon