Giter VIP home page Giter VIP logo

Comments (7)

koppor avatar koppor commented on May 19, 2024

Implementation idea: Store line number somehow

Each task gets a sortNumber assigned. It is stored as float. At reordering, the new sort number is the mean value of the task before and after. When sorting entries at filtering, they are sorted with this criterion last applied.

When saving the file, the items are sorted according to the sort number.

from sleek.

ransome1 avatar ransome1 commented on May 19, 2024

Hi @koppor.

Drag and drop support would be great, I'm with you here. From the start on I was thinking about it, but I was never sure if this would compatible with the todo.txt rule set. Though your suggestion could work, if this feature would be available within each priority group.

However, your suggestion includes persisting a sorting index. Implementing it brings quite some complexity to the programming, as a storage would be needed. And so far sleek is simple, it doesn't even need a database. It just reads and parses the todo.txt file on changes, does the sorting by a static set of rules and rebuilds the table quite often.

I want to be honest with you, right now I have quite some technical depths, that I neglected over the last weeks for the sake of new features. And I need to take care of it first, having just a couple of hours in my evenings ;) At this point I'm excited about this suggestion and the more I think about it, the more I like it. But I can only put it on the roadmap. Maybe this could be the feature that bumbs sleek up to 1.0. :)

from sleek.

koppor avatar koppor commented on May 19, 2024

@ransome1 Thank you for the long answer. While diving into the code, I wondered how you can achive so much functionality with plain JavaScript and HTML 👍. I wonder whether the choice not to use any framework was by accident or intended? If I would start a new HTML app, I would use vue.js. I evaluated vue.js a few years back, when knockout.js and backbone.js were still an alternative. One can easily get lost at the various framework showcases at http://todomvc.com/. Back then, I opted for Angular 2, because my colleagues were using it, too. Now, I would decide differently. My gut feeling would say that vue.js is very simple to use and the data model for TODOs and rendering could be easily doable with it.

from sleek.

samuelznewton avatar samuelznewton commented on May 19, 2024

I like this idea, but I agree with ransome1 that the implementation described is probably too complex for the philosophy behind sleek.

Here's a simple approach to consider: a reorder menu. The reorder menu would pull up an unsorted version of the task list, and tasks could be dragged and dropped. This would simply change the order of items in the todo.txt file, and sleek's sorting rules would continue to apply. This would immediately add the ability to reorder any tasks with the same due date and priority.

But I think this can be made even better with a new setting in sleek: sorting rules. There are a lot of ways this could be implemented. The simplest would be to have 2 switches: sort by priority, and sort by date. With both checked, the program would behave like it does now, sorting first by priority and then by due date. (at least, I believe that's the intent; see my other issue noting that this doesn't seem to be the case right now). Of course, you could uncheck priority sort to only sort by due date, or vice versa. You could also uncheck both, and the list would appear in exactly the order in the todo.txt file. In this case, the user would have full control over the order of the list with the reorder menu.

A more complex way to add sort rules would involve a set of dropdowns, allowing users to choose how to sort and in what order. Dropdowns could have options like priority and due date, as well as any other keys the user may want to sort by (alphanumerically).

from sleek.

koppor avatar koppor commented on May 19, 2024

Here's a simple approach to consider: a reorder menu. The reorder menu would pull up an unsorted version of the task list, and tasks could be dragged and dropped. This would simply change the order of items in the todo.txt file,

If I am not mistaken, I was proposing that in #18 (comment) and ransome1 said, it would cause too much effort to implement.

I am looking forward to your implementation approach.

I personally like drag and dropping without the requirement to take care about changing priorities (maybe even of multiple tasks). Note that https://www.any.do/ does the drag'n'drop very well. Even if the tasks are sorted by due date. This is not possible at other tools such as https://todoist.com/app/ or Microsoft TODO (IMHO).

from sleek.

samuelznewton avatar samuelznewton commented on May 19, 2024

@koppor The way I understood your suggested implementation, sleek is required to save some information about each task (or perhaps you meant a new key:value pair in the todo.txt file?)

The intent of my suggestion is that sleek does not need to remember or reprocess anything. The only thing that changes when using the reorder menu is that the lines of the todo.txt file are switched around. So for instance, if the todo.txt file said:

  • Task 1 due:2021-02-02
  • (A) Task 2 due:2021-02-02
  • (A) Task 3 due:2021-02-03
  • Task 4 due:2021-02-02

sleek would, by default, show them in the order 2, 3, 1, 4. But, in my proposed reorder menu, they would display in the order written to the todo.txt file: 1, 2, 3, 4. Dragging and dropping them would reorder them in the todo.txt file immediately, without needing to write any new information.

So if I swapped the positions of tasks 1 and 4, the file would be written in the order 4, 2, 3, 1. sleek would still follow its own rules of sorting and display 2, 3, 4, 1.

As far as any.do goes, I see what you mean; however, I wonder if that is too much automation for the simple, controlled vision of sleek.

from sleek.

ransome1 avatar ransome1 commented on May 19, 2024

Added as a spike it to sleeks backlog.

from sleek.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.