Skip to content

Add VNet info tab#53531

Merged
ravicious merged 7 commits intomasterfrom
r7s/vnet-info-tab
Apr 1, 2025
Merged

Add VNet info tab#53531
ravicious merged 7 commits intomasterfrom
r7s/vnet-info-tab

Conversation

@ravicious
Copy link
Member

@ravicious ravicious commented Mar 28, 2025

Part of #52788

Figma

This PR adds just the tab. The next PR is going to integrate it with the VNet deep link and first launch of VNet through the Connect button next to a TCP app.

vnet-info-tab

@ravicious ravicious added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v17 labels Mar 28, 2025

/** Returns color of the top bar of DemoTerminal. */
export const topBarColor = (theme: DefaultTheme): string =>
emphasize(theme.colors.levels.deep, 0.2);
Copy link
Member Author

Choose a reason for hiding this comment

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

This will be used in a later commit to stack two DemoTerminals on top of each other without creating a visible gap between them (since a DemoTerminal has border radius).

connected: true,
leaf: false,
proxyHost: 'teleport-local:3080',
proxyHost: 'teleport-local.com:3080',
Copy link
Member Author

Choose a reason for hiding this comment

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

This is purely so that stories reflect the reality more closely. I doubt that the majority of people have a cluster set up as a TLD.

large: 1280,
700: 700,
900: 900,
1200: 1200,
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll mention this on Slack, but I talked with Rishi and the design team doesn't really use any preset breakpoints – they might differ page to page. However, styled-system requires breakpoints to be defined ahead of time (I think Chakra requires that as well).

So instead of binding them to specific names, I just used numeric values.

Copy link
Member Author

Choose a reason for hiding this comment

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

At first I made diagrams for the section with web apps with SSO. However, Zac and I agreed that they don't really help at all. To keep the layout of the page intact, the design team recommended to replace the diagrams with a generic image. But what should this image be?

For now, I just lifted this app access image from Teleport Labs.

Comment on lines +195 to +205
<Box
// Enough width so that the background repeats just twice at full page width.
width="66%"
height="100%"
css={`
background: url(${appAccessPng});
background-size: contain;
background-repeat: space no-repeat;
background-position: center;
`}
/>
Copy link
Member Author

@ravicious ravicious Mar 28, 2025

Choose a reason for hiding this comment

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

The generic image for this section cannot be allowed to keep its aspect ratio according to available width, as then it's way bigger than the text part of this section which looks weird.

However, if we constrain the height of the image to the height of the text part (by using it as a background image rather than a regular <image>), then on wider sizes it looks too small.

To work around this, I just… made the browser repeat the image. 🤷 It looks alright acceptable for now and we can adjust it later.

Screenshots of alternatives

Aspect ratio is kept

kept-aspect-ratio

Adjusted to height of text

adjusted-to-height

'workspacesService',
useCallback(state => state.rootClusterUri, [])
);
const isUserInWorkspace = !!rootClusterUri;
Copy link
Member Author

Choose a reason for hiding this comment

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

Assigning this to a variable just so that the ternary in the return value is easier to read.

* Finds an existing doc using findExisting and opens it. If there's no existing doc, uses
* createNew to add a new doc and then opens it.
*/
openExistingOrAddNew(
Copy link
Member Author

Choose a reason for hiding this comment

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

Finally decided to create a method for that after years of writing this by hand. 😂

Copy link
Contributor

Choose a reason for hiding this comment

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

🔥

@ravicious ravicious marked this pull request as ready for review March 28, 2025 11:53
@ravicious ravicious requested a review from gzdunek March 28, 2025 11:53
@github-actions github-actions bot requested review from kimlisa and kiosion March 28, 2025 11:53
@ravicious ravicious removed the request for review from kiosion March 28, 2025 11:53
Copy link
Contributor

@gzdunek gzdunek left a comment

Choose a reason for hiding this comment

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

I don't have any comments, looks great!


<DemoTerminal
flex={demoFlex}
title={userAtHost}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is really a nice touch 👌

* Finds an existing doc using findExisting and opens it. If there's no existing doc, uses
* createNew to add a new doc and then opens it.
*/
openExistingOrAddNew(
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥

@zmb3
Copy link
Collaborator

zmb3 commented Mar 28, 2025

A little bit of empty space between the bottom two terminals would look better IMO.

<DemoTerminal title={userAtHost} text={proxyWithoutVnet} />
<DemoTerminal title={userAtHost} text={curlWithoutVnet} />
</Box>
<Stack flex={demoFlex} gap={2} fullWidth>
Copy link
Member Author

@ravicious ravicious Mar 31, 2025

Choose a reason for hiding this comment

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

Added some space between terminals. Had to add a bit more than I'd like because otherwise the shadows would clash in the light theme.

terminal-space

maxWidth="1400px"
width="100%"
mx="auto"
p={{ _: 6, 900: 9, 1200: 11 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

i've never seen this usage before. does _: 6 mean default breakpoint?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, _ means "no breakpoint". https://github.com/styled-system/styled-system/blob/v5.1.5/docs/responsive-styles.md#using-objects

Breakpoints in Chakra work in a similar way. https://www.chakra-ui.com/docs/theming/customization/breakpoints

I think we haven't used it before because we've been on styled-system 3.1 for so long and this was added only in 4.0. styled-system <4.0 had a much worse solution for breakpoints, so it's no wonder we weren't using it.

Copy link
Contributor

Choose a reason for hiding this comment

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

that is so neat

@ravicious
Copy link
Member Author

Merging this now and taking responsibility for fixing any mess related to the new breakpoints once we decide with the design team what to do about them.

@ravicious ravicious added this pull request to the merge queue Apr 1, 2025
Merged via the queue into master with commit c33a85b Apr 1, 2025
39 checks passed
@ravicious ravicious deleted the r7s/vnet-info-tab branch April 1, 2025 09:06
@backport-bot-workflows
Copy link
Contributor

@ravicious See the table below for backport results.

Branch Result
branch/v17 Create PR

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

Labels

backport/branch/v17 no-changelog Indicates that a PR does not require a changelog entry size/lg ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments