Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sxyazi
Copy link
Owner

@sxyazi sxyazi commented Apr 20, 2025

Fixes #2642

@sxyazi sxyazi requested a review from Copilot April 20, 2025 06:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to fix issues related to file update triggers by lazily updating files to avoid side effects from sort order dependencies. The key changes include:

  • Adding a TODO comment in the watcher module to flag planned performance improvements.
  • Refactoring the update functions in update_files.rs to use instance methods (via &mut self) instead of static functions, thereby streamlining the update logic.
  • Removing the explicit dependency on MgrProxy by replacing its calls with corresponding self method calls.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
yazi-core/src/mgr/watcher.rs Added a TODO comment to indicate potential performance improvement areas.
yazi-core/src/mgr/commands/update_files.rs Refactored tab update functions to instance methods and removed MgrProxy usage.
Comments suppressed due to low confidence (1)

yazi-core/src/mgr/watcher.rs:79

  • [nitpick] For clarity, consider expanding the TODO comment to specify the planned performance improvements (for example, more efficient directory scanning or lazy processing approaches).
+	// TODO: performance improvement

@sxyazi sxyazi requested a review from Copilot April 20, 2025 06:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses an issue with file update ordering by lazily updating files, avoiding issues dependent on the sort order.

  • In yazi-core/src/mgr/watcher.rs, a TODO comment was added to flag a potential performance improvement in the trigger_dirs method.
  • In yazi-core/src/mgr/commands/update_files.rs, the update operations have been refactored to simplify tab updates by replacing multiple tab-specific update methods with unified instance methods that now take FilesOp by value.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
yazi-core/src/mgr/watcher.rs Added a TODO comment to flag potential performance improvements.
yazi-core/src/mgr/commands/update_files.rs Refactored file update logic to use instance methods for lazy update handling.
Comments suppressed due to low confidence (1)

yazi-core/src/mgr/commands/update_files.rs:67

  • [nitpick] The variable name 'calc' is a bit vague; consider renaming it to 'should_calculate' or a similar descriptive name for improved clarity.
let calc = !matches!(op, FilesOp::Size(..) | FilesOp::Deleting(..));

@sxyazi sxyazi merged commit 0b90a72 into main Apr 20, 2025
6 checks passed
@sxyazi sxyazi deleted the pr-1fcc7b4a branch April 20, 2025 06:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Left pane changes position when new tab is created

2 participants