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

AO3-6875 Add additional wrangling status filtering options to tag search #5029

Merged

Conversation

metallicity
Copy link
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-6875

Purpose

This PR expands the existing options for filtering based on wrangling status on the Tag Search page. Previously, users could only filter on canonical tags, non-canonical tags, or both. Now the options also allow distinguishing between tags that are synonyms of canonical tags, in every combination of these wrangling statuses.

(Notably, this includes a "Canonical or synonymous" option that was omitted from the original ticket description. It seemed like an obviously useful addition, and required no additional tracking within the tag index data model to support, but it would be easy enough to remove it from the page if there is some concern over showing too many options to the user.)

Testing Instructions

  1. Identify or create a set of canonical, synonymous, and non-canonical and non-synonymous tags.
  2. Search for each tag by name (or all tags at once if they share one or more distinct words in their names)
  3. Any canonical tag should appear only when selecting the following wrangling status options: "Canonical", "Canonical or synonymous", "Any status"
  4. Any synonymous tag should appear only when selecting the following wrangling status options: "Non-canonical", "Synonymous", "Canonical or synonymous", "Any status"
  5. Any non-canonical and non-synonymous tag should appear only when selecting the following wrangling status options: "Non-canonical", "Non-canonical and non-synonymous", "Any status"

References

#4144 - Original PR introducing the "wrangling status" section of the Tag Search page

Credit

Metallicity (they/them)

@sarken
Copy link
Collaborator

sarken commented Jan 17, 2025

Hi, Metallicity!

Thank you so much for this pull request. I'm checking in with the Tag Wrangling team about whether they'd like the "Canonical or synonymous" option added, and someone will be along to review the code soon.

In the meantime, I've updated the Jira issue status to In Review, so no one will mistakenly create a duplicate pull request. If you'd like the ability to comment on, assign, and transition issues in the future, you're welcome to create a Jira account! You can just reply here with the account name and we'll set up the permissions for you. (It makes things a bit easier for us on the organizational side if the Full Name on your Jira account either closely matches the name you'd like us to credit in the release notes or includes it in parentheses, e.g. "Nickname (CREDIT NAME).")

Thanks again for contributing! If you have any questions, you can contact us at [email protected].

@metallicity
Copy link
Contributor Author

@sarken I just joined the otwarchive Jira with an account named "Metallicity".

@sarken
Copy link
Collaborator

sarken commented Jan 18, 2025

@metallicity Great! I've given your account the permissions I mentioned and updated the issue to assign it to you and add your testing instructions. The Tag Wrangling team has also approved the inclusion of the "Canonical or synonymous" option, so this is ready for review!

I did notice some Reviewdog comments about using the old ts() method when I glanced at the code while updating the Jira issue. If you'd like some info on how to deal with those comments, you can check out our Internationalization (i18n) Standards wiki page.

@metallicity metallicity force-pushed the AO3-6808_tag_search_wrangling_status branch from ca89de9 to bbe047d Compare January 18, 2025 03:57
@metallicity
Copy link
Contributor Author

I moved all the "wrangling status" option labels into en.yml, as well as the more low hanging fruit from the rest of the page. But there are several non-obvious sections on the Tag Search page, particularly the tag types radio button set and the sort by/sort direction drop downs, which I'm not sure have an established i18n convention within the codebase. Regardless, all of those sections are unrelated to the PR itself.

@metallicity metallicity force-pushed the AO3-6808_tag_search_wrangling_status branch from bbe047d to 914b01f Compare January 18, 2025 04:18
@redsummernight redsummernight added the Needs Reindex Contains changes that will require Elasticsearch reindexing label Feb 21, 2025
@metallicity metallicity force-pushed the AO3-6808_tag_search_wrangling_status branch from 538a86b to 1d466b0 Compare February 21, 2025 12:29
@metallicity
Copy link
Contributor Author

metallicity commented Feb 21, 2025

Addressed both comments. Nothing that I wasn't half expecting, I had already gone back and forth on which way set_wrangling_status would be more clear.

Also re-requested you for review, @redsummernight, but feel free to take yourself off if it's better to just leave it with a general "Awaiting Review" tag or something.

@redsummernight
Copy link
Member

Because we're adding a new field to tag index, we'll need to reindex all tags on production when deploying this change by running:

TagIndexer.index_from_db

But I think it may be possible to do wrangling status filtering not by adding a new field, but by checking the existing field merger_id. I'll get back to you on that.

@metallicity metallicity force-pushed the AO3-6808_tag_search_wrangling_status branch from 218771d to 8004014 Compare February 23, 2025 12:17
@metallicity
Copy link
Contributor Author

@redsummernight Intuitively, using just the value of canonical and whether merger_id is present seems like it should work fine. It does make the interaction with the original canonical_filter a bit more awkward though, so it struck me as simpler to instead combine things into a single wrangling_status_filter, and then move the wrangling_status case block directly into tag_query.rb.

@metallicity
Copy link
Contributor Author

It should be safe to remove the Needs Reindex label on this PR now, since I reverted all the changes that using merger_id made unnecessary.

Copy link
Member

@redsummernight redsummernight left a comment

Choose a reason for hiding this comment

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

The approach looks good! Just some minor comments.

@redsummernight redsummernight removed the Needs Reindex Contains changes that will require Elasticsearch reindexing label Feb 23, 2025
@metallicity metallicity force-pushed the AO3-6808_tag_search_wrangling_status branch 3 times, most recently from b08b2d2 to 8979d69 Compare February 25, 2025 09:27
@metallicity metallicity force-pushed the AO3-6808_tag_search_wrangling_status branch from 8979d69 to c146ebd Compare February 25, 2025 10:11
Copy link
Member

@redsummernight redsummernight left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@sarken sarken merged commit 766d3ed into otwcode:master Mar 11, 2025
29 checks passed
@brianjaustin
Copy link
Member

@metallicity the wranglers say thank you for this improvement!

@sea-otw
Copy link

sea-otw commented Mar 17, 2025

@metallicity hi, just popping by from wranglerland to confirm that we wranglers are indeed overjoyed with the improvement! thank you for all the effort you've put into it <3

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.

5 participants