-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
freezing the list in the backgroud while previewing a file #3004
freezing the list in the backgroud while previewing a file #3004
Conversation
change the background color to 0.99, then it looks cleaner.
stop the underlying list scrolling when using the mousewheel or swiping the screen.
Does this work if I open txt file? |
Sure. Can you visit this page? https://note.youdao.com/ynoteshare/index.html?id=0418919966031fb8354f905af0122e7a&type=note&_time=1708149703792 .\filebrowser.exe -d .\filebrowser.db --disable-preview-resize --disable-type-detection-by-header --cache-dir .\cache |
@@ -152,7 +152,7 @@ main .spinner .bounce2 { | |||
/* PREVIEWER */ | |||
|
|||
#previewer { | |||
background-color: rgba(0, 0, 0, 0.9); | |||
background-color: rgba(0, 0, 0, 0.99); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's 0.9, we would see the listing in the background. It looks a little bit messy.
@@ -3,10 +3,10 @@ | |||
<header-bar v-if="error || req.type == null" showMenu showLogo /> | |||
|
|||
<breadcrumbs base="/files" /> | |||
|
|||
<listing /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the listing here, just like the sidebar, the headerbar. Then, the listing will always show in the mainpage, sometimes in the background.
Good stuff, let's wait for merge of your PR. 😀 |
this.fetchData(); | ||
return; | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we judge if the routing is from a dir (listing) to a file (preview), a dir to another dir, a file to a file, or a file to a dir. we only allow the listing to reload when it's from a dir to a dir.
this.setLoading(true); | ||
if (window.sessionStorage.getItem('listFrozen') !=="true"){ | ||
this.setLoading(true); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.setLoading(true) is the function to reload the listing. we just disable it when the routing is not from a dir to a dir.
@@ -1,6 +1,8 @@ | |||
<template> | |||
<div | |||
id="previewer" | |||
@touchmove.prevent.stop | |||
@wheel.prevent.stop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid the scrolling or wheeling to move the underground listing.
} | ||
if (this.req.isDir) { | ||
window.sessionStorage.setItem('listFrozen', "false"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this modification, it would still work. But we would see the listing page blinking when we are back from the preview. It's because we are keeping the listing page alive all the time, it's watching the req to refill the window even if it's in the backgound. so we need this modification here. and I use window.sessionStorage.setItem to transfer data between .vue files. It's very fast and simple.
I am using filebrowser on linux this is my kernel Linux 6.1.0-18-amd64 x86_64. Can you please compile version for Linux. I am very happy to test it. |
Here it is: |
And here is a version I modified to fix this #2978. You can switch pics or close pics with animation by finger swipe or mouse drag. (swipe left, swipe right, swipe down) |
What about #3004? That's what this PR should be? I tried both zip files you provided and when I enter txt file and close it, I am back on top of my list. |
Here it is: This is for this PR. |
Unfortunately, it is not working as expected. |
Try this: |
Oh yea, thats what I am talking about. It is working great. |
It works now? It can return to the last position of the list when you close the editor? |
Yes it is working great. After closing txt file, I am still on the same position on the list. |
@o1egl Can you please merge this PR? Or what else needs to be done for you to merge it? |
@niubility000 Thanks fo the PR. One note: I see in the console that it still created an HTTP request to the server. |
@niubility000 is it possible to implement something that remembers position when opening folder and returning back? If I have a lot of folders and enter some of them, when I return back I need to scroll again to find where I was. |
I have tried it before. It's pretty simple, just delete the this.setLoading(true); in the files.vue. But there is a bug. When you entire a new dir, sometimes it's not on the top of the list. I will rethink of it when I have time. and you can only click back button to make it work. |
Would be great if you can make some solution. Happy to test it as always. Not sure what you mean by Windows Explorer, but just tested it and if I enter folder and press back button, I am on the same position in the list where I was before, so I am not again back on top of the list. |
Yes, you are right. My memory is wrong. |
You can test it now. The version is "test2". It's linux, amd64 |
Just tested, thanks for effort it is working nice. There is only one small thing, when I go back, I always have folder that I entered marked as selected. Maybe it is nice to have it like that, then you know which folder you entered previously. |
@niubility000 thank you very much for providing me a test version. Can you also submit a PR once you have time? Until then I will use your test version. Once again, many thanks for your effort and contribution, much appreciated. |
I intended to add this function. But there is a small bug. When we return from a preview, we can't highlight the item in the list. I am still trying to figure it out. |
There is another bug. If your list is long (more than 50 folders), you can't go back to the exact position. |
@alanmilinovic I think I have fixed the two bugs. I hope I can give you a test version tomorrow. |
Wow, you are amazing, many thanks. |
Here's the version test3. I still can't highlight the item when we return back from a preview or editor. But I think it's ok to pull a request. |
Go for it mate and thanks. |
It is to fix #2188, #1870, and it works perfectly.
When you return from the preview, you will go back to the last position of the list.
This is a new PR instead of the old one #3002
the old PR can't pass the checks totally because of the "type may not be empty [type-empty]" error. When we commit a changed file, we need write a type in the commit message box, something like "fix: ......". the default name "Update Files.vue" is totally wrong. It's a little bit misleading.
https://github.com/conventional-changelog/commitlint/?tab=readme-ov-file#config
Common types according to [commitlint-config-conventional (based on the Angular convention)]can be:
build
chore
ci
docs
feat
fix
perf
refactor
revert
style
test