-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
Disable restoring hidden quests when there are none to unhide. #5359
Conversation
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.
Nice! But, hmm, ... why? Why is it useful to know beforehand how many quests have been hidden?
app/src/main/java/de/westnordost/streetcomplete/data/Database.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsFragment.kt
Outdated
Show resolved
Hide resolved
Maybe the focus of this PR should be: "Disable the option to unhide hidden quests when there are none". And the information about the currently hidden quests is just a nice-to-have. So it is not useful per se but in combination with the disabling of the resetting it is nice to see why it is disabled (=no hidden quests). |
Right, okay |
I always thought it seemed a bit odd that it told you after you'd unhidden them how many would be unhidden, but not before you made the choice. It seems a nice to have, is it just doing the ten from earlier today or 200 from a few weeks/month? |
Conflicts in |
Your PR should not include additions to translated files. The strings will be translated later. |
Okay, conflicts and changes for that file have been removed. |
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.
Looks good, except for one thing, which is a trifle on its own, but I want to avoid that this kind of thing creeps into the codebase:
private val osmQuestsHiddenDao: OsmQuestsHiddenDao by inject() | ||
private val noteQuestsHiddenDao: NoteQuestsHiddenDao by inject() |
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.
It is uncommon (if not: not done at all) in this codebase to directly access the Daos from view code. Fragments and Activities instead access *Controllers or *Source classes to update or get data. The update of the view subsequently should be reactive to changes in the data, i.e. the quest summary should not update after having tapped the button, but instead the tapping of the button changes the data and because the data is changed, the label is updated.
I wanted to write the details but that got so involved that I rather do it myself unless you know now exactly what to do. I'll do that then otherwise shortly before the next update.
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.
I'd be happy if you could work on this as I don't think I'm expert enough to do it myself. Thank you!
…ces where it's just about the hidden quests
Alright, did this now, I also updated that one overview of classes and how they are connected, this is why the change seems to be so big counted in lines of code. In a nutshell, what I did was:
|
Feel free to look at my changes, you can see them here: 0ab82c5 |
The option to unhide hidden quests should be disabled when there are none to unhide.