Skip to content

Commit

Permalink
feat: more flags, more entries in guide, fix context bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dhth committed Jul 14, 2024
1 parent dd1a781 commit 8235bf7
Show file tree
Hide file tree
Showing 6 changed files with 289 additions and 121 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ working on right now. It allows you to do the following:
- Create/update tasks at a specific position in the priority list
- Add a task at the start/end of the list
- Move a task to the top of the list (indicating that it takes the highest
Priority at the moment)
priority at the moment)
- Move task up/down based on changing priorities
- Archive a task
- Permanently delete a task

![active-tasks](https://tools.dhruvs.space/images/omm/omm-active-tasks-1.png)
Expand All @@ -78,8 +79,8 @@ working on right now. It allows you to do the following:

Once you're done with a task, you can archive it, which puts it in the archived
tasks list. It's more for historical reference, but you can also unarchive a
task and put it in the active list, if you need to. You can also permanently
delete tasks from here.
task and put it back in the active list, if you need to. You can also
permanently delete tasks from here.

![active-tasks](https://tools.dhruvs.space/images/omm/omm-archived-tasks-1.png)

Expand All @@ -90,6 +91,7 @@ is the context pane. You add/update context for a task via a text editor which
is chosen based on the following look ups:

- the `--editor` flag
- the environment variable `OMM_EDITOR`
- the environment variable `EDITOR`
- the environment variable `VISUAL`
- `vi` (fallback)
Expand Down Expand Up @@ -137,9 +139,9 @@ Multiple tasks can be imported from `stdin` using the `import` subcommand.

```bash
cat << 'EOF' | omm import
Order new ACME rocket skates
Draw fake tunnel on the canyon wall
Assemble ACME jet-propelled pogo stick
orders: order new ACME rocket skates
traps: draw fake tunnel on the canyon wall
tech: assemble ACME jet-propelled pogo stick
EOF
```

Expand Down Expand Up @@ -185,9 +187,10 @@ g go to the top
G go to the end
tab move between views
c update context for a task
C toggle showing context
d show task details in a full screen pane
v toggle between compact and spacious view
` toggle showing context
h/l move backwards/forwards when in the task details view
q/esc/ctrl+c go back/quit
```

Expand Down
121 changes: 87 additions & 34 deletions cmd/guide.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cmd

import (
"database/sql"
"fmt"
"time"

pers "github.com/dhth/omm/internal/persistence"
Expand Down Expand Up @@ -33,20 +32,16 @@ instructions.
},
{
"guide: tasks",
`omm is a task manager. You can also think of it as a keyboard driven to-do list.
`omm ("on-my-mind") is a task manager. You can also think of it as a keyboard
driven to-do list.
As such, tasks are at the core of omm. A task can be anything that you want to
keep track of, ideally something that is concrete and has a clear definition of
done.
A task has a one liner summary, and optionally, some context associated with it
(like this paragraph). You can choose to add context to a task when you want to
save details that don't fit a single line.
You can view details for a task by pressing "d". Try it out (come back to this
pane by pressing q/esc/ctrl+c).
You can also update a task's summary by pressing "u".
Tasks in omm have a one liner summary, and optionally, some context associated
with them (like this paragraph). You can choose to add context to a task when
you want to save details that don't fit in a single line.
`,
true,
},
Expand All @@ -56,9 +51,9 @@ You can also update a task's summary by pressing "u".
This list shows active tasks.
To be pedantic about things, only the tasks in active list are supposed to be
"on your mind". However, there are benefits to having a list of archived lists
as well.
To be pedantic about things, only the tasks in the active list are supposed to
be "on your mind". However, there are benefits to having a list of archived
tasks as well.
Press <tab> to see the archived list.
`,
Expand All @@ -69,12 +64,12 @@ Press <tab> to see the archived list.
`This is the archived list, meaning it holds tasks that are no longer being
worked on.
omm provides this list both for historical reference, and for you to be able to
move an archived task back into the active list.
omm provides this list both for historical reference, as well as for you to be
able to move an archived task back into the active list.
You can toggle the state of a task using ctrl+d.
You can toggle the state of a task using <ctrl+d>.
Press <tab/q/esc/ctrl+c> to go back to the active list.
Press tab/q/esc/ctrl+c to go back to the active list.
`,
false,
},
Expand All @@ -83,27 +78,33 @@ Press <tab/q/esc/ctrl+c> to go back to the active list.
`omm's task lists can be viewed in two density modes: compact and spacious.
This is the compact mode. As opposed to this, the spacious mode shows tasks in a
more roomier list, alongside highlighting prefixes, and showing creation
timestamps. Since the list in this mode takes more space, the context pane is
shorter than the one in the compact mode. Choose whichever mode fits your
workflow better.
more roomier list, alongside highlighting prefixes (we'll see what that means),
and showing creation timestamps. Since the list in this mode takes more space,
the context pane is shorter than the one in the compact mode.
omm starts up with compact mode by default, but you can change that by either
setting the environment variable $OMM_LIST_DENSITY=spacious, or by passing the
flag "--list-density=spacious" to omm (the latter takes priority).
You can toggle between the two modes by pressing "v". Choose whichever mode fits
your workflow better.
You can toggle between the two by pressing v. Try it now. Come back to this mode
once you're done.
Try it out. Come back to this mode once you're done.
`,
true,
},
{
"guide: toggling context pane",
fmt.Sprintf(`The context pane can be toggled on/off using the backtick key("%s").
`The context pane can be toggled on/off by pressing "C".
You can choose to display it or not based on your preference. For convenience,
the list will always highlight tasks that have a context associated with them by
having a "(c)" marker on them.
the lists will always highlight tasks that have a context associated with them
by having a "(c)" marker on them.
You can also start omm with the context pane hidden by using the flag
"--context-pane=false".
`, "`"),
You can start omm with the context pane hidden by either setting the environment
variable OMM_SHOW_CONTEXT to "0/1" or "true/false", or by passing the flag
"--show-context=false" (the latter takes priority).
`,
true,
},
{
Expand All @@ -122,6 +123,27 @@ position of the newly added task. omm offers the following keymaps for that.
A add task at the end
Go ahead, create a task, then move to the next guided item.
`,
true,
},
{
"guide: adding tasks via the CLI",
`You can also add a task to omm via its command line interface. For example:
omm 'prefix: a task summary'
This will add an entry to the top of the active tasks list.
You can also import more than one task at a time by using the "import"
subcommand. For example:
cat << 'EOF' | omm import
orders: order new ACME rocket skates
traps: draw fake tunnel on the canyon wall
tech: assemble ACME jet-propelled pogo stick
EOF
omm will expect each line in stdin to hold one task's summary.
`,
true,
},
Expand All @@ -131,9 +153,9 @@ Go ahead, create a task, then move to the next guided item.
it.
You do that by pressing "c". This will open up the text editor you've configured
via the environment variables $EDITOR or $VISUAL (looked up in that order). You
can override this behavior by passing the "editor" flag to omm, like
"--editor='vi -u NONE'". If none of these are configured, omm falls back to "vi".
via the environment variables $OMM_EDITOR/$EDITOR/$VISUAL (looked up in that
order). You can override this behavior by passing the "editor" flag to omm, like
"--editor='vi -u NONE'". If none of these are set, omm falls back to "vi".
Go ahead, press "c". Try changing the text, and then save the file. This context
text should get updated accordingly.
Expand All @@ -142,8 +164,8 @@ text should get updated accordingly.
},
{
"guide: task priorities",
`At its core, omm is a list that maintains a sequence of tasks based on the
priorities you assign them.
`At its core, omm is a dynamic list that maintains a sequence of tasks based on
the priorities you assign them.
And, as we all know, priorities often change. You're probably juggling multiple
tasks on any given day. As such, omm allows you to move tasks around in the
Expand All @@ -156,6 +178,37 @@ priority order. It has the following keymaps to achieve this:
It's recommended that you move the task that you're currently focussing on to
the top.
`,
true,
},
{
"guide: task details",
`The "Task Details" pane is intended for when you simply want to read all the
details associated with a task in a full screen view.
You can view this pane by pressing "d".
Whilst in this pane, you can move backwards and forwards in the
task list by pressing "h/l". You quit out of this pane by either pressing "d"
again, or q/esc/ctrl+c.
Try it out. Come back to this entry when you're done.
`,
true,
},
{
"guide: updating task details",
`Once a task is created, its summary and context can be changed at any point.
You can update a task's summary by pressing "u".
This will open up the the same prompt you saw when creating a new task, with the
only difference that the task's summary will be pre-filled for you. This can
come in handy when you want to quickly jot down a task for yourself (either by
using the TUI, or by using the CLI (eg. "omm 'a hastily written task summary")),
and then come back to it later to refine it more.
Similarly, you can also update a task's context any time (by pressing "c").
`,
true,
},
Expand Down
Loading

0 comments on commit 8235bf7

Please sign in to comment.