Handle TopicUiState.Error without crashing TopicScreen#2117
Handle TopicUiState.Error without crashing TopicScreen#2117saadkhalidkhan wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Replace TODO() with error UI when topic or news loading fails, and add a compose test for the error state. Fixes android#2108
2ba0cdb to
4ed4992
Compare
There was a problem hiding this comment.
Code Review
This pull request implements the error state for the topic screen by adding dedicated UI components, localized error strings, and a corresponding UI test. The feedback highlights a potential issue in the topicItemsSize function where the success state logic may not accurately account for all items, which could lead to incorrect scrollbar behavior.
Account for TopicToolbar and TopicHeader when computing itemsAvailable for TopicUiState.Success.
Summary
TODO()inTopicScreenwith error UI when topic loading failsTopicUiState.ErrorFixes #2108
Test plan
./gradlew assembleDemoDebugpasses./gradlew :feature:topic:impl:compileDemoDebugAndroidTestKotlinpassesTopicScreenTest.topicError_whenTopicIsError_isShownon device/emulator