Skip to content
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

Load only non-completed tasks by default #295

Merged
merged 6 commits into from
Sep 24, 2021

Conversation

marbetschar
Copy link
Member

@marbetschar marbetschar commented Sep 14, 2021

Fixes a crash experienced by users with a lot of tasks per list (#294). The root cause there is, that we are loading all tasks per default - even the completed ones.

This PR mitigates the situation by only loading the non-completed tasks by default. If the user enables "Show Completed", then a new query is executed which also retrieves the completed tasks.

Please note, loading the completed tasks as well would still lead to the crash. But in Gtk3 there is no builtin way to mitigate this, because Gtk.ListBox simply renders whatever we throw at it - instead of only doing so for the visible area only. A more elegant fix would be to use Gtk4's ListView - but at the time of writing this is not possible, since we can't pack Tasks as Flatpak right now.

Therefore this strategy at least solves the immediate problem and we can refactor this later on.

@marbetschar marbetschar requested a review from a team September 14, 2021 05:59
Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense and works for me! Nice fix

@danirabbit danirabbit enabled auto-merge (squash) September 24, 2021 19:25
@danirabbit danirabbit merged commit fc59c45 into master Sep 24, 2021
@danirabbit danirabbit deleted the load-non-completed-only-by-default branch September 24, 2021 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants