-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Desktop: Fixes #12355: Auto-scroll to selected note from 'Go to Anything' search results #13286
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
base: dev
Are you sure you want to change the base?
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
recheck |
I have read the CLA Document and I hereby sign the CLA |
recheck |
2983cab
to
912c81d
Compare
912c81d
to
83edfdb
Compare
Please change the title of the PR to the following so that it matches the naming convention: Desktop: Fixes #12355: Auto-scroll to selected note from 'Go to Anything' search results |
83edfdb
to
c5ce06d
Compare
8f95912
to
b26c10e
Compare
laurent22#12355) - Add pending auto-scroll pattern that only triggers for non-visible notes - Track selection and folder changes with ref-based state management - Preserve manual scrolling and multi-selection behaviors - Handle cross-folder navigation via Go to Anything Fixes laurent22#12355
b26c10e
to
8215f10
Compare
FYI while probably acceptable in draft stage, it's best not to force push. Once this is ready for review it's not helpful to reviewers if you keep on replacing the history. It's unnecessary to clean up the history on the branch because if it gets merged it will be squashed anyway |
Right - sorry about that. I will keep this in mind in the future. |
Really really ready for review this time |
Resolves
Summary
When selecting a note from the "Go to Anything" search results, Joplin was not automatically scrolling the note list to show the selected note. This made it difficult for users to see which note was selected, especially in large note collections.
This fix adds a smart auto-scroll feature in that automatically scrolls to newly selected notes only when they are not currently visible in the viewport.
Implementation
The solution uses a pending auto-scroll pattern with three ref-based state trackers:
Auto-scroll triggers when:
Auto-scroll behavior:
Key Features
✅ Smart scrolling: Only auto-scrolls when the selected note is not visible
✅ Cross-folder support: Handles "Go to Anything" navigation between folders
✅ Manual scroll preservation: No interference with user scrolling
✅ Multi-selection support: Preserves existing multi-selection behavior
✅ Performance optimized: Uses existing function and visibility calculations
Testing
Go to Anything within folder:
Go to Anything across folders:
Manual scrolling:
Arrow key navigation:
Multi-selection:
This solution provides reliable auto-scrolling for "Go to Anything" while maintaining all existing navigation behaviors.
Screencast show the problem
joplin-without-fix.webm
Screencast with the fix
joplin-with-fix.webm