-
-
Notifications
You must be signed in to change notification settings - Fork 497
Introduced similarly spelled suggestions results. #4445
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
base: main
Are you sure you want to change the base?
Conversation
9796248 to
75c2350
Compare
|
@MohitMaliFtechiz Are we reqdy to merge here? Please carrefuly issue/PR on Apple to ensure you are at the level kiwix/kiwix-apple#1326. We shoukd be ready ASAP to merge and publish release for dwds. Please update with screencast PR description |
No yet, depeneds on kiwix/java-libkiwix#130.
Sure, i am on it. |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (37.11%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #4445 +/- ##
============================================
- Coverage 58.49% 58.32% -0.18%
- Complexity 1464 1477 +13
============================================
Files 327 327
Lines 17057 17204 +147
Branches 2115 2147 +32
============================================
+ Hits 9978 10034 +56
- Misses 5676 5754 +78
- Partials 1403 1416 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…by libkiwix. * Refactored the code to use the libkiwix's `SpellingsDB`.
…ts initialization is time-consuming. Creating it together with the reader was increasing the load time and affecting the user experience. Since this object is only needed during search, we can safely initialize it in the background while allowing the user to read the ZIM file.
|
Currently, CI failing due to we do not have the new bindings of java-libkiwix. See kiwix/java-libkiwix#128, and kiwix/java-libkiwix#130. > Task :core:compileDebugKotlin FAILED
e: file:///home/runner/work/kiwix-android/kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/reader/ZimFileReader.kt:42:27 Unresolved reference 'SpellingsDB'.
e: file:///home/runner/work/kiwix-android/kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/reader/ZimFileReader.kt:115:28 Unresolved reference 'SpellingsDB'.
e: file:///home/runner/work/kiwix-android/kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/reader/ZimFileReader.kt:198:21 Unresolved reference 'SpellingsDB'.
e: file:///home/runner/work/kiwix-android/kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/reader/ZimFileReader.kt:217:5 Return type mismatch: expected 'kotlin.collections.List<kotlin.String>', actual 'kotlin.Any'.
e: file:///home/runner/work/kiwix-android/kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/reader/ZimFileReader.kt:218:20 Unresolved reference 'getSpellingCorrections'.
e: file:///home/runner/work/kiwix-android/kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/reader/ZimFileReader.kt:225:20 Not enough information to infer type argument for 'T'.
e: file:///home/runner/work/kiwix-android/kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/reader/ZimFileReader.kt:440:18 Unresolved reference 'dispose'. |
… based on configuration. * The database is initialized on the first launch and reused throughout the app’s lifecycle. * Improved the comparison logic in `ZimReaderSource`.
* Assets are now loaded inside the `AssetLoadingCachedDir` subdirectory within the `cache` directory, instead of directly in the `cache` root. This ensures that when the asset cache is cleared, the `SpellingsDB` remains preserved in storage.
|
The code refactoring has been completed for this PR. The last change is left in this PR is using the new |
|
@MohitMaliFtechiz We have a bit evolved on the topic how to display spellchecker suggestions since the beginning. Can you please do it in a way you can display many suggestions? This means displaying the spell suggestionS exactly like the normal suggestion, the only difference, is that just on the top you write "Do you mean:". Please also show us how looks the first start of the app (the one where the index is created). Is that fully transparent? |
Please do the PR to make the release of java-libkiwix asap. |
* Refactored the UI to show spelling correction suggestions in the same way as search suggestion items, consistent with the iOS app.
@kelson42 I have made the changes see the below-video. DWDS_Spelling_correction.mp4
It works like in the above video. Also, i have updated the PR description for this.
Released the |
|
@MohitMaliFtechiz Why the video starts at 30s? What happens if someone start to search an index is still no here? Other small detail, the "Do you mean:" is well positioned but can almost be confused with a result. We have no way to improve the situation? Maybe we could have a background behind each resukt item slightly more visible (darker)? Or change somehow a bit the font of the string "Do you mean:"? |
@kelson42 The application is building at this time, i was running the application via Android studio so it took time in building and running the application.
If user start for search, and the DB is not still fully created. Then it will not show any result instead it will work like normal search:
But after the DB is fully created it starts showing the "Spelled correction suggestions".
Here are both UI.
To separate the suggestion items, I think the font-based version works better. Changing the background would make it look inconsistent with the normal search suggestions. @kelson42 What do you think? |
* Fixed a native crash that occurred when the `SpellingsDB` creation was incomplete and the user closed the application. In such cases, a temporary folder (.tmp) remained, causing a `DatabaseCreateError` during the next initialization. * Improved the font of "Do you mean:" text so that it could be show different from our suggestion items.
|
@kelson42 I have made the changes in font size of "Do you mean:" as shown in the above screenshot. If do you want any change in it do let me know. |
|
@MohitMaliFtechiz Thx for the explanations and fint changes. All good IMO. Can you please change the item bacground as well... everywhere (rmember: suggestion AND spelled suggestions shoukd display the same!)? |
@kelson42 Sure. Doing the changes. |
|
I have made the changes the UI look like this(in day and night theme): SpellingAndSearchSuggestionsWithBackground.mp4 |
|
@MohitMaliFtechiz Better, but you should have the same kind of spacing/margin left, right, too, bottom between the result item!..l and they should not be too big, currently the ratio font size, item size, space between two item is really not beautiful. I will provide you a mockup |
|
@kelson42 What do you think about this UI?
NewSearchUI.mp4 |
|
This is a lot better, here few suggestions:
|
@kelson42 We can only reduce the height of the item a little bit like shown in the below images: We could not reduce the more height otherwise it will give the "Touch target" issue for the "Open in new tab" icon.
I have reduced it by 2 pixel.
|









Fixes #41
SpellingsDB.show_search_suggestions_spellcheckedkey in theinfo.jsonfile. kiwix-android-custom#252.SpellingsDBis initilized inside the application's cache dir.AssetLoadingCachedDirsubdirectory within thecachedirectory, instead of directly in thecacheroot. This ensures that when the asset cache is cleared, theSpellingsDBremains preserved in storage.2.4.0to use the new bindings.Important
At the first start, it will not show anything untill the DB is fully created, it takes time in creating the DB at first launch. However, it starts showing the spelled correction suggestions after the DB is initilazed(In the meanwhile user can use the application normally). After the first launch(when DB created) then it immedadtly shows the spelling correction suggestions. See in below video.
DWDS_Spelling_correction.mp4