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

project_panel: Select the newly created file when copy/pasting a file #14705

Merged

Conversation

CharlesChen0823
Copy link
Contributor

close: #14361

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jul 18, 2024
@CharlesChen0823 CharlesChen0823 marked this pull request as draft July 18, 2024 03:25
@CharlesChen0823
Copy link
Contributor Author

Don't known if this modify is needed. the CI failed because selected target had changed which is expected.

@CharlesChen0823 CharlesChen0823 marked this pull request as ready for review July 18, 2024 05:42
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

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

the CI failed because selected target had changed which is expected.

If it's expected, we have to update the tests then?

I am also not sure about this test failure:
https://github.com/zed-industries/zed/actions/runs/9984980450/job/27595098698?pr=14705#step:4:919

seems that we've copied a in that test, selected root and pasted it there twice:

select_path(&panel, "root", cx);
panel.update(cx, |panel, cx| panel.paste(&Default::default(), cx));
cx.executor().run_until_parked();
panel.update(cx, |panel, cx| panel.paste(&Default::default(), cx));
cx.executor().run_until_parked();

with one a already existing under root.

I would expect that there are 2 new entries, root/a copy and root/a copy 1 and either of them is selected.
I would prefer the latter, but the code is written to prefer the former.
Yet, the test failure shows, that root/a copy/a/ is selected?? Is that the desired behavior?
Maybe I misread the test, and then we just have to adjust the test results, but please double check that part.

crates/project_panel/src/project_panel.rs Outdated Show resolved Hide resolved
crates/project_panel/src/project_panel.rs Outdated Show resolved Hide resolved
@SomeoneToIgnore SomeoneToIgnore self-assigned this Jul 18, 2024
@CharlesChen0823
Copy link
Contributor Author

CharlesChen0823 commented Jul 18, 2024

Yet, the test failure shows, that root/a copy/a/ is selected?? Is that the desired behavior?

I think this is desired behavior, and I also check this behavior in VSCode, same in.

Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

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

Thank you for confirming that now things work as you'd expect.

@SomeoneToIgnore SomeoneToIgnore merged commit bac4a04 into zed-industries:main Jul 18, 2024
9 checks passed
@CharlesChen0823 CharlesChen0823 deleted the select_after_copy branch July 19, 2024 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select the newly created file when copy/pasting a file
2 participants