Skip to content
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

[Questions] Plans and design #2

Closed
ngortheone opened this issue Sep 12, 2019 · 35 comments
Closed

[Questions] Plans and design #2

ngortheone opened this issue Sep 12, 2019 · 35 comments
Labels
question Further information is requested

Comments

@ngortheone
Copy link

Hey @ad-si

I am excited to see this project. I was thinking myself of re-implementing taskwarrior in a more safe language (Rust was on my mind) so this project makes me very curious. I am particularly interested in some architectural/design decisions.

  • What is your plan for sync between different devices? Is it planned? How do you plan to perform merging and conflict-resolution? Is it going to be client-server or p2p?

  • What is your plan about mobile devices? An app like this would benefit greatly from being present not only on desktop/web but on android (and maybe even iOS :) This is my main dissatisfaction with taskwarrior - absence of a supported mobile client. (And also a story around provisoning certs for mobile - PITA).

My knowledge of Haskell is near-zero (sadly), how is it suitable for mobile development? If it is not very well suited I'd imagine that you will need to write a separate client in different language and probably port the data structures (things like protobuf come to mind)...

@ad-si
Copy link
Owner

ad-si commented Sep 24, 2019

Hi @ngortheone, glad to hear 😁.

Rust was on my mind

Rust as a gateway drug to Haskell 😉

What is your plan for sync between different devices? Is it planned? How do you plan to perform merging and conflict-resolution? Is it going to be client-server or p2p?

At the moment I simply have the SQLite database in Dropbox, and so far it worked astonishingly well. 😅Mid term I plan to include a file mode (where each task is stored in a file) and git sync (git pull before and git push after changes). Or host it as a webapp (PureScript is a really good solution for it nowadays), which makes syncing unnecessary (but of course reduces it to online only). Long term I hope to be able to use something like https://github.com/canonical/dqlite.

What is your plan about mobile devices? An app like this would benefit greatly from being present not only on desktop/web but on android (and maybe even iOS :) This is my main dissatisfaction with taskwarrior - absence of a supported mobile client. (And also a story around provisoning certs for mobile - PITA).

For mobile my short term plan is to use a Telegram bot, an iOS shortcuts app (https://support.apple.com/guide/shortcuts), or a webapp. I'm still trying out what works best. Mid term a Flutter app might maybe be a good solution. Long term some companies are nowadays even writing mobile apps with Haskell (http://keera.co.uk/blog/2017/06/01/haskell-android-ios/), so this would of course be awesome 😁.

My knowledge of Haskell is near-zero

Learning Haskell was one of my most satisfying developer experiences. You should give it a try. 😉. Let me know if you need any help!

@ad-si ad-si added the question Further information is requested label Sep 25, 2019
@dbogdanov
Copy link

What about support for complex priorities (combination of priorities for the task and tags) or urgency similar to TaskWarrior?

@dbogdanov
Copy link

Also, is there plans for support for notes?

@ad-si
Copy link
Owner

ad-si commented Oct 6, 2019

What about support for complex priorities (combination of priorities for the task and tags) or urgency similar to TaskWarrior?

Is already implemented to a large part: https://tasklite.org/concepts.html#priority 😁

Also, is there plans for support for notes?

Already supported! => https://tasklite.org/concepts.html#notes 😁

@dbogdanov
Copy link

Great! I am considering a use-case, where I can specify priority boost value for different tags. And then have a possibility to define a custom final task priority formula via configuration.

By notes I am referring to functionality similar to taskopen, being able to edit the attached notes in any text editor, etc.

@ad-si
Copy link
Owner

ad-si commented Oct 6, 2019

Where I can specify priority boost value for different tags. And then have a possibility to define a custom final task priority formula via configuration.

Well, that's not easily available yet. However, the code for priority calculation is embedded in the SQLite database as SQL. Therefore you can change it via the sqlite CLI or a GUI like https://sqlitebrowser.org. I'd recommend that you try out my priority algorithm, maybe it's good enough, and if you find any really bad values, I'd be happy to improve it with you. If certain tags are much more important, how about you filter for them to have a focused view on your crucial tasks?

By notes I am referring to functionality similar to taskopen, being able to edit the attached notes in any text editor, etc.

@LeonB
Copy link

LeonB commented Oct 21, 2019

Are you planning on adding some kind of time tracking?

@ad-si
Copy link
Owner

ad-si commented Oct 21, 2019

@LeonB It already includes rudimentary time tracking support:

start                    Add a note that work on task was started
stop                     Add a note that work on task was stopped

But there isn't any integrated way to analyze the data yet 😅

@LeonB
Copy link

LeonB commented Oct 21, 2019

@ad-si aweseome! I'm looking for some kind of timesheet reporting for my boss. To show how much time was spent on certain tasks.

@ad-si
Copy link
Owner

ad-si commented Oct 21, 2019

Well it definitely works already:

$ tl start mn1
🗒  Added a note to task "buy milk" with id "01dqqc19m7kyv8z4fd6g116mn1"
$ tl stop mn1
🗒  Added a note to task "buy milk" with id "01dqqc19m7kyv8z4fd6g116mn1"
$ tl info mn1
awake_utc: null
review_utc: null
state: null
repetition_duration: null
recurrence_duration: null
body: buy milk
user: adrian
ulid: 01dqqc19m7kyv8z4fd6g116mn1
modified_utc: 2019-10-21 14:38:11
group_ulid: null
closed_utc: null
priority_adjustment: null
metadata: null
waiting_utc: null
ready_utc: null
due_utc: null
priority: 1.0
tags:

notes:
  - note: start
    ulid: 01dqqc1gd88fef71cwttbrv3bz

  - note: stop
    ulid: 01dqqc22bgktwy6c5ek07pd2s4

So feel free to use it 😁. For better reporting you can either submit a PR with an implementation (😉), convince me that it's really high prio and I should implement it ASAP (😛), hack together a small SQL query to analyze it (run with tl runsql), or hack together some bash script or similar to analyze the CSV or JSON output of TaskLite. (There is also the tl ulid2utc command to convert ULIDs to their timestamp)

@robwhitaker
Copy link

Are there any plans to add hooks? I use them pretty extensively to extend Taskwarrior's functionality and sync with other services.

@ad-si
Copy link
Owner

ad-si commented Jan 12, 2020

@robwhitaker Definitely! I might implement details a little different than Taskwarrior (e.g. post- and pre- prefixes instead on on-), but overall it should be pretty similar.

What kind of scripts do you currently use? Would be cool to have a list of good ones to keep in mind while implementing it!

@robwhitaker
Copy link

@ad-si I actually have all my hooks in my dotfiles repo if you want to check them out, but in short, I use hooks for the following:

  • Sync my ~/.task folder with git on launch (pull from remote) and on exit (push to remote)
  • A couple hooks needed by my taskwarrior-habitica-bridge project to copy/sync tasks between Taskwarrior and Habitica
  • Refresh some custom displays whenever I run a task command
  • Show messages from a little message server I have running after each task command (used for messages indirectly generated by interacting with my tasks, e.g. as a result of a Habitica web hook)

@ad-si
Copy link
Owner

ad-si commented Jan 12, 2020

@ad-si I actually have all my hooks in my dotfiles repo if you want to check them out

Great! Definitely will have them as reference during implementation.

  • Sync my ~/.task folder with git on launch (pull from remote) and on exit (push to remote)

I actually want to provide first class support for this since it's such a common use case. But a implementation with hooks could probably be a good stepping stone (or maybe even the better solution, since it allows it to be more customizable by the user 🤔). Hooks has a higher priority so we can try it out then how it works...

  • A couple hooks needed by my taskwarrior-habitica-bridge project to copy/sync tasks between Taskwarrior and Habitica
  • Refresh some custom displays whenever I run a task command
  • Show messages from a little message server I have running after each task command (used for messages indirectly generated by interacting with my tasks, e.g. as a result of a Habitica web hook)

Nice stuff! I haven't gotten much into hooks with Taskwarrior, but definitely looks like I should when its implemented with TaskLite 😁

One thing I'm still contemplating is whether I should add support for hooks to be stored in the database in a scripting language which are then executed by Taskwarrior. They could e.g. be written in Lua (https://hackage.haskell.org/package/hslua) or Dhall (https://dhall-lang.org/). I always disliked the system for git hooks, in which they are not part of the project and everybody had to install them themselves.

@ad-si
Copy link
Owner

ad-si commented Jan 12, 2020

The more I think about it the better I like the idea of storing them in the database and using Dhall as hook language. It can even be extended with custom functions: https://docs.dhall-lang.org/howtos/How-to-add-a-new-built-in-function.html. This could lead to a collection of useful Dhall hook scripts that anyone can use, since they are executed by TaskLite and have no additional requirements for the system setup like installed interpreters and so on.

@robwhitaker
Copy link

@ad-si Dhall is very cool as a configuration language, but I can't say I like the idea of trying to use it for general purpose scripting. Maybe it's just inexperience talking, but from the bit I've used Dhall, it feels like things that would be very basic in a general purpose language become very hard to do in Dhall because it's not designed for that purpose. I think Lua would be the better option, if you want to go with only having hooks in one language.

Incidentally, I've been toying with the idea of using Nix as the basis for a Taskwarrior plugin manager. That approach would allow writing hooks and other Taskwarrior scripts in any language with whatever dependencies they require. As long as each plugin defines a default.nix for itself that describes how to build/run it, it doesn't matter what the end-user has installed on their system. As long as they have Nix, it could handle the interpreters/compilers/environment around the plugin automatically.

@ad-si
Copy link
Owner

ad-si commented Jan 13, 2020

it feels like things that would be very basic in a general purpose language become very hard to do in Dhall because it's not designed for that purpose

Dhall has become quite powerful by now, but yeah, there will definitely a few custom functions be needed to make it complete. But as far as I can tell there is no fundamental limit!

As long as they have Nix, it could handle the interpreters/compilers/environment around the plugin automatically.

Also there is always the option to distribute Docker images…

So yeah, going with an external hook system, is probably the better solution for the beginning. If we find a way to integrate Dhall or Lua natively later, also cool, but at least we don't unnecessarily postpone the feature right now…

Expect a first implementation soon! 😊…or if you've got some time I'd of course also be happy about a merge request 😉

@robwhitaker
Copy link

Dhall has become quite powerful by now, but yeah, there will definitely a few custom functions be needed to make it complete. But as far as I can tell there is no fundamental limit!

I don't know too much about extending Dhall. I'd like to look into that when I get some time. But even so, the other issue I see with (exclusively) using a language like Dhall is potentially alienating would-be hook developers (I suspect a lot of people would find Dhall intimidating) and accidentally decreasing the number of shared hook scripts instead of building up a nice collection.

Also there is always the option to distribute Docker images…

True! Docker is another option and certainly one more people would be familiar with. Maybe, with some cleverness, TaskLite could even use Docker under the hood to handle different hook script dependencies.

Expect a first implementation soon! 😊…or if you've got some time I'd of course also be happy about a merge request 😉

Looking forward to it! I'd actually love to contribute to TaskLite at some point, but I think you'll probably beat me to this feature 😆

@distefam
Copy link

distefam commented Feb 8, 2020

First off, this project looks great; thank you for putting it together. I'll throw in a few questions of my own (/feature requests, I suppose) that pertain to my workflow.

Do you have any plans to add something akin to Taskwarrior's user defined attributes?

I use a Pomodoro-style workflow in which I track the number of pomodoros it takes to finish a given task. With Taskwarrior I define a numeric UDA to capture this. I suppose I could use a number of tags: 1pomo, 2pomo, 3pomo, ... but that is quite inelegant and would quickly get out of hand for other relevant attributes: estimated pomodoro count, distraction count, etc.

Learning Haskell was one of my most satisfying developer experiences. You should give it a try. wink. Let me know if you need any help!

You've inspired me. I've always written CLI apps in Python but was considering something else for my next side-project. Is Learn You A Haskell for Great Good still the best learning resource?

@ad-si
Copy link
Owner

ad-si commented Feb 8, 2020

Thank you for the kind words @distefam 😊.

It is already supported in the form of a metadata field! I just added some documentation for it to the website: https://tasklite.org/usage/cli.html#metadata

The tooling around it is still a little lacking, but with a few bash aliases I think you can hack up a good solution in no time.

You've inspired me. I've always written CLI apps in Python but was considering something else for my next side-project. Is Learn You A Haskell for Great Good still the best learning resource?

That's great! 😁Haskell is a real pleasure to work with, you won't regret it. On how to best start: Lets say the opinions differ 😅. I really enjoyed "Learn You A Haskell for Great Good", but I already had some exposure to Haskell, because a friend of mine was pitching it to me constantly 😂. If you're completely new to purely functional programming (the purely is important), then I actually feel like the best way to get started is to learn Elm first (https://elm-lang.org/). It is basically a subset of Haskell without any of the archaic trip ups, with the best error messages of any programming language, an awesome online getting started guide (https://guide.elm-lang.org/), and a gread online IDE (https://ellie-app.com/), which means you can get started without having to install anything. Once you've learned this it's much easier to make the jump to Haskell. (And on the way you've learned - what is in my opinion - the best way to build webapps currently). Have fun! 😁(and feel free to come back to me if you need help with anything!)

@distefam
Copy link

distefam commented Feb 10, 2020 via email

@ad-si
Copy link
Owner

ad-si commented Feb 12, 2020

Sounds like a great idea @distefam . This is exactly the kind of extensions I was hoping to foster with the modular and extendable architecture of TaskLite 😁. I also want to allow first class subcommands like git does:

$ cat /usr/local/bin/git-grin
#! /usr/bin/env bash

echo '😁'

$ git grin
😁

Created an issue for it: #9

@distefam
Copy link

This is exactly the kind of extensions I was hoping to foster with the modular and extendable architecture of TaskLite

Do you have any way you'd prefer extensions to be architected? I only see the "Haskell API" bit on the docs page, which is a bit sparse. Quick and dirty would be to just build a CLI tool in Python (I'm already familiar with writing CLI tools with Python-click) that would access the existing database and write to a separate table but I don't think this is what you had in mind with "modular and extendable architecture of Tasklite". Happy to follow your lead, even (especially?) if it means an opportunity to learn a new language 😁.

@ad-si
Copy link
Owner

ad-si commented Feb 15, 2020

Do you have any way you'd prefer extensions to be architected? I only see the "Haskell API" bit on the docs page, which is a bit sparse. Quick and dirty would be to just build a CLI tool in Python (I'm already familiar with writing CLI tools with Python-click) that would access the existing database and write to a separate table but I don't think this is what you had in mind with "modular and extendable architecture of Tasklite".

Well, originally my idea was to implement all core features in SQLite and build the Haskell CLI only has a wrapper to make using it easier. However, I wasn't aware how limited SQLite is, so by now a few core algorithms are implemented in Haskell. Yet, I still consider the database schema etc. part of the public API of TaskLite. So building a CLI tool in Python accessing the existing database is actually a way of doing it I'd like to support.
Your script might then also be coupled via hooks: #10

Happy to follow your lead, even (especially?) if it means an opportunity to learn a new language 😁.

Implementing the hook system would be the most important next step for enabling extensions! Any PRs for this are very welcome 😁

@robwhitaker
Copy link

So building a CLI tool in Python accessing the existing database is actually a way of doing it I'd like to support.

@ad-si @distefam I think it makes sense for extensions to use the same database, but as far as creating new tables goes, there should probably be a standard naming scheme so different extensions don't accidentally become incompatible by using the same tables (e.g. two different extensions both try to create a "Comments" table).

@ad-si
Copy link
Owner

ad-si commented Feb 16, 2020

Good point. Changing or extending the schema should be governed by some rules. Most obvious being: existing fields must not be changed. New tables and fields must be namespaced with the name of the extension

@robwhitaker
Copy link

Having been playing with TaskLite a bit recently, I think it would be nice if notes could be read from stdin if no text is provided. It would allow for stuff like:

$ tasklite note a18 <<< cat << EOM
> This is line one of a longer, multiline note.
>
> And here's line 3!
> EOM

The same is possible currently but it's a lot less pretty and a lot easier to mess up:

$ tasklite note "$(cat << EOM
> This is line one of a longer, multiline note.
>
> And here's line 3!
> EOM
> )" a18

@xeruf
Copy link

xeruf commented Sep 4, 2020

So, I also went on a quest once I had tried and lost trust in taskwarrior: https://github.com/xerus2000/howtodo

But now that I finally started using tasklite I see problems similar to my issues with taskwarrior:

  • No first-class customization (instead predefined commands like watch and read that should really be defined in an internal alias system similar to First class subcommands #9 or even like aliases in a git config)
  • More verbose CLI: To add a recurring/repeating task, you need two commands
  • No typesafe, first-class support for custom attributes

@ad-si
Copy link
Owner

ad-si commented Sep 5, 2020

Thanks for your feedback @xerus2000! My thoughts on it:

@xeruf
Copy link

xeruf commented Sep 5, 2020

I already have far too many shell aliases. I think that quickly gets cluttered.

Also, native support enables tighter integration. I am still trying to flesh out the details, but here's the gist of what I'm thinking of: https://github.com/xerus2000/howtodo/blob/master/plans.md#commands

@robwhitaker
Copy link

@ad-si @xerus2000 Could always create a wrapper script to introduce aliases without polluting your shell aliases. That worked pretty well for me while I was still using Taskwarrior. It also allows commands to be complete scripts/programs instead of simple aliases, which is pretty handy.

Not sure what you mean by tighter integration, though. This may or may not help towards that goal.

@xeruf
Copy link

xeruf commented Sep 7, 2020

@robwhitaker you mean creating a tl function/binary that resolves aliases? Hm.
I think at that point it could be part of the program - because then this feature could also implement the existing aliases like watch and read out of the box while allowing to delete or customize them ;)

@robwhitaker
Copy link

@xerus2000 Yeah, basically. Could be a simple shell script, e.g.:

if [[ "$1" = "watch" ]]; then
    tl ... # run a more complex tasklite command
elif [[ "$1" = "read" ]]; then
    echo "Unknown command: read" # "delete" the read command
elif [[ "$1" = "fire_the_missiles" ]]; then
    missiles --fire # run a completely separate program
else
    tl "$@" # pass all other commands directly to tasklite
fi

What case does native support cover better than a simple wrapper script like the above?

@dbogdanov
Copy link

Well, that's not easily available yet. However, the code for priority calculation is embedded in the SQLite database as SQL. Therefore you can change it via the sqlite CLI or a GUI like https://sqlitebrowser.org. I'd recommend that you try out my priority algorithm, maybe it's good enough, and if you find any really bad values, I'd be happy to improve it with you. If certain tags are much more important, how about you filter for them to have a focused view on your crucial tasks?

Hi, @ad-si, I explain more the priority workflow I am considering here: xeruf/nodal#2
It will be interesting to have more feedback on this idea.

@ad-si
Copy link
Owner

ad-si commented Mar 14, 2024

Thanks everyone for your ideas and feedback! 😊
I created extra issues for all the actionable bits so I can close this thread.
If you have any other questions or remarks, please open new issues. It's getting a little unwieldy here. 😅

@ad-si ad-si closed this as completed Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants