-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
|
Codecov ReportAttention: Patch coverage is
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. |
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.
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( |
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.
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?
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.
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 { |
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.
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( |
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.
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( |
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.
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).
…derPostDetailHeaderViewBinding directly
…iewBinding directly
Thanks for the review, @thomashorta ! |
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
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.
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.
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 onDiscover
, 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
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
ReaderDiscoverViewModelTest.kt
.PR Submission Checklist:
RELEASE-NOTES.txt
if necessary.Testing Checklist (strike-out the not-applying and unnecessary ones):