Hide done from page conditionally

Would be nice to have some kind of a toggle or filter/query to control how to display done tasks

I imagine this could control:

  1. see all tasks regardless of status
  2. see only not-done
  3. see only not-done OR done recently (x days)

reasoning - I want to treat some pages as “living things” instead of a huge ongoing ledger of everything that ever happened, so I want to log done things, but not necessarily see all of them because when I go to that page, I want to focus on the now

Thanks

This should hide DONE tasks

.ls-block[data-refs-self~='\["done"\,']:not(:focus-within),
.ls-block[data-refs-self~='\["done"\]']:not(:focus-within) {
    display: none;
}
```. Not conditional as you want, but half way there.

Thanks. It will be great if this feature can be implemented by a plug-in and be able to switched on and off (like how it works in Workflowy).

1 Like

Merge with this?

I created a plugin which accommodates this request:

It may not be an exact match to your requirements but it’ll get you part of the way there.

Thank you for your creative work! But it seems only working somewhere (not everywhere)? Does anyone else have the same problem?

It targets page body and linked refs and journal pages as explained in the Design Notes. It doesn’t target everywhere. For example, if your page has embedded queries it won’t target them. This is because the plugin is capable of matching against actual block content and not simply the DOM itself. But this advantage has drawbacks in some use cases.

I explained in the Design Notes that the core doesn’t provide any rendering hooks. If it did it could easily handle the matching in a way superior to what css selectors can do, but until the requested feature is added there are limitations.

To better solve the toggle to-do visibility use case, I wrote another plugin. It more closely follows the suggestion @danzu made. It’s based purely on stylesheet rules. It does not query the database at all. It keep tabs on the DOM as rendered.

It’s available in the plugin marketplace. Unfortunately, due to cross-frame origin policies one of the minor features doesn’t work when installed via the marketplace. So install it manually as directed on the plugin home page and everything will work fine.

1 Like