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

Refresh/reload tab view & search, fix(#146). #441

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

l-const
Copy link
Contributor

@l-const l-const commented Sep 4, 2024

  • Should close F5 key for refreshing the focused folder doesn't work #146

  • Made an attempt to provide a refresh/reload view functionality and it seems to work but maybe not the best/novel way to do it. I managed to create a refresh-delay animation somehow otherwise the reload functionality would not be able to be noticed, similar to how nautilus at least from a user perspective is doing that.

  • Demo:

refresh-view.webm

@@ -57,6 +57,8 @@ use crate::{
tab::{self, HeadingOptions, ItemMetadata, Location, Tab, HOVER_DURATION},
};

static REFRESH_VIEW_DELAY_MS: u64 = 20;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The delay value was a totally arbitrary decision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess in a 60Hz display you need at least 16.6 ms , so you will see at least one frame and more that one in higher refresh rate displays assuming the execution of the rescan of the view contents is instantaneous.

let entity = entity_opt.unwrap_or_else(|| self.tab_model.active());
if let Some(tab) = self.tab_model.data_mut::<Tab>(entity) {
let location = tab.location.clone();
tab.set_items(vec![]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Essentially, I set an "empty" value for the given tab and register a delayed callback that will either rescan or search again. Maybe something better could be done here.

@l-const l-const marked this pull request as draft September 5, 2024 12:12
@l-const
Copy link
Contributor Author

l-const commented Sep 5, 2024

I will try to add a new title and perhaps icon for the in between "Loading..." view or something like that. I am not sure where i could find a "Loading..." icon.

@l-const
Copy link
Contributor Author

l-const commented Sep 5, 2024

Attaching a new demo with the "Loading..." view, note that for demonstrative purposes the delay in the video was set at 200ms and not 20ms the one that is commited.

Demo:

refresh-loading-200ms.webm

@l-const l-const marked this pull request as ready for review September 5, 2024 15:33
@l-const l-const changed the title feat: Refresh/reload tab view & search, fix(#146). Refresh/reload tab view & search, fix(#146). Sep 6, 2024
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.

F5 key for refreshing the focused folder doesn't work
1 participant