[go: nahoru, domu]

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

Open
wants to merge 17 commits into
base: trunk
Choose a base branch
from

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
1 Error
🚫 Please add tests for class ChipStyle (or add unit-tests-exemption label to ignore this).
3 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.
⚠️ 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-229ddd5
Commit229ddd5
Direct Downloadjetpack-prototype-build-pr20947-229ddd5.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-229ddd5
Commit229ddd5
Direct Downloadwordpress-prototype-build-pr20947-229ddd5.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.77%. Comparing base (a24e5d1) to head (229ddd5).
Report is 328 commits behind head on trunk.

Files 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.93%   40.77%   -0.16%     
==========================================
  Files        1519     1518       -1     
  Lines       69554    69405     -149     
  Branches    11473    11463      -10     
==========================================
- Hits        28473    28303     -170     
- Misses      38495    38519      +24     
+ Partials     2586     2583       -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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Reader Improvements] Remove all the Reader files from the previous layout
5 participants