Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: Added scroll to bottom button #447

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

rainrisa
Copy link

Description

This pull request adds a scroll-to-bottom button to enhance navigation within notes, allowing users to easily scroll to the bottom of a note for editing or adding additional text.

Screenshot

Scroll to Bottom Button

Notes

This is my first contribution to the project, so I appreciate your feedback and any suggestions for improvement. Thank you!

@SiriusXT
Copy link

SiriusXT commented Sep 24, 2024

It doesn't work properly when multiple tabs are opened, and it doesn't work properly in a split window.
I feel that there are many pitfalls in getting the scrolling container through const $scrollingContainer = $('.scrolling-container');
However, it may be difficult to have a good method suitable for integration into the main code to accurately obtain the scrolling-container.

Additionally, it might be more appropriate for the scroll to bottom and scroll to top buttons to be displayed at the bottom right of the note, and dynamically displayed based on the note position, something like this:
图片
But currently trilium does not seem to have an interface to display a floating button in the lower right corner. It may be implemented as a widget.
Thanks anyway for your contribution, Trilium needs community power.

- in a split window
- when multiple tabs are opened
@rainrisa
Copy link
Author

Thanks for the feedback. I’ve pushed a fixed version that addresses the issues mentioned. Let me know if there are any other thoughts. Appreciate the guidance

@rainrisa
Copy link
Author

trilium-scroll-to-top-and-bottom

I have developed an improved version that includes buttons for scrolling to both the top and bottom of the notes.

I welcome any feedback and guidance you may have

@perfectra1n
Copy link

This looks great, thanks for putting this together!

@SiriusXT
Copy link

SiriusXT commented Sep 30, 2024

That's looks great. However, when scrolling to the bottom using the scrollbar or mouse wheel, the scroll button doesn't change to the upward scroll icon.
The scroll button only changes when clicked, not dynamically.
I think this might be achievable by listening to the scroll event, but since listening to scroll events can be CPU-intensive, it would be better to offer this functionality as a plugin for those who need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants