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

[Reader IA] Integrate Top Bar Filter UI to Filter functionality #19856

Merged
merged 26 commits into from
Jan 10, 2024

Conversation

thomashorta
Copy link
Contributor

@thomashorta thomashorta commented Dec 28, 2023

Fixes #19855
Fixes #19851

Caution

Should not be merged before #19844

This integrates the new Filter component with the existing Filter functionality, while also updating the Filter Sheet to look a bit closer to the new specs, but some things, like the Edit Button and the style update for site items will be done in future PRs.

As a side effect, this PR also fixes #19851 since the root cause of that bug also caused the feed to refresh when selecting a Filter, which was needed for this PR.

19855-reader-ia-filter-integration.mp4

To Test:

  1. Install and log into Jetpack
  2. Go to the Reader
  3. Go to Feeds that are "filterable", such as "Subscriptions" and "Automattic" (for A12s)
  4. Verify the appropriate filter chips appear, with the correct count inside them
  5. Tap one of the filters
  6. Verify the correct bottom sheet opens (for blogs or tags)
  7. Select a filter item in the list
  8. Verify the correct blog/tag title is shown when selected
  9. Tap the filtered title (NOT the X button)
  10. Verify the bottom sheet opens for the same type of item (blog/tag)
  11. Cancel selection or select something else
  12. Tap the X button in the Filter chip for the selected item
  13. Verify clearing the filter works properly

Regression Notes

  1. Potential unintended areas of impact

    • Fetching posts / Loading functionality inside the feeds
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • Manual Testing
  3. What automated tests I added (or what prevented me from doing so)

    • TODO

PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

UI Changes Testing Checklist:

  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Dec 28, 2023

Warnings
⚠️ PR is not assigned to a milestone.
⚠️ PR has more than 300 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

@thomashorta thomashorta changed the base branch from trunk to issue/19605-reader-ia-update-selected-content-stream-based-on-menu-item December 28, 2023 22:59
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 28, 2023

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr19856-e37902e
Commite37902e
Direct Downloadwordpress-prototype-build-pr19856-e37902e.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 28, 2023

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr19856-e37902e
Commite37902e
Direct Downloadjetpack-prototype-build-pr19856-e37902e.apk
Note: Google Login is not supported on these builds.

Base automatically changed from issue/19605-reader-ia-update-selected-content-stream-based-on-menu-item to feature/reader-ia January 2, 2024 22:46
Copy link
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Thanks for this PR @thomashorta 🙇 ! Overall it looks good. I'm reporting an issue I found in one of my test accounts though. While comparing the viewpager tabs and feeds content for before / after, I see a missing menu item for "Followed P2S" (that is a filterable with only Sites and no Tags elements, I think similarly to the Automattic item)

Not sure how common this scenario is, but I think that menu is related to P2 the product sites that I think I created in that account from here if it's useful to create the test scenario.

cc @RenanLukas fyi.

@thomashorta
Copy link
Contributor Author

I'm reporting an issue I found in one of my test accounts though. While comparing the viewpager tabs and feeds content for before / after, I see a missing menu item for "Followed P2S" (that is a filterable with only Sites and no Tags elements, I think similarly to the Automattic item)

I don't think I understand what is the issue you're reporting here. In your comment, I only see a screenshot from the old UI (before) and there doesn't seem to be a report of what is the issue after the changes.

@develric
Copy link
Contributor

develric commented Jan 8, 2024

Hey @thomashorta 👋 , it seems I missed to paste a picture of how it looks for me with the version on this PR, sorry if it was not clear from the description and here is a before/after 👍

image

While comparing the viewpager tabs and feeds content for before / after, I see a missing menu item for "Followed P2S" (that is a filterable with only Sites and no Tags elements, I think similarly to the Automattic item)

What I was trying to say here is (using the same user for the before/after):

  • the "Followed P2s" item is missing in the after
  • If it's helpful, note that the "Followed P2s" filtering had only Sites (and not Tags) and I'd expect this to be similar to the behavior of the Automattic menu (that I verified shows up correctly in the after as well)

About how to get the Followed P2s on your side, what follows is my best guess

I think that menu is related to P2 the product sites that I think I created in that account from here if it's useful to create the test scenario.

but I can share my test account with you if it's quicker (just dm me in slack 👍 )

