Connect My Computer: Move icon to the top bar #31751
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contributes to #27881
A decision was made to move the icon from the cluster view to the top bar to make the feature more visible to the users.
Why do we need React portal for this?
Because the icon needs
ConnectMyComputerContext
which is not available at the top bar level.ConnectMyComputerContext
was designed to be used at the workspace level (so we have a separate context for each workspace).We could refactor the
ConnectMyComputerContext
to be used at the app level, but that would have some downsides:killAgent()
; after the changes it would becomekillAgent(rootClusterUri)
.The way we have chosen is to inject the icon from the workspace level into the top bar.
I also increased the min window width because of the space for an additional icon (btw we should do it even earlier to at least ~440px, because you can see a horizontal scrollbar and the top bar goes outside the window).