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] Remove improvements FF and unused UI files #20947

Merged
merged 19 commits into from
Aug 28, 2024

Conversation

RenanLukas
Copy link
Contributor

@RenanLukas RenanLukas commented Jun 6, 2024

Fixes #19261


To Test:

Basically the Reader should continue to work as expected, including all the feeds (Discover, Subscriptions, Saved, Liked, Your Tags and custom lists), post details, recommendation cards on Discover, actions, etc.
It would be nice to also test it out using light and dark themes since the PR is related to UI.


Regression Notes

  1. Potential unintended areas of impact

    • Reader post lists and post details.
  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)

    • Updated ReaderDiscoverViewModelTest.kt.

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.

Testing Checklist (strike-out the not-applying and unnecessary ones):

  • WordPress.com sites and self-hosted Jetpack sites.
  • 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)

@dangermattic
Copy link
Collaborator

dangermattic commented Jun 6, 2024

4 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ Class ChipStyle is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 6, 2024

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
Versionpr20947-5726d0d
Commit5726d0d
Direct Downloadjetpack-prototype-build-pr20947-5726d0d.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 6, 2024

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
Versionpr20947-5726d0d
Commit5726d0d
Direct Downloadwordpress-prototype-build-pr20947-5726d0d.apk
Note: Google Login is not supported on these builds.

@RenanLukas RenanLukas marked this pull request as ready for review June 6, 2024 23:00
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 85.29412% with 5 lines in your changes missing coverage. Please review.

Project coverage is 40.41%. Comparing base (5f0bc7d) to head (5726d0d).
Report is 20 commits behind head on trunk.

Files with missing lines Patch % Lines
...oid/ui/reader/discover/ReaderPostUiStateBuilder.kt 72.72% 2 Missing and 1 partial ⚠️
...der/viewmodels/tagsfeed/ReaderTagsFeedViewModel.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #20947      +/-   ##
==========================================
- Coverage   40.57%   40.41%   -0.16%     
==========================================
  Files        1535     1534       -1     
  Lines       70516    70367     -149     
  Branches    11662    11652      -10     
==========================================
- Hits        28609    28439     -170     
- Misses      39322    39346      +24     
+ Partials     2585     2582       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@thomashorta thomashorta left a comment

Choose a reason for hiding this comment

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

Overall the code looks good but I noticed a few places that the New nomenclature is still being used (in some class names and Theme styles) and also found a place where we are mapping to a "legacy" UI model and I'm not sure if that means we're still showing the old post UI somewhere, can you double check?

)
}
}

@Suppress("LongParameterList")
fun mapPostToUiStateBlocking(
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this is still being used somewhere, is that correct? Doesn't it map to the old UI State for the old post UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason I thought it was being used, but it seems like it was just being used in the unit tests. Code updated.

@@ -200,34 +196,12 @@ class ReaderExpandableTagsView @JvmOverloads constructor(
@ColorRes
fun overflowStrokeColorRes(isCollapsed: Boolean): Int? = null

object Legacy : ChipStyle {
data object Default : ChipStyle {
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we have just one implementation, what do you think about making ChipStyle a concrete class and moving the implementation from this subclass to there?

// do nothing
}
}

class ImprovementsEnabled(
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we have just one implementation, what do you think about making ReaderPostDetailHeaderBinding a concrete class and moving the implementation from this subclass to there?

ReaderTagHeaderViewNewBinding.inflate(LayoutInflater.from(context), this, true)
val readerTagHeaderViewBinding =
ReaderTagHeaderViewBinding.inflate(LayoutInflater.from(context), this, true)
binding =
ReaderTagBinding.ImprovementsEnabled(
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we have just one implementation, what do you think about making ReaderTagBinding a concrete class and moving the implementation from this subclass to there?

Also, delete the now unused ImprovementsDisabled class (which will be necessary anyway if you implement the suggestion above).

@RenanLukas
Copy link
Contributor Author

Thanks for the review, @thomashorta !
I've implemented your suggestions and if CI is 🟢 it should be ready for a second review.

Copy link

sonarcloud bot commented Jun 11, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@nbradbury nbradbury self-assigned this Aug 28, 2024
Copy link

sonarcloud bot commented Aug 28, 2024

@nbradbury nbradbury requested review from nbradbury and removed request for develric August 28, 2024 19:06
Copy link
Contributor

@nbradbury nbradbury left a comment

Choose a reason for hiding this comment

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

As discussed elsewhere, we've decided to close older PRs that have non-trivial merge conflicts and/or have non-trivial CI issues. Based on that, this should be closed. However, given that this removes 3001 lines of outdated code and it was previously approved, I felt it worthwhile to update it and get it working. :shipit:

@nbradbury nbradbury merged commit 9ee898d into trunk Aug 28, 2024
21 checks passed
@nbradbury nbradbury deleted the issue/19261-reader-remove-unused-files branch August 28, 2024 19:07
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 Improvements] Remove all the Reader files from the previous layout
6 participants