Repository navigation
fix(habits): bad habit marked X today is not a habit still to do in Today - #342
Merged
Merged
Conversation
…n Today and widget The excludeCompletedForDate and excludeCompleted filters kept a bad habit with a notDone record today in the to-do list (the EXISTS notDone branch), so both the Today page and the home widget asked for a habit already settled for the day. Drop that branch from both filter variants and revert the now-redundant widget-side guard from #341. Undo stays available on the habit details page and via toggling from the habits list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A bad habit marked X (notDone) for today no longer appears as a habit still to complete — in the Today page filter and the home-screen widget.
Why
GetListHabitsQuery's completion filters (excludeCompletedForDate,excludeCompleted) kept bad habits with a notDone record today via anEXISTS ... status = notDonebranch. That branch made an already-settled (failed) bad habit show up as "to do" in Today and, through the same query, in the widget. #341 patched only the widget side; the root was the query, so this moves the fix to the source and reverts the widget guard.A bad habit still counts as failed for the day (streaks/statistics unchanged); undo stays available on the habit details page and by toggling from the habits list.
Changes
get_list_habits_query.dart: drop theEXISTS notDonebranch from both filter variants; a bad habit is now hidden once it exists on an applicable date, X'd or not.widget_data_aggregator.dart: revert the fix(widget): bad habit marked X today is not a habit still to complete #341 guard (dead code now that the query filters it out).habit_queries_integration_test.dart,habit_type_end_to_end_test.dart(was locking the old behavior),widget_data_aggregator_test.dart(guard tests removed with the guard).Verification
flutter analyzeclean on all touched files.habit_queries_integration_test.dart,habit_type_end_to_end_test.dart,widget_data_aggregator_test.dart, alltest/core/application/features/habits+widget,test/presentation/ui/features/habits+calendar,habits_list_scroll_test.dart.Follow-up idea (open note): render X'd bad habits in the widget with a distinct "failed" style instead of hiding them.