←  Go Back

Svelte Derived Stores

2023-07-17

Harnessing the capabilities of Svelte derived stores has proved to be a powerful strategy for grouping and filtering tasks. We upload all tasks and utilize a derived store to assemble them into groups, incorporate placeholders, and arrange them accordingly. A separate derived store is employed to filter the items according to the search terms, all before the grouping process takes place. This streamlined operation happens within the store itself, and the UI effortlessly adapts to these changes. For optimized performance and rapid loading, all task items are saved in local storage.

Some filtering still takes place within the database, but we're considering phasing it out. Naturally, security and permission filtering will remain at the database level. Presently, we retrieve all items for a user based on permissions and status. The search function is client-side, operating via a derived store. We are contemplating moving status filtering to the client-side as well. The remaining database-level filtering that seems viable might be a date range covering the last and next 12 months. To access items from more than 12 months ago, an archive view could be introduced. The exact future range is undecided, as the number of future-scheduled items is uncertain. Therefore, the approach might focus on limiting the past items delivered to the client for standard planning.

Even a 12-month limit on past items could present performance challenges if the volume of items is substantial. An alternative could be reducing this timeframe to 6 or even 3 months. This concern mainly applies to completed or canceled items that can accumulate over time. In addition, repeating items need to be manufactured in our derived store, and if these are daily repeats, a shorter 3-month span might be more manageable.

A temporary solution might involve adding month-based groupings. This would mean that after the 'last month', users would see groupings named by months going back as far as needed.

Ultimately, derived stores have proven to be a valuable asset. We aim to extend their use across a broader range of filtering and sorting applications, such as status filtering, intra-group priority setting, implementing ranking strategies (which will eventually replace date ranges), and adding more search term sources.

© copyright 2024 Tizli