Skip to content

Fix display of renamed files in tree view #4452

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

Merged
merged 3 commits into from
Apr 8, 2025

Conversation

stefanhaller
Copy link
Collaborator

  • PR Description

Fix a regression (introduced with the root item PR, #4346) that caused renamed files to be displayed with their full path in tree view.

While fixing this I noticed that the display of moved files is a bit confusing; for example, you can't distinguish a file being moved from the root level into a directory from one that was renamed inside the directory; see commit message of the first commit for more. I'm not doing anything about this right now, just fix the regression for now.

Labeled as "ignore-for-release" because it fixes a regression in code that wasn't released yet.

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

Renaming a file inside the same directory shows it with its full path in the
tree view, which isn't what we want. We'll fix this in the next commit.

Also adding a few other test cases for moving files; they show that the display
of moved files in tree view isn't ideal. For example, moving file1 from top
level into dir shows it as "R file1 → file1", which isn't distinguishable from
renaming file1 inside dir. I suppose what we would like to have here is
"R ../file1 → file1" or something, but I'll leave that for the future; here I
only want to fix the regression that was introduced with the root item PR.
This broke with #4346 (Add root node in file tree).
@stefanhaller stefanhaller added ignore-for-release This will exclude the PR from release notes blocks-release Must be addressed before we can cut the next release labels Apr 2, 2025
Copy link

codacy-production bot commented Apr 2, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 6fb79421 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6fb7942) Report Missing Report Missing Report Missing
Head commit (b09251e) 54039 46834 86.67%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4452) 25 25 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

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

LGTM

@stefanhaller stefanhaller enabled auto-merge April 8, 2025 14:15
@stefanhaller stefanhaller merged commit a09ca59 into master Apr 8, 2025
15 checks passed
@stefanhaller stefanhaller deleted the fix-display-of-renamed-files-in-tree-view branch April 8, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocks-release Must be addressed before we can cut the next release ignore-for-release This will exclude the PR from release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants