Toggle plugin views using 'when' contexts #386
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi team!
I started off a bit frustrated and almost requested a feature, but I figured it was simple enough I might be able to figure it out on my own and learn a bit of extension writing.
Essentially, I did not like "Dendron Tree View" and "Backlinks" in my view pane while working in non-Dendron workspaces. I know these can be toggled off, but I thought it better if Dendron managed this itself. This PR enables Dendron view panes selectively (i.e., when Dendron is actually active) using 'when' contexts. I am not entirely sure if this covers every place Dendron becomes active, but the manual testing I completed shows the idea works.
I am not sure how to write a test for this. Ideally, I would also store these keys into
constants.ts
, but I am also unsure if there should be a new enum defined or if this cleanly fits elsewhere. Additionally, I think this should be configurable somehow, but I'm not very familiar with how to accomplish that either. Thanks!