Skip to content

Do the filtering before building task trees for the UI #1208

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

Merged
merged 3 commits into from
May 13, 2025

Conversation

gycsaba96
Copy link
Contributor

Fixes #1207

The main idea is that the TaskStore provides pre-filtered Gtk.TreeListModel instances using the newly introduced FilteredTaskTreeManager class. This class performs the filtering before building the tree, thus producing correctly indented tree models. The FilteredTaskTreeManager also helps track when the expander should appear in the UI.

Sidenotes:

  • When filtering based on a tag, the parents of matching tasks are also displayed. This behavior was already present before the changes (likely a bug in the filter).
  • I believe it is possible to further simplify the TaskStore by relying on signals instead of direct calls to update the trees. But one step at a time. :)

gycsaba96 added 3 commits May 8, 2025 17:46
Introduce a FilteredTaskTreeManager class that prefilters the tasks
before building a tree.

Partially fixes GitHub issue getting-things-gnome#1207
- fixing uses of TaskStore.tree_model in the main code
- re-introducing TaskStore.tree_model since a plugin directly
  references it
- avoid duplicated creation of ListStore instances
- other small fixes
@gycsaba96
Copy link
Contributor Author

I rebased the branch to trigger the updated GHA workflow.

@diegogangl
Copy link
Contributor

LGTM! And yes, signals would be more in line with GTK and probably more error-proof.
Thanks, merging this one

@diegogangl diegogangl merged commit 3cc5b51 into getting-things-gnome:master May 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filtering of tasks doesn't play well with the tree structure
2 participants