@thomashorta
Copy link
Contributor Author

Ah, I understand it now, though I don't think it has anything to do with this PR since this is integrating the filter functionality (blogs and tags) with the real data from each field, and not related to the feeds and drop-down menu itself.

Regarding this:

If it's helpful, note that the "Followed P2s" filtering had only Sites (and not Tags) and I'd expect this to be similar to the behavior of the Automattic menu (that I verified shows up correctly in the after as well)

The code in this PR already makes sure that we only show the "Blogs" pill for Automattic and P2 feeds, since I added the same logic used by the subscription management sheet to decide if the tag filter pill should be shown (https://github.com/wordpress-mobile/WordPress-Android/pull/19856/files#diff-2e098785089098d2a88d269ff91d4fb30d8f03c6c0fa67defdd892da6551e063R510-R511).

I think it makes sense to open a different issue for the "Followed P2" feed not showing on the drop-down menu, wdyt?

@thomashorta
Copy link
Contributor Author

@develric I went ahead and created an issue for what you reported since it's not related to the code in this PR (#19898).

@wordpress-mobile wordpress-mobile deleted a comment from wpmobilebot Jan 9, 2024
…der Following tab"

This reverts commit 530bb5c.

This revert is needed since now we do rely on information from the Following
blogs on the Following feed due to the new filters UI on the Top Bar.
@RenanLukas
Copy link
Contributor

Thanks for the PR, @thomashorta . I went through the testing steps and it's working as expected. I'm now moving to the code review.

I wanted to point out that adding this call again did not work for me to fix #19891:

Screen.Recording.2024-01-09.at.5.16.09.PM.mov

I've tried building locally and also with the APK provided by the wpmobilebot.

@RenanLukas
Copy link
Contributor

As discussed in DM, there was another bug that was fixed that prevented the subscription blogs from being fetched (fixed here). #19891 will remain open so we can work on it when it's possible as a UX improvement to show something other than "0 Blogs" when there's a fresh install.

Copy link
Contributor

@RenanLukas RenanLukas left a comment

Choose a reason for hiding this comment

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

@thomashorta code LGTM 👍

I just didn't approve yet to confirm if the strings with new content and same keys are a problem or not.

<string name="reader_filter_sites_title">Sites</string>
<string name="reader_filter_tags_title">Topics</string>
<string name="reader_filter_main_title">Following</string>
<string name="reader_filter_sites_title">Filter by blog</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't remember by heart: do we have to rename strings when the content changes to they're correctly picked up by GlotPress script?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I remember correctly, the script (or maybe GlotPress) is smart enough to see the changes and mark the Strings as "untranslated" in the platform. cc @oguzkocer or @AliSoftware to confirm that though.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should always treat strings as immutable—once you created a key with a value, you should avoid changing its value later on, especially if the first value already made it to a previous release.

This is because otherwise once this change hits trunk it will be sent to GlotPress and the new copy retranslated… but if we then pull the translations from GlotPress into the release/* branch before submitting to Google then that change of the copy would end up making its way to the release branch… despite being a change tied to something in trunk.

In summary modifying the value of an existing key will cause a discrepancy in the release/* branch, between the codebase (which will expect the old copy as that's what it was when code was frozen) and the translations (updated with the new copy when we'll pull the latest from GlotPress)

TL;DR: prefer using a brand new key.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, @AliSoftware

I'll change the string keys with new content to brand new ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @AliSoftware for the answer, that makes sense!

<string name="reader_filter_tags_title">Topics</string>
<string name="reader_filter_main_title">Following</string>
<string name="reader_filter_sites_title">Filter by blog</string>
<string name="reader_filter_tags_title">Filter by tag</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question about keeping the same string name when content changes.

@dangermattic
Copy link
Collaborator

2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

Copy link
Contributor

@RenanLukas RenanLukas left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@RenanLukas RenanLukas merged commit 9ee4b4f into feature/reader-ia Jan 10, 2024
19 checks passed
@RenanLukas RenanLukas deleted the issue/19855-reader-ia-filter-integration branch January 10, 2024 17:00
@thomashorta thomashorta mentioned this pull request Jan 18, 2024
12 tasks
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.

[Reader IA] Integrate Filter Chips with existing Filter functionality
6 participants