[ReaderDictionary] offer search with presets when dict fails to find match#14399
Conversation
| preset_names = Presets.getPresets(self.preset_obj) | ||
| end | ||
| local current_dict_state = self:buildPreset() | ||
| local button_dialog, dialog_buttons = nil, {} -- CI won't like it if we call it buttons :( so dialog_buttons |
There was a problem hiding this comment.
This isn't true here btw. (And it's a complaint we humans would also have lodged. ;-)
There was a problem hiding this comment.
touché, although you should voice your concerns more often then, since historically (in koreader's terms, not like in the iron age) they are always named buttons ;)
There was a problem hiding this comment.
The CI is there so I don't have to, but it only detects things machinally, not outdated comments that should be removed. ;-)
There was a problem hiding this comment.
can you re run the CI, why id it fail?
|
if only @poire-z would look at this PR the way he looks at all the other ones...
|
|
I just can't put myself in your mind full of presets and non-fuzzy searches to appreciate the workflow. |
|
pretty simple really, if you use fuzzy and have presets, then you get the screenshot on the right hand side, if like me, you have fuzzy off, then the screenshot on the left hand side is it. if you have fuzzy and no presets, then you get the usual quickdict widget saying "no results" and fuzzy off and no presets is just the fuzzy offer from the previous pr. |

what's new
This pull request refactors and enhances the previous work done in #14343, improving user experience when no results are found. The main changes include the introduction of a unified dialog for alternative search actions, avoidance of code duplication, and better handling of search presets and fuzzy search options.
showNoResultsDialogmethod to present users with alternative search actions (fuzzy search or preset search) when a dictionary lookup yields no results, streamlining the interaction and reducing duplicated dialog code.showSearchWithPresetDialogmethod, improving code maintainability and clarity.screenshots
This change is