Skip to content

Conversation

@smitbarmase
Copy link
Member

Closes #40867

Since the recent changes in #38881, the filename editor is sometimes not focused after duplicating a file or creating a new one, and similarly, autoscroll sometimes didn’t work. It turns out that multiple calls to update_visible_entries_task cancel the existing task, which might contain information about whether we need to focus the filename editor and autoscroll after the task ends. To fix this, we now carry that information forward to the next task that overwrites it, so that when the latest task ends, we can use that information to do the right thing.

Release Notes:

  • Fixed an issue in the Project Panel where duplicating or creating an entry sometimes didn’t focus the rename editing field.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 14, 2025
@smitbarmase smitbarmase merged commit 524b97d into main Nov 14, 2025
24 checks passed
@smitbarmase smitbarmase deleted the fix-filename-editor-focus-race-condition branch November 14, 2025 16:26
@smitbarmase
Copy link
Member Author

/cherry-pick stable

github-actions bot pushed a commit that referenced this pull request Nov 20, 2025
#42739)

Closes #40867

Since the recent changes in
[https://github.com/zed-industries/zed/pull/38881](https://github.com/zed-industries/zed/pull/38881),
the filename editor is sometimes not focused after duplicating a file or
creating a new one, and similarly, autoscroll sometimes didn’t work. It
turns out that multiple calls to `update_visible_entries_task` cancel
the existing task, which might contain information about whether we need
to focus the filename editor and autoscroll after the task ends. To fix
this, we now carry that information forward to the next task that
overwrites it, so that when the latest task ends, we can use that
information to do the right thing.

Release Notes:

- Fixed an issue in the Project Panel where duplicating or creating an
entry sometimes didn’t focus the rename editing field.
@zed-zippy
Copy link
Contributor

zed-zippy bot commented Nov 20, 2025

zed-zippy bot added a commit that referenced this pull request Nov 20, 2025
#42739) (cherry-pick to stable) (#43130)

Cherry-pick of #42739 to stable

----
Closes #40867

Since the recent changes in

[https://github.com/zed-industries/zed/pull/38881](https://github.com/zed-industries/zed/pull/38881),
the filename editor is sometimes not focused after duplicating a file or
creating a new one, and similarly, autoscroll sometimes didn’t work. It
turns out that multiple calls to `update_visible_entries_task` cancel
the existing task, which might contain information about whether we need
to focus the filename editor and autoscroll after the task ends. To fix
this, we now carry that information forward to the next task that
overwrites it, so that when the latest task ends, we can use that
information to do the right thing.

Release Notes:

- Fixed an issue in the Project Panel where duplicating or creating an
entry sometimes didn’t focus the rename editing field.

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
11happy pushed a commit to 11happy/zed that referenced this pull request Dec 1, 2025
zed-industries#42739)

Closes zed-industries#40867

Since the recent changes in
[https://github.com/zed-industries/zed/pull/38881](https://github.com/zed-industries/zed/pull/38881),
the filename editor is sometimes not focused after duplicating a file or
creating a new one, and similarly, autoscroll sometimes didn’t work. It
turns out that multiple calls to `update_visible_entries_task` cancel
the existing task, which might contain information about whether we need
to focus the filename editor and autoscroll after the task ends. To fix
this, we now carry that information forward to the next task that
overwrites it, so that when the latest task ends, we can use that
information to do the right thing.

Release Notes:

- Fixed an issue in the Project Panel where duplicating or creating an
entry sometimes didn’t focus the rename editing field.
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

2 participants