tgrosinger / tw5-checklist

Simple checklist widget for TiddlyWiki5:
https://tgrosinger.github.io/tw5-checklist/
51 stars 12 forks source link

Option to hide checked items #17

Open tgrosinger opened 8 years ago

tgrosinger commented 8 years ago

When checking an item, it would go into a collapsed list called "checked items" which the user could expand.

This option could be enabled with a field on the tiddler. hide-checked: true

It could be enabled globally by creating a shadow tiddler in the plugin namespace called "hide-checked". Similar to how the Markdown plugin does configuration.

tgrosinger commented 7 years ago

I think this would need to have both a global default as well as a per-tiddler override.

telmiger commented 7 years ago

Here is a demo that achieves this via CSS and two buttons (no separate list): https://tid.li/tw5/test/checklist-05.html#checklist%2Fhide-checked-button:checklist%2Fhide-checked-button%20ChecklistExample

tgrosinger commented 7 years ago

Thank you @telmiger for working on this!

Why did you choose to implement this as transcluded styles instead of as js in the checklist plugin core? Unfortunately it looks like if you have multiple buttons in the same tiddler, clicking it will show or hide all of the checklists.

telmiger commented 7 years ago

My intent was to show what is already possible without touching the plugin. Quick an dirty. This is to hide/show all checked items in all open lists via CSS. A global setting – an equivalent or alternative to the strike-through option. Just to give you something to play with and to think about – maybe so you can see how you don’t want to implement it :–) Additionally I’d like to point out that I would prefer to have all items in one list as opposed to your statement 'go into a collapsed list called "checked items"'. This means there would have to be a button per list to control the "hide/unhide checked" feature. The fact, that each item has a status "checked" should be enough. To store checked items in a list called "checked items" would duplicate existing information.

tgrosinger commented 7 years ago

maybe so you can see how you don’t want to implement it :–)

That does make sense, thank you.

I would prefer to have all items in one list as opposed to your statement 'go into a collapsed list called "checked items"'.

I agree with you, and that is what I had originally intended. I just phrased it poorly. I think we are on the same page with what this should look like. I wonder though, can we store state somewhere for each list so it remembers if it should be hidden? Or should that just be a global setting that can be overridden in a one-off and non-remembered way?