Skip to content

TaskListItem with TaskStates (instead of a checkbox) - #80

Draft
mikekasprzak wants to merge 3 commits into
jgm:mainfrom
mikekasprzak:org-mode-style-checkbox
Draft

TaskListItem with TaskStates (instead of a checkbox)#80
mikekasprzak wants to merge 3 commits into
jgm:mainfrom
mikekasprzak:org-mode-style-checkbox

Conversation

@mikekasprzak

Copy link
Copy Markdown

Inspired by the conversation in #53 and #55 on org-mode, this draft PR is an alternative to #53 that changes the grammar of TaskListItem from containing a checkbox with checked and unchecked states, to containing the status of a task instead: finished, unfinished, and inprogress.

Some notes:

  • Feedback is encouraged!
  • I initially used done, not_done, and in_progress, but there was another done string in the code I wanted to avoid confusion with, and I didn't want to introduce - or _ into the CSS classes without a conversation first.
  • I changed most mentions of checkbox, but some still remain. At the time I couldn't decide if the term checkbox should still be used to describe the [ ] syntax, or if it should be more explicitly called a Task
  • The original logic checked for checked or unchecked, then it used an else for the other option. This is handy if you start with checkbox === " " to find the unchecked, as the else will catch both [x] and [X] (and [o]) as checked. I added inprogress into these checks without considering if the logical order should be changed.
  • I don't like how they are rendered in HTML (using a CSS class and unicode character), but I didn't have a better idea
  • Adding a 4th state like paused ([?]) is easy enough, but the way states are added right now doesn't exactly lend itself to adding more easily (if it's even needed)
  • I probably missed something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant