Skip to content

collab_ui: Fix "lost session" visual bug in Collab Panel#52486

Merged
danilo-leal merged 3 commits intozed-industries:mainfrom
ruxwez:clarify-collab-panel
Mar 26, 2026
Merged

collab_ui: Fix "lost session" visual bug in Collab Panel#52486
danilo-leal merged 3 commits intozed-industries:mainfrom
ruxwez:clarify-collab-panel

Conversation

@ruxwez
Copy link
Copy Markdown
Contributor

@ruxwez ruxwez commented Mar 26, 2026

Context

This PR fixes a UX issue ("visual bug") in the collaboration panel documented in issue #51800, where users who had already signed in were still seeing the "Sign In" screen after restarting the editor. As I mentioned in my response there (Link to comment #4132366441), I have investigated the problem thoroughly and found that the session is not actually lost.

What I discovered is that in Zed, only "staff" users automatically connect to the collaboration servers when opening the editor (by design, this logic is in crates/client/src/client.rs starting at line 962). Therefore, regular users keep their saved session and Authenticated status, but since they don't automatically connect upon startup, the UI didn't detect this correctly. It erroneously showed the GitHub account request and the "Sign in to enable collaboration" text, giving the false impression that the user had been logged out.

Screenshots

Before (Bug)
image

After (Fix)
image

Note: This PR specifically addresses the visual issue in the Collab Panel. Similar behaviors might exist in other parts of the editor, but this change focuses on correcting the collaboration interface.

This current PR:

  1. Improves the render_signed_out function in crates/collab_ui/src/collab_panel.rs.
  2. Simplifies the connection check using self.client.user_id().is_some(), which is more robust against volatile network states and perfectly covers connection transitions.
  3. During rendering, it detects existing credentials and shows the correct message "Connect" / "Connecting...", replacing the GitHub icon with the appropriate network icon (SignalHigh).

How to Review

  • Review the cleaner and simplified code in crates/collab_ui/src/collab_panel.rs:render_signed_out.
  • Verify that instead of verbose validations on the Status enum, simply checking the user ID correctly captures any subsequent subtype, properly differentiating between account authorization and a simple network reconnection.

Self-Review Checklist

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Fixed an issue (Zed does not stay signed in. #51800) in the Collab Panel where the UI appeared to log users out. Implemented improvements to properly differentiate between "Sign In" and "Connect," avoiding false authentication prompts when users are already logged in but not automatically connected to the servers.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 26, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, kubkon and reflectronic and removed request for a team March 26, 2026 11:09
Copy link
Copy Markdown
Member

@danilo-leal danilo-leal 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, good catch!

@zed-industries-bot
Copy link
Copy Markdown
Contributor

Messages
📖

This PR includes links to the following GitHub Issues: #51800
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against 1d8cfd1

@danilo-leal danilo-leal merged commit 15d8660 into zed-industries:main Mar 26, 2026
31 checks passed
@ruxwez ruxwez deleted the clarify-collab-panel branch March 26, 2026 12:42
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.

4 participants