vscode-markdown-checkbox icon indicating copy to clipboard operation
vscode-markdown-checkbox copied to clipboard

Tri-state checkboxes

Open fabwi opened this issue 3 years ago • 6 comments

I really enjoy using this extension, not only for simple to-do lists but also for "decision" lists. I start these lists by enumerating all the options I have and then I consider every single option in detail. What I now miss sometimes is a third state to distinguish between "unconsidered yet" and "rejected". I fully understand if this was not your intention, but maybe a third state is valuable in other use cases as well :-)

fabwi avatar Jan 20 '22 11:01 fabwi

Sounds interesting, do you've any idea how this could look like, I mean syntactically?

PKief avatar Jan 21 '22 19:01 PKief

I looked into your code and I'm afraid that this is probably not the easiest thing to achieve because of the fundamental changes it would mean. Instead of just toggling between checked/True and unchecked/False a third state would be needed. Without knowing the extension code in detail I guess that the necessary changes would be anywhere, from the model in checkbox.js to the command markCheckbox.js and the status bar in checkboxStatus.ts. It also effects the customizable options "Type of checkmark", "Italic", "Strikethrough" and "Date when checked" - there would not be a simple "checked" state anymore but a "x-checked" and a "tick-checked" state, and the need to configure each of these states.

fabwi avatar Jan 26 '22 21:01 fabwi

Regardless of the code I mean how the third state should be displayed in markdown. Maybe we could introduce a "-" inside the brackets to mark it as partially checked, like an intermediate state of the checkbox:

- [-] this point is unconsidered yet

PKief avatar Jan 26 '22 23:01 PKief

In the manual "pencil and a sheet of paper" world I would probably just skip a checkbox to leave it unsonsidered. I would accept items by "tick-check" and reject items by "x-check".

In the current release, "x-checks" in the markdown code are rendered to "tick-checks" in my markdown preview. So obviously my manual habits are not working very well here ;-)

I think "-" sounds good to mark an item as unconsidered. With the advantage of leaving the current meaning of "unchecked" as "undone" which is perfect for todo lists.

fabwi avatar Jan 27 '22 13:01 fabwi

I'm also interested in multiple states for checkboxes. Dendron uses different characters inside the brackets. So they have states like "dropped" which is [d]. I use these quite a lot.

Personally, I'm also interested in finding an extension which supports alternatives to the square brackets. I'd like to be able to track repeating checklists as - ( ) for example, and have them rendered as a checkbox in the preview. Then I can grep for - [ ] while not finding my checklists!

@PKief Would adding these esoteric cases be a bit over the top for your plugin?

chmac avatar Dec 30 '22 14:12 chmac

@chmac adding [d] seems reasonable, instead of tri-state this feature could be custom-state-for-any-single-char, where [ ] and [x] are just two of many?

But the question of using a different markdown syntax - ( ) belongs in a different issue

darthwalsh avatar May 22 '23 19:05 darthwalsh