Minor refactor of todo state guard conditions
Make activated task in hidden project stay hidden

Fixes #1417