Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect My Computer: Move icon to the top bar #31751

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

gzdunek
Copy link
Contributor

@gzdunek gzdunek commented Sep 12, 2023

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:

  • the context would have to keep much more state (for all workspaces),
  • it would be less convenient to use, for example, now can call killAgent(); after the changes it would become killAgent(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).

Previously, the icon was being unmounted when the status was changing to ''. It was making the animation to be start from the beginning multiple times, which did not look good.
@gzdunek gzdunek force-pushed the gzdunek/move-cmc-icon-to-top branch from b93b3d9 to 81d5e9a Compare September 12, 2023 12:55
@avatus
Copy link
Contributor

avatus commented Sep 12, 2023

I think it looks really cool up in the top bar

@gzdunek gzdunek added this pull request to the merge queue Sep 13, 2023
Merged via the queue into master with commit 8ecbd4b Sep 13, 2023
@gzdunek gzdunek deleted the gzdunek/move-cmc-icon-to-top branch September 13, 2023 07:16
@public-teleport-github-review-bot

@gzdunek See the table below for backport results.

Branch Result
branch/v14 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants