markor icon indicating copy to clipboard operation
markor copied to clipboard

Add support for restoring scroll position for upper level file lists

Open guanglinn opened this issue 1 year ago • 7 comments

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:

https://github.com/gsantner/markor/assets/60415467/fba58102-3f46-448f-8da4-493389ef28ea/

guanglinn avatar Feb 05 '24 16:02 guanglinn

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

https://github.com/gsantner/markor/blob/60d1f434a7fe94ba93fa357754636a8016880bb1/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java#L2853

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

harshad1 avatar Feb 09 '24 05:02 harshad1

@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 avatar Feb 09 '24 06:02 guanglinn

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

guanglinn avatar Feb 09 '24 07:02 guanglinn

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.

harshad1 avatar Feb 10 '24 05:02 harshad1

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.

guanglinn avatar Feb 11 '24 00:02 guanglinn

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

gsantner avatar Feb 16 '24 04:02 gsantner

@gsantner . Conflicts has been resolved.

guanglinn avatar Feb 16 '24 11:02 guanglinn

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

I will improve it.

guanglinn avatar Mar 28 '24 22:03 guanglinn