Skip to content

fix(site): delay desktop VNC connection until tab is selected - #23861

Merged
DanielleMaywood merged 1 commit into
mainfrom
delay-desktop-tab-open
Mar 31, 2026
Merged

DanielleMaywood merged 1 commit into
mainfrom
delay-desktop-tab-open

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Collaborator

🤖 This PR was written by Coder Agent on behalf of Danielle Maywood 🤖

The desktop panel previously established a VNC WebSocket connection as soon as the sidebar mounted, even if the user never clicked the Desktop tab. This wasted bandwidth and server resources.

Adopts the same activated pattern from the terminal panel (PR #23231): the connection stays dormant until the tab is first selected, then persists across tab switches.

Changes

  • useDesktopConnection — activated option gates doConnect()
  • DesktopPanel — isVisible prop with activated state latch
  • SidebarTabView — passes isVisible based on effectiveTabId

@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Mar 31, 2026
@DanielleMaywood
DanielleMaywood force-pushed the delay-desktop-tab-open branch from ee9c3dd to 2fd9f2a Compare March 31, 2026 16:01
@DanielleMaywood
DanielleMaywood marked this pull request as ready for review March 31, 2026 16:02
@DanielleMaywood DanielleMaywood removed the community Pull Requests and issues created by the community. label Mar 31, 2026

@hugodutka hugodutka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The desktop panel previously established a VNC WebSocket connection as soon as the sidebar mounted, even if the user never clicked the Desktop tab.

was that a regression after the recent refactors or did I implement it like that originally? I thought the connection already got opened only after the user clicked the desktop tab

@DanielleMaywood

Copy link
Copy Markdown
Collaborator Author

@hugodutka a regression from me. I recently changed it so that tabbing away didn't destroy state (useful when mid-way through adding a diff comment). Unfortunately I forgot to handle this scenario

The desktop panel previously established a VNC WebSocket connection as
soon as the sidebar mounted, even if the user never clicked the Desktop
tab. This wasted bandwidth and server resources.

Adopt the same 'activated' pattern from the terminal panel (PR #23231):
the connection stays dormant until the tab is first selected, then
persists across tab switches.

Changes:
- useDesktopConnection: add 'activated' option to gate doConnect()
- DesktopPanel: add isVisible prop with activated state latch
- SidebarTabView: pass isVisible based on effectiveTabId
@DanielleMaywood
DanielleMaywood force-pushed the delay-desktop-tab-open branch from 2fd9f2a to 26d00ab Compare March 31, 2026 16:09
@DanielleMaywood
DanielleMaywood merged commit e8fb418 into main Mar 31, 2026
25 of 27 checks passed
@DanielleMaywood
DanielleMaywood deleted the delay-desktop-tab-open branch March 31, 2026 17:42
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants