zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

(Feature request) Ability to scroll a few lines after the end of the document #2728

Closed VaiOnko closed 1 year ago

VaiOnko commented 2 years ago

Describe feature

Now, when adding math at the end of a long document, the math box goes off screen and can't be seen. The workaround is to add a few empty lines after, but this issue could be easily fixed by adding the ability to scroll further, like for example getting the last line of the text to the middle of the screen, like Joplin does it.

Doesn't sound too hard to implement to me, but hard enough that I can't do it.

Additional Information

No response

JoelKle commented 2 years ago

I would also appreciate such a feature. It's always hard to read / edit a note at the end of the screen.

In Visual Studio Code there are a lot of settings available to configure such a behavior. Maybe this can be a inspiration for Trilium. For example to enable (this is the default is VSCode):

"editor.scrollBeyondLastLine": true

would lead to:

Bildschirmfoto 2022-04-07 um 10 06 26

I can scroll beyond the last line of the document...

pingumen96 commented 2 years ago

Hello, I think that the only thing that is needed is some padding in the end of the document, I'd like to work on it but I don't have time to do it image I only added some padding as you can see

zadam commented 2 years ago

@pingumen96 it's actually more complex than that. There are other panes/view which can appear there if there's available space (e.g. children overview, mermaid preview etc.). Having artificial padding there would disrupt this.

mechanarchy commented 1 year ago

A hacky solution that works for me; this just adds some padding (suboptimal solution as identified above) to the bottom of text and code notes. It definitely does put a weird gap in before the children overview, but I can deal with that minor inconvenience for the huge quality-of-life improvement it brings me.

Create a CSS code note with attribute appCss and the following content:

/*
Allow overscrolling the text & code note editors
*/
.note-detail-editable-text-editor, .note-detail-readonly-text {
    padding-bottom: 5em !important;
}
.CodeMirror-code {
    /* This slightly breaks the vscroll bar, but idc */
    padding-bottom: 5em;
}
ApplePie420 commented 1 year ago

@mechanarchy yes this works reasonably well, the vscroll bar is not broken for me (at least doesn't seem to be). Thank you, this has been bothering me for a while.

It would be also cool to have an option to have the last line in the middle or in the last 2/3 of the screen always (i.e. when I add a new line, it autoscrolls and pads in such a way, that the new line will be in the same place as the line before was). VSCode and Joplin for example has this, and it is super nice on for example big or vertical screens, where looking at the bottom of the screen can be a bit annoying. But at least the autoscroll feature would be excellent (= keep the cursor at the same "place" on the screen, not the document (move the document around the cursor, not the other way around))

zadam commented 1 year ago

You can now scroll to half the editor pane height beyond the end of the content, like this:

image

Will be in 0.62.

Mirwaisse commented 11 months ago

Is there any easy way to disable this new feature, for example with a CSS rule in a theme?

Edit: forgot that the dev tools are available, I found an easy solution:


.scroll-padding-widget {
  display: none;   
}