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

Add support for restoring scroll position of file lists #2211

Merged
merged 19 commits into from
Mar 27, 2024

Conversation

guanglinn
Copy link
Contributor

@guanglinn guanglinn commented Feb 5, 2024

This PR mainly implemented the following features for file browser:

  1. Highlight recently opened files or folders;
  2. Can restore the scroll position for the upper level list.

The screen recording as follows:

restore-position-and-highlight.mp4

@guanglinn guanglinn changed the title Add support for saving item position state in file browser Add support for restoring scroll position of file list Feb 7, 2024
@harshad1
Copy link
Collaborator

harshad1 commented Feb 9, 2024

We already have logic to flash a view and this is used in other places.

public static void blinkView(final View view) {

See how it is used here:

https://github.com/gsantner/markor/blob/master/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java#L550

We already have a function to show and blink a file in the folder view. Just need to call it at the appropriate time.

I have added an option to show the currently open file in the file explorer in this PR:

https://github.com/gsantner/markor/pull/2176/files#diff-a5f18ed8d9a7afd47e78969d79f34ea509f949c4f383113680d828316380943dR607-R610

An option has been added to the file menu to show the file in the file explorer. This works even if the file was launched from search or a shortcut.

This PR may not be necessary

@guanglinn
Copy link
Contributor Author

guanglinn commented Feb 9, 2024

@harshad1 , Does your PR have the feature to restore scroll position of file list? If not, I can only keep this feature in this PR.

@guanglinn
Copy link
Contributor Author

In addition, I hope the feature in your PR can highlight recently opened folders, rather than only documents.

@harshad1
Copy link
Collaborator

No. All I have is the ability to jump from an open file to it's location in the folder.

I also like how the highlighting to show the file / folder looks. There are some good changes in this PR. I will think about this more.

@guanglinn guanglinn changed the title Add support for restoring scroll position of file list Add support for restoring scroll position for the upper level file list Feb 10, 2024
@guanglinn guanglinn changed the title Add support for restoring scroll position for the upper level file list Add support for restoring scroll position for upper level file lists Feb 10, 2024
@guanglinn
Copy link
Contributor Author

I'm still not sure which code should be kept in my PR. Perhaps, I think I can decide it after your PR #2176 is merged.

@gsantner
Copy link
Owner

PR has conflicts. might be easier to take version from msater and just make the few line changes again

@gsantner gsantner linked an issue Feb 16, 2024 that may be closed by this pull request
4 tasks
@guanglinn
Copy link
Contributor Author

@gsantner . Conflicts has been resolved.

@guanglinn guanglinn changed the title Add support for restoring scroll position for upper level file lists Add support for restoring scroll position for file lists Feb 22, 2024
@guanglinn guanglinn changed the title Add support for restoring scroll position for file lists Add support for restoring scroll position of file lists Feb 22, 2024
Copy link
Owner

@gsantner gsantner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guanglinn @harshad1

Many merge requests - regarding blinking and showing position in the list: Let's bring it all together on master now, and further improve/debloat it afterwards.

When dark theme is used, I find the white blink color bad.

@gsantner gsantner merged commit c38944f into gsantner:master Mar 27, 2024
1 check passed
@gsantner gsantner added this to the Markor v2.12 milestone Mar 27, 2024
@guanglinn guanglinn deleted the highlight-item branch March 27, 2024 13:53
@guanglinn
Copy link
Contributor Author

When dark theme is used, I find the white blink color bad.

I will improve 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.

Briefly highlight a note when clicking 'back' button
3 participants