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

Hover touched or moved file #235

Closed
Brixy opened this issue Oct 1, 2023 · 9 comments · Fixed by #269
Closed

Hover touched or moved file #235

Brixy opened this issue Oct 1, 2023 · 9 comments · Fixed by #269
Labels
enhancement New feature or request
Milestone

Comments

@Brixy
Copy link
Contributor

Brixy commented Oct 1, 2023

Sorry, another idea ;-)

When you touch, move or rename a file or folder the file or folder should be hovered and in the visible area.

Currently there is no visible feedback at all if you e.g. touch a file which is created outside the displayed area.

I’m not sure what is the best to handle multiple files—maybe hover the first according to the current sorting?!

Thank you very much.

@Brixy
Copy link
Contributor Author

Brixy commented Oct 2, 2023

Played a bit more because yazi is so fantastic.

It seems that when you find files using fzf (bound to Z) the selected file is not hovered when it lives in a sub directory.

Example from yazi’s repository:

  • Z
  • sixel
  • Enter

Yazi enters the corresponding folder but does not hover sixel.rs.

Yet, it works correctly as soon as do a search in the same folder again:

  • hh (go back to yazi’s root)
  • Z
  • sixel
  • Enter

sixel.rs is hovered now.

When you go back to root and search for other files in yet other directories they are not hovered.

This might be a caching thing.

@sxyazi
Copy link
Owner

sxyazi commented Oct 2, 2023

Thanks for your appreciation. The hover will be rewritten and completed before the release of Yazi v0.1.5.

@sxyazi sxyazi added this to the v0.1.5 milestone Oct 2, 2023
@sxyazi sxyazi added the enhancement New feature or request label Oct 2, 2023
@sxyazi
Copy link
Owner

sxyazi commented Oct 13, 2023

Done by #269, let me know if it solved those issues for you!

@Brixy
Copy link
Contributor Author

Brixy commented Oct 14, 2023

Wow! Excellent. Thank you very much for adressing this.

Everything works perfectly; I just noticed one flaw (but I don’t know whether this is adressed in the pull request):

When you move a file the file is not hovered afterwards.

This could be a solution: When two or more files are moved, the current behavior is optimal. When a single file is moved, it maybe should hovered afterwards.

Does this make sense to you?

Thanks again for all your work on yazi.

@sxyazi
Copy link
Owner

sxyazi commented Oct 14, 2023

I'm not quite sure how to handle moving (copying and then deleting if it's a cross-mount operation) files.

If the files being moved are large, like 1GB, it might take some time to complete. During this time, the user may have already moved their cursor to a different location.

Is resetting the cursor after the file move/copy is complete the expected behavior? Wouldn't that disrupt the user's expectations?

@sxyazi
Copy link
Owner

sxyazi commented Oct 14, 2023

Just tested Ranger and Finder (macOS's file manager), and they also don't implement re-hovering after moving.

I'm curious if there are other file managers that have implemented this feature. Maybe we can use them as a reference.

@Brixy
Copy link
Contributor Author

Brixy commented Oct 14, 2023

If the files being moved are large, like 1GB, it might take some time to complete. During this time, the user may have already moved their cursor to a different location.

Yes, this is a valid point.

I have been using nnn for years, hence this suggestion. nnn just blocks everything until file movements are completed.

So I think your implementation is perfect and more advanced!

@sxyazi
Copy link
Owner

sxyazi commented Oct 14, 2023

Alright, let's merge that PR!

Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants