mrvladus / Errands

Todo application for those who prefer simplicity.
MIT License
268 stars 65 forks source link

All tasks page with filters #283

Open sim6 opened 1 month ago

sim6 commented 1 month ago

Fixes #282 because also can sort by priority.

mrvladus commented 1 month ago

That's a good starting point, but it needs adjustmens. I don't think we need 'Pending' page specifically, I think we need 'All Tasks' page, with ability to set filters and sorting. And ideally, we need to be able to set filters and sorting for Task Lists too, but that can wait. I wanted to use for this GioListStore models and bind it to GtkListBox, so I can easily filter and sort it. But when I tested it, it has bug when it was sorted or filtered or added/deleted task it was autoscrolling to the top of the list. Maybe it wasn't a bug but I don't know how to fix it.

With current code I found couple of bugs:

sim6 commented 1 month ago

What do you think about 237826b27141eb995e160bfaf738b353295b2e38 to avoid render delays.

mrvladus commented 1 month ago

It's a good idea! Especially for first launch speed improvement and reduced memory usage on startup. We can add this to Task Lists too. It can be improved by loading new batch of tasks when user scrolls to, maybe, 10th task from the bottom (not just the bottom like it's now) so that loading can be more smooth.

The problem with lag appears again, when Pending page loaded more tasks.

mrvladus commented 1 month ago

We can add this to Task Lists too.

Nevermind. I've tested it, it's even more laggy. Let's scrap this idea.

sim6 commented 1 month ago

I rebased it onto main.

sim6 commented 1 month ago

With https://github.com/mrvladus/Errands/compare/922e69a6fdbde94049395a6f0960e64243c13859..7fbd70827d584e744c5801ba205d233d7d8684c9, it renders more content when the scroll reaches the last page instead of the bottom.

sim6 commented 1 month ago

I rewrote the code to dynamically render the content using Gtk.ListView

sim6 commented 1 month ago

About the performance, please see #301.

mrvladus commented 1 month ago

I think I found fix for scrolling problem I described earlier. So I can use models for task lists which will allow for filtering and sorting. I wanna experiment with creating only one Task List Page with all tasks and use sidebar rows as filter switches that will show only tasks for that list. Then I think we can make only one page like Filter Page and use Today, Pending, All rows as filter swithes for that page, reducing the number of widgets.

sim6 commented 1 month ago

With Gtk.ListView I cannot reproduce the scrolling problem you described earlier.

With the current code of this pull request a Gtk.FilterListModel could be interceded between Gio.ListStore and Gtk.SortListModel to filter the list.

sim6 commented 1 month ago

I added a filter by text or notes via 0c31b58fb93c933b45ce869a2d4e6225ccaa6071

sim6 commented 1 month ago

Oh! Thanks to improve the search box!

sim6 commented 1 month ago

I reworked it to have one page with all tasks with filters and sorters. More filters and sorters can be added in a near future with complex widgets or search operators.

mrvladus commented 1 month ago

Nice! But I wanted to have separate Today Page where all tasks for today and all overdue tasks will be, 'cause it's most used page for planned tasks. And separate All Tasks Page for all tasks. Ideally, to include search, sort and filters in both of them. Like order by due date, start date, creation date. And put all of the filters toggles inside of the popover menu button in header bar. Today Page sidebar row can act like a filter toggle for all tasks page, so we don't need separate pages, when we click on it - it changes title to "Today" and filters only today and overdue tasks. And when we click on "All Tasks" row it clears today filter and changes title to "All Tasks". Something like that...