Migrate comment fragments to Jetpack Compose#11060
Migrate comment fragments to Jetpack Compose#11060Stypox merged 65 commits intoTeamNewPipe:refactorfrom
Conversation
c77ea74 to
c106fb0
Compare
ce7c3ee to
64a92bd
Compare
c834fd0 to
8ee1817
Compare
da0c0c9 to
7f7faac
Compare
31f1fcf to
e973ce1
Compare
3ce32b0 to
2049c81
Compare
bace455 to
10dd571
Compare
e608cc5 to
ebcfcc4
Compare
The previous implementation was skipping the first page of comments
|
I pushed a few commits:
|
|
Stypox
left a comment
There was a problem hiding this comment.
Thank you! I implemented the TODOs in my previous comment.
The review comments I left here are things to do in future PRs.
| @Composable | ||
| fun rememberParsedDescription(description: Description): AnnotatedString { | ||
| // TODO: Handle links and hashtags, Markdown. | ||
| return remember(description) { | ||
| if (description.type == Description.HTML) { | ||
| val styles = TextLinkStyles(SpanStyle(textDecoration = TextDecoration.Underline)) | ||
| AnnotatedString.fromHtml(description.content, styles) | ||
| } else { | ||
| AnnotatedString(description.content) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Note: reimplementing Description -> AnnotatedString is going to be a tough task, considering how complicated TextLinkifier is: https://github.com/TeamNewPipe/NewPipe/blob/9d6ac67c46a6cc55e03dec0599d8070f7430098d/app/src/main/java/org/schabi/newpipe/util/text/TextLinkifier.java
|
|
||
| is Resource.Error -> { | ||
| item { | ||
| NoItemsMessage(R.string.error_unable_to_load_comments) |
There was a problem hiding this comment.
An error panel should be created to handle all of these cases and allow retrying, reporting and opening in browser.
AudricV
left a comment
There was a problem hiding this comment.
Here is some general feedback to be added to my review comments:
- the difference between the two loading spinners is a bit disturbing, the new one for comments doesn't seem to match Material Design style;
- it would be great if the replies only prevent interacting with comments and not all content (i.e. comment drawers cannot be shown outside of the comments view).
| // params.key is null the first time load() is called, and we need to return the first page | ||
| val repliesPage = params.key ?: commentInfo.replies | ||
| val info = withContext(Dispatchers.IO) { | ||
| CommentsInfo.getMoreItems(service, commentInfo.url, repliesPage) |
There was a problem hiding this comment.
The app crashes when trying to load comment replies when being offline after comments have been loaded with a network connection at this exact line (it should also happen on comment continuations). This must be fixed.
There was a problem hiding this comment.
There is no cache in the comment replies fetching, causing the app to reload them each time the device is rotated or a switch between the description content view tab and the comments one is done. This regression must be fixed.
|
I created issues for the remaining post-review comments |
|
Now errors in the comments make the app crash completely (https://soundcloud.com/user-722618400/a-real-playa): Exception
Crash log
|
|
I’ll add an issue and mark it high priority |



What is it?
Description of the changes in your PR
Before/After Screenshots/Screen Record
Screen_recording_20240708_162549.mp4
Relies on the following changes
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence