-
Notifications
You must be signed in to change notification settings - Fork 47
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
Thoughts on scriptability and alternative UIs #36
Comments
I totally agree that we should think about this and I do have some ideas. Currently the architecture is such that the Whether the serialised/non-human output is generated by the main dstask exe or a separate one is up for consideration; I suppose it would be neater to have one EXE but I think a small amount of refactoring is required. As for the refactoring, when I get some time I want to factor the main As for sorting, I'm not sure I'd like that to be customisable as dstask is intended to be quite opinionated rather than endlessly configurable -- though if real use cases present themselves I'd consider it.
The |
|
Here's an example of a function that iterates a specified list of contexts (zsh only afaict). Needs taskreview () {
clear
declare -A contexts
contexts=(
"+work -wf" "Work tasks"
"+work +wf" "Work waiting for"
"+personal -wf" "Personsal tasks"
"+personal +wf" "Personsal waiting for"
)
for ctx desc in ${(kv)contexts}
do
while true
do
sh -c "dstask $ctx --"
echo ""
choice=$(rlwrap -t dumb -pYellow -S "[$ctx] $desc; (continue/dstask cmd) " -o cat)
case $choice in
c*)
break
;;
*)
sh -c "dstask $choice --"
;;
esac
done
clear
done
} This is currently my way to step through a predefined series of "named contexts". Moving those outside of a shell data structure would probably imply a config file format. Also note that we need to use |
Interesting function, though I've always thought good contexts are semantic enough not to need a description. For instance, I'll give Reviewing tasks is definitely a thing that needs to be done periodically in order to keep the task list manageable. Exploring mechanisms like this is worthwhile, perhaps a workflow could be integrated in dstask itself; or maybe not as I just do it manually. Not sure. I tried the review system built into taskwarrior/tasksh -- but I could never get into regular use with it though never really tried. |
I'm working a bit today on printing to stdout for
Update: I think I'll attempt to extract a function or method from this method here: Update 2: Actually I think I'll stop work on this for now. This is not yet a critical feature for me, personally, so it's probably mroe productive to open a new issue to talk about a |
After the initial refactor in #43 there are some more things to be done to consolidate the construction of a sorted, filtered Whether alternative UIs import How it is filtered, and how it is sorted, is the subject of my refactoring. I am hoping that it turns out to be a good design. :) What we have so far is a new constructor func WithIDs(ids ...int) TaskSetOpt {...}
func WithTags(tags ...string) TaskSetOpt {...}
func WithProjects(projects ...string) TaskSetOpt {...}
func WithoutTags(tags ...string) TaskSetOpt {...}
func WithoutProjects(projects ..string) TaskSetOpt {...}
func SortBy(attribute, direction string) TaskSetOpt {...} This would continue to push more logic into a single function, |
I am working on integrating sorting and filtering into the The diff with master can be viewed here. I'll open a PR once it actually works 😅 Update: here is a PR that introduces |
Seems like much of this is mapping command names to an invocation of the respective function.
There's some interesting tech out there for building UI's such as tview for the terminal, wails for webapp (there was a gotimeFM episode about it. the main thing about this is how it automatically generates functions (that map to your go methods) to call them directly from javascript, or you can compile Go code to javascript to run go code as a web frontend, there's a lot more in this ecosystem but i'm not that familiar with it. I think there was even a vue/reactjs-like framework in Go. Also https://gioui.org/ is interesting (there's a gotime FM episode about it as well) |
Closing this, as it's speculative and now we have a chat room for discussion. |
When I used taskwarrior I was a fan of
vit
, an alternative terminal UI, based on vim.As we develop, I hope we can make sure that we can keep the following use cases in mind.
context-independent commands, e.g. adding tasks that do not "take" a context, even if one is active globallyIn principle, any application could parse the ~/.dstask directory tree, but that application would need extra configuration, and would need to re-implement dstask's logic. If I were designing a simple web app to display and update tasks, shelling out to the dstask binary in my http handlers seems like a really straightforward way to go about it.
There's no action associated with this issue, but if others have thoughts on enabling tools and scripts around dstask, I would be interested.
The text was updated successfully, but these errors were encountered: