sidebar: Fix draft threads showing up in the sidebar in some cases (#52974)

We were inserting threads with no entries into the sidebar, when you
clicked on New Thread, typed a message and then added a new project to
the current workspace.
We now skip persisting threads when they are empty.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
29955a0d09Bennet Bo Fenner committed on 4/2/2026, 9:25:43 AM· committed by GitHubparent5a74733
2 files changedLine totals unavailable