# Improve auto watch \(\#56126\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 6766514599c6f8ce6530ccc685db5e0d68c44f32

Requested commit: 6766514599c6f8ce6530ccc685db5e0d68c44f32

Commit: 6766514599c6f8ce6530ccc685db5e0d68c44f32

Tree: 2b9b7b9bc2a72510ed721db79037cee70fecd2ee

Author: Joseph T\. Lyons

Committer: GitHub

## Message

```
Improve auto watch (#56126)

This PR fixes a few bugs, updates some UI, and improves testing of auto
watch. It'll likely be easier to review commit by commit:

- Swapped the Copy Channel Link and Auto Watch buttons so Auto Watch
appears in a better position. The UI is still not great, but I think
this tweak will improve it until someone on design can help.

   Before: 

<img width="324" height="61"
alt="589131021-c967dfe1-9026-4a1d-a399-b735303f2de0"
src="https://github.com/user-attachments/assets/7cd414cd-5a13-4e16-ab6e-5de6d2cd64ed"
/>

   After:

<img width="373" height="77"
alt="589131282-607e15a5-e50c-4a8e-b22c-327f2e7b8ab5"
src="https://github.com/user-attachments/assets/7c19e0c8-8c50-4f8c-b966-f2a824eea4a0"
/>


- Disable Auto Watch when following another collaborator, with test
coverage for that behavior. We currently disable following when engaging
auto watch, and now we disable auto watch when following. They are
mutually exclusive and I think the feels correct.
- Refactored Auto Watch integration tests to use channels API instead of
room API.
- Improved test robustness by using assertions to identify
`SharedScreen` items by type and `peer_id` instead of tab title text.
- Fixed Auto Watch for returning channel participants by emitting
`RemoteVideoTracksChanged` when removing a participant with active video
tracks, with regression coverage for leave/rejoin/share.

Self-Review Checklist:

- [X] I've reviewed my own diff for quality, security, and reliability
- [ ] 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

Closes

Release Notes:

- N/A
```

## Parents

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

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