# agent_ui: Improve draft threads for worktrees \(\#58268\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/b077f41a9f26ae5ed7fadfea55a501d34afb25de)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: b077f41a9f26ae5ed7fadfea55a501d34afb25de

Requested commit: b077f41a9f26ae5ed7fadfea55a501d34afb25de

Commit: b077f41a9f26ae5ed7fadfea55a501d34afb25de

Tree: d2899b9c82da95275beaccf9f00016f70c6e048e

Author: Danilo Leal

Committer: GitHub

## Message

```
agent_ui: Improve draft threads for worktrees (#58268)

Closes AI-351

This PR builds on top of
https://github.com/zed-industries/zed/pull/57692 by improving the draft
threads UX in the context of worktrees. If you have more than one
worktree loaded for a given group, clicking on the plus button will now
display a menu allowing you to choose for which worktree you'd like to
open a new thread in. This felt particularly relevant in the case of
discarding a draft within a worktree when that was the only thread item
for that worktree, making it hard to come back to it.

Added some extra stuff in here as well with regards to better draft
management. Most notably, if you created a new thread and then typed
something, this draft thread would show a timestamp that's relative to
the creation time of the thread. However, if you moments later deleted
the draft content and then typed something up again, the timestamp would
be stuck in the creation time. That felt wrong because by erasing the
content you effectively reset the draft. So, this branch makes it so, in
this context, the timestamp would be reset to now.

Release Notes:

- Agents: Added improvements for the draft thread UX particularly in the
context of worktrees, allowing to choose for which worktree to open a
thread in when the group contains more than one.
```

## Parents

- [39f7849a0fedc52def5ba8763344245f2a543532](https://git.cafe/gitcafe/zed/commit/39f7849a0fedc52def5ba8763344245f2a543532?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/b077f41a9f26ae5ed7fadfea55a501d34afb25de?format=markdown)
