nothingislost/obsidian-hover-editor

[Feature Request] Scroll past properties when window opens

FynnFreyer opened this issue · 4 comments

It would be nice if the hover editor would scroll past the property view when opening.
Screen space is very limited in the popover, so it would be nice if instead of seeing the metadata first, we'd see the content directly.

This is the current opening state:

Current Behaviour

This would be the requested opening state:

Requested Behaviour

Changing this might be contentious, because it doesn't match the default editor behaviour, but it could be hidden behind a setting.
OTOH, it more closely matches the default preview, which doesn't show the properties at all.

Default Preview

Enabling this might be as simple as scrolling the view to div.cm-contentContainer. I'll have a look and might send a PR, but I haven't checked out CodeMirror yet, so not sure where to start, and pretty squeezed on time rn

Also, THANK YOU for this awesome plugin! This makes quick side notes so much easier =)

You'll have my vote for gem of the year for sure

pjeby commented

As a quick fix, you could use CSS to hide the properties entirely in a hover editor. I personally have property display turned off and use a sidebar pane to show/edit properties but of course that's not everyone's cup of tea.

I rather wish Obsidian allowed you to toggle the inline properties view off and on, especially on a per-pane basis, as that would make something like this easier to do.

In the long run we might be able to maybe add a toggle to the top bar (like the view header show/hide button) to toggle properties.

@pjeby Thanks, that's a great idea!

Actually, while experimenting, I saw that you can just fold the properties, and they stay folded until you explicitly unfold. Which is enough for me.

Folded Properties

I did however write some CSS before, that hides them completely, going to share this here in case someone else wants to hide them completely and finds this issue. Put this in your .obsidian/snippets folder and activate under Settings → Appearance.

div.popover-content div.metadata-container {
    display: none !important;
}

This hides the properties completely from popovers.

Properties hidden via CSS

Since this is solved with existing mechanisms, I don't think this feature would be worth any added maintenance burden, so I'm closing this issue.

Sry, I didn't realize that this folding works per pane (as you wrote ...)

Then there's still some value in this Issue. Quick fix with CSS works however, which is why this probably isn't all that important.