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
Dictionary: fix Fuzzy search setting appearance #10721
Conversation
Feels a little odd.
Feels better.
I don't understand that. Isn't self:toggleFuzzyDefault() called on tap showing that explanation? |
Do you mean to keep the checkbox and show the dialog? |
|
Yes. At least, the checkbox is a visual indicator of the current state.
Ok, but still, it would feel more natural. Btw, does "by default" means "on new books" (that is, is the value at opening time stored in that book docsettings, and changing the default won't have any effect on that book)?
OK in a confirmbox, but may be none in the menu items? |
So maybe a usual "star" indicator is better. |
Why not - but my other questions aimed at knowing if this setting in FileBrowser (even if I guess, people rarely go there when not in a book, either for tweaking that setting for FB lookups, for for setting it as default for future books) applies to lookups done in FileBrowser - in which case, the checkbox ("applies to now") feels as worthwhile as a star ("set as default, but could be unchecked for the current situation"). |
Looks like a bug: global |
Updates: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting is saved to doc_settings if the checkbox was toggled by a user only
I understand that after reading the code as : it is saved in doc_setting ONLY once the user has toggled it once. As long as the user has not toggled it, it will use the default setting, even if that default is changed later.
Which is alright by me.
(A bit convoluted all this, but I've been there in the past with our various book/global/tap/long-press boolean states.... Not obvious to make it all clear in the UI.)
checked_func = function() | ||
return self.disable_fuzzy_search ~= true | ||
return not (self.ui.doc_settings and self.disable_fuzzy_search or self.disable_fuzzy_search_fm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't that leak ? if self.disable_fuzzy_search
is false
, you would use self.disable_fuzzy_search_fm
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry
@@ -416,10 +428,11 @@ function ReaderDictionary:onLookupWord(word, is_sane, boxes, highlight, link, tw | |||
logger.dbg("dict stripped word:", word) | |||
|
|||
self.highlight = highlight | |||
local disable_fuzzy_search = self.ui.doc_settings and self.disable_fuzzy_search or self.disable_fuzzy_search_fm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here?
That is, if we toggled it to true then false (fuzzy search enabled), we would use the global setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK for me codewise.
Fine UI-wise, but other people thoughs welcome.
Side question about the "star" indicator. koreader/frontend/ui/widget/menu.lua Line 1407 in d350418
Kind of text_star_func along with text_func ?
|
Why not, in principle. |
Other people's thoughts are always screenshots please. ;-P |
Other lazy people thoughts... :) |
The changes to the current design are just "star" indicator when fuzzy search in enabled globally by default. The checkbox "Enable fuzzy search" in file browser now works differently (previously it didn'w work at all). Per document setting is saved if a user checked/unchecked it himself only (previously the global setting was saved to doc_settings). |
Yes, that sounds fine to me. |
"Enable fuzzy search" checkbox is applicable to the current document only.
Do not show the checkbox when Dictionary Settings are called from the file browser.
Another way is to keep the checkbox and just change the item text, but in that case we'll lose the explanation dialog (it will remain on long-pressing only).
This change is