←  Go Back

Date grouped list items

Here's what we've been up to: we thought it'd be a good idea to sort tasks by date. So, we've set up categories like Future, Next Month, Next Week, Tomorrow, Today, Yesterday, Last Week, Last Month, and Past. This way, it's easier for users to handle their tasks and it doesn't get too detailed. To keep things clear, each group has a sticky header that hangs out at the top of the list as you scroll, until the next group comes along.

Now, pairing up these date groupings with sticky headers wasn't exactly a walk in the park, given that we're using a virtual list. But we decided to make peace with some inefficiencies when a date group has a whole bunch of items, rather than overhauling the virtual list control.

One key move was placing the sticky headers inside a specific element. This reduced the workload for the browser and eliminated any lag, especially on mobile devices. With the header inside a relative container, it moves smoothly up to its sticky position, then scrolls up and off the screen with its related items, and we don't even have to mess with scroll events.

We've also added a placeholder for the 'Today' group. It's always there, even if there are no tasks. We thought it would be good to let users know when they don't have any tasks for today, but without messing with the overall look of the groups.

And just a heads up: we're about to add an 'Add task' button on the headings. Click it, and you can add a task with the date preset to the closest date in that range. Also, if you click on a heading, it and its tasks jump to the top of the list, no matter where they were before.

© copyright 2024 Tizli