Declutter Aliases - show them only when needed

image

Aliases are great, but once I started sprinkling Aliases all over the place, my notes started getting bloated with them. Then I realized that I really don’t have to see these Aliases rems all the time. I just need to be able to find when when I search for them. Also current flow already lists all the available aliases for a given reference when we try to link it.

One unavoidable situation in which I need a handle to these Aliases rems is when I have to edit the name of any of these. So the following snippet will hide these Aliases rems unless you zoom in on it’s parent. When you zoom in on its parent the the Aliases become visible. That way, there will be an option to edit them if there is a need. While searching, tagging etc. these aliases show up as usual.

/* Hide aliases unless parent of the alias is zoomed in */
.tree-node-container .tree-node-container .rem[data-rem-tags~="aliases"] {
   display : none;
}  

/* Hide aliases also inside full hover preview of references */
#document-hover-preview__popup .tree-node-container .rem[data-rem-tags~="aliases"] {
display: none;
}

If you zoom in like this, these Aliases become visible like this

image

13 Likes

This is really good, @liberated_potato, thanks for sharing. I just implemented it and seems to work perfectly. Cheers!

1 Like

Fantastic! Thanks for sharing!

1 Like

Hi! Is there a chance to update the code for version 1.4? I really liked how it worked but it stopped working. Thanks!

1 Like

Yes, I also really miss your feature, @liberated_potato !!

@Dante_Gaxiola , @hugo
Not able to find the same class structure from previous version. So I came up with a different implementation. Not exactly sure if this new implementation is as clean as the previous one. For the current implementation, the Aliases must be in collapsed state, otherwise children of Aliases will remain visible until you manually hide it. Once you hide it, it won’t come back unless you zoom in on the parent rem.

/* Hide aliases unless parent of the alias is zoomed in */
.TreeNode .rem[data-rem-tags~="aliases"] {
   display : none;
}  
/* Hide aliases also inside full hover preview of references */
#document-hover-preview__popup .rem[data-rem-tags~="aliases"] {
   display : none;
}
3 Likes

I really appreciate your help! Sadly, it’s not working for me:

@Dante_Gaxiola good catch. It failed to hide Aliases when the parent is tagged as document. I have updated the snippet in my previous post to take into account this scenario as well. Would you give it a try?
@hugo FYI

2 Likes

Terrific! It is working perfectly!

1 Like

Hi, again! It’s still not working for me, don’t know why…

Not sure what is going on in your case. I guess, you have selected the language of the code snippet as css right? What about the possibility of some higher checkbox disabling this particular snippet?
Is it not working in the case you have shown in your screenshot or is it not working at all?

1 Like

I don’t know what happened, but started working after restarting the program. Thanks a lot! I really appreciate it!