Migrated ZimHostFragment -> ZimHostRoute#4736
Migrated ZimHostFragment -> ZimHostRoute#4736atharvyadav22 wants to merge 7 commits intokiwix:mainfrom
Conversation
|
@MohitMaliFtechiz I have added comments to help other read the code, also from previous migration i have implemented your points so it saves time. Migration covered these parts-
|
|
@MohitMaliFtechiz Done with this migration waiting for your reviews. |
MohitMaliFtechiz
left a comment
There was a problem hiding this comment.
@atharvyadav22 Please see the review changes. If anything is unclear, please ask me before implementing it. Since this PR has many logic changes. It takes significant time in testing/reviewing PRs like this one.
app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostRoute.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostRoute.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostRoute.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostRoute.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostRoute.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostRoute.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostRoute.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostViewModel.kt
Outdated
Show resolved
Hide resolved
Yes thanks for your valuable time and pointing out i always try to not many many possible errors and solve then push commits but migration is lengthy anyways i'll take care of in in next commit i'll solve everything you mentioned so it won't take your time. |
|
@atharvyadav22 Mark your PR as a draft when the effort is ongoing. |
1c7b91d to
362d142
Compare
|
@MohitMaliFtechiz i'll prioritize this one issue now. |
9e0f64e to
0b8fe03
Compare
|
@MohitMaliFtechiz i have checked the code and functionality it works fine for all the cases.
this should be passed via Constructor, also for my PR of stabilization IO i didn't touched this as this is little complex and as migration was going. similarly for this we cant control this in tests so to properly make an robust test we need to consider this after migration properly i suppose, cause we have seen many issues with these in past also. |
|
@atharvyadav22 Now, this PR code is set. You can start writing the test cases(unit test cases) for ZimHostViewModel and other things introduced in this PR. If any UI test case fails, please have a look at that as well :) If you need anything from me, just drop a comment here. |
|
@MohitMaliFtechiz okay ill do it here i see new pushes |
|
@atharvyadav22 For Here we need to add/update/improve the test cases for this PR. Not for other screens. Since |
new tests file for newly created methods right only or any specific things? As we are in urgent for migration for that |
The newly created files with edge cases.
Thank you for showing interest. But OnlineScreen has many logics and scenarios. I will take that. You can take some other issues :). |
Okay if there is anything which might help kiwix and save your time i can help with that if something you feel. |
|
@atharvyadav22 Any update here? |
Yes actually i am doing coverage also side by side for this. I am currently doing that Media Save PR as the recent test files fails for new code so its taking me time to rewrite them along side i am doing that I'll do this PR by this week itself, actually i am using best practice and trying to make test robust so it saves your reviewing time to so its taking me time. |
0b8fe03 to
2b9a93f
Compare
|
@MohitMaliFtechiz |
|
@atharvyadav22 Yes, we should add both instrumentation and unit test cases. However, the UI test cases are already exist. Those are the scenarios based. But you can add the compose UI test cases as well. So that we can verify the UI as well. |
|
@MohitMaliFtechiz Now interesting thing is this can't work on CI as emulators dont have these WIFI but if we test on real device rather it should work i came up with idea like we'll check about WIFI to know whether we are testing in emulator or real devices also will be placing a fix to run for all the devices API 27+ (current has upto 32 i suppose) I'll need time for such things as for an robust migration. Thanks. |
|
@atharvyadav22 Previously, we had the fragments, and we could not test the functionality directly within a fragment for real scenarios. But now we have migrated to compose with view models. So now we can test layer by layer to ensure all the functionality works correctly.
By doing this, we don't need to add additional testing and conditions based on emualtor or real device. |
Okay actually what i was working was if someone tests on real devices they will see that navigation, clicks eg- Server is started, books selection toggle. I also agree with your point so should i continue with that work or only fix that CI errors? |
|
We should add the testing as I described in layers. That will already ensure that everthing works correctly. Devs can easily run the test on the required API level. However, if there are some changes made in this screen, then devs first test manually. So we should not add conditions here. |
a2236ea to
8bae148
Compare
8bae148 to
ece4352
Compare
|
Sorry forgot to Fixed Ci for Instrumentation Test and Renamed as per Layer 3 (Integration Test) Also Apologies for bad commit the reason is there was merge conflict so had to reset head . |
|
@atharvyadav22 Thanks for the update. There are still some conflicts in this PR. Also, in this commit 1c778bf there are still some unnecessary messages in the commit; remove that.
|
…es the DI-provided dispatcher. * Addressed all review comments. * Improved the logic for loading selected books. * Refactored the ViewModel to use MutableSharedFlow instead of Channel. * Moved all UI-related computation logic into the ViewModel. The UI now only observes state and renders it. * Improved the ViewModel and UI logic for better robustness and readability.
* Improve the showing of hosted books for custom apps. * Updated `BooksOnDiskListItem` to remove the isSelected from the parent class. Because it does not require for other classes like `LanguageItem`. Due to this, mutable property compose was treating this same object, and does not reflect the changes in UI when we are selecting a bookItem. So we have moved this into `BookOnDisk` where it is needed and refactor the codebase according to this change. * Refactored the test cases according to BookOnDisk item.
…ionGranted` to `KiwixPermissionChecker`. Since some logic depends on app variants and test cases, it is now encapsulated within this checker. This allows us to use these methods across the codebase without adding extra conditions.
-Fixed Ci for Instrumentation Test and Renamed as per Layer 3 (Integration Test) -Added Test for layer 2 (UI Test) -Address review changes
a95141d to
3b41631
Compare
|
@MohitMaliFtechiz |

Fixes: #4615