Skip to content

Conversation

SttApollo
Copy link

@SttApollo SttApollo commented Jul 2, 2025

What is it?

  • Feature (user facing)
  • Codebase improvement (dev facing)

Description of the changes in your PR

  • Created a new Compose-based ErrorPanel component.
  • Ensured the new error panel is fully theme-adaptive using MaterialTheme.colorScheme and that all text is centered for visual parity with the legacy design.
  • Introduced a new ErrorPanelSpec data class to flexibly describe error panel content and actions.
  • Created ErrorUiModel interface to represent different failure states along with UnableToLoadCommentsUiModel specific to Comments section.
  • Added a focused test suite: Unit tests for ErrorUiModel and Integration tests for the two main error states in the comment section: Resource.Error (initial load failure) and LoadState.Error (paging failure). Would add Compose testing with approval to add a new dependency.
  • Manual Testing: Verified error handling by forcing errors in both CommentsViewModel (Resource.Error) and CommentsSource (LoadState.Error) to ensure proper UI rendering and error model mapping.

Before/After Screenshots/Screen Record

Before After
Before After

Fixes the following issue(s)

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.

@github-actions github-actions bot added the size/large PRs with less than 750 changed lines label Jul 2, 2025
@SttApollo
Copy link
Author

@Stypox Apologies for the fairly large diff—thought it would make sense to add a new Compose-based ErrorPanel and have it wired up end-to-end as a first step towards migration. I’m happy to split it up or tweak anything to fit the overall architecture—just let me know!

@ShareASmile ShareASmile added GUI Issue is related to the graphical user interface comments Anything to do with comments and comment replies under videos/audios rewrite Issues and PRs related to rewrite labels Jul 3, 2025
@github-project-automation github-project-automation bot moved this to In Progress in Rewrite Jul 3, 2025
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Thank you! I think this PR is the right size, and also you wrote many tests which increase the "PR line count" but do not add reviewing complexity, so there is no need to split it. And thanks for also writing test! I left a few comments to try to make the code more general so it can be used more seamlessly in other places in the app in the future (to replace other error panels in various places).

@SttApollo
Copy link
Author

@Stypox I have incorporated your requests - removed the other files and just added one test file. Also I didn't want to add an additional dependency for compose testing but please let me know if you'd like me to!

@ShareASmile ShareASmile added the ready for review Most of the work is done, PR is now ready for a review label Jul 30, 2025
@absurdlylongusername
Copy link
Member

absurdlylongusername commented Aug 12, 2025

@Stypox I have incorporated your requests - removed the other files and just added one test file. Also I didn't want to add an additional dependency for compose testing but please let me know if you'd like me to!

@SttApollo Tbh I have no qualms with you adding compose testing, because we are going to be adding UI tests very soon anyway. Currently we have no UI tests whatsoever, and I don't really see a downside to having tests for new functionality.

@Stypox, thoughts?

@Stypox
Copy link
Member

Stypox commented Aug 12, 2025

Yeah it would be cool if you added some tests! Would you be ok with opening a new PR after this one is merged, to setup the UI tests infrastructure and add tests for what you added in this PR? Otherwise you can also add UI tests in this PR, let us know what you prefer :-)

@SttApollo
Copy link
Author

Sure, I can open a new PR after this one is merged. For the UI test infra, I was thinking we could start with Compose instrumented testing—does that align with what you had in mind? Or should we also add Robolectric-based Compose tests and/or snapshot testing early on?

SttApollo and others added 8 commits September 5, 2025 13:35
- Moved from androidTest to test directory
- Removed Android test runner dependencies
- Renamed to CommentSectionErrorTest
- Addresses PR feedback until Compose testing is in place
@Stypox Stypox force-pushed the Create_CommentSection_ErrorPanel branch from c9fab2b to e27c7ed Compare September 5, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comments Anything to do with comments and comment replies under videos/audios GUI Issue is related to the graphical user interface ready for review Most of the work is done, PR is now ready for a review rewrite Issues and PRs related to rewrite size/large PRs with less than 750 changed lines
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

5 participants