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

fix: Prevent overflow issues in pro instance selection #1405

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 36 additions & 15 deletions desktop/src/contexts/DevPodContext/Pro/ContextSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
Portal,
Text,
VStack,
Tooltip,
} from "@chakra-ui/react"
import { ManagementV1Project } from "@loft-enterprise/client/gen/models/managementV1Project"
import { ReactNode, useMemo } from "react"
Expand Down Expand Up @@ -86,7 +87,7 @@ export function ContextSwitcher({
</Button>
</PopoverTrigger>
<Portal>
<PopoverContent>
<PopoverContent minWidth={"25rem"}>
<PopoverBody p="0">
<List>
{proInstances.map(({ host, authenticated, image }) => (
Expand Down Expand Up @@ -188,30 +189,50 @@ function PlatformDetails({
borderBottomWidth: "thin",
}
: {})}>
<HStack w="full" justify="space-between">
<HStack
w="full"
overflow="hidden"
textOverflow="ellipsis"
whiteSpace="nowrap"
justify="space-between">
{image ? (
typeof image === "string" ? (
<Image src={image} />
) : (
image
)
) : (
<Text
maxW="50%"
fontWeight="semibold"
fontSize="sm"
overflow="hidden"
textOverflow="ellipsis">
{host}
</Text>
<Tooltip maxW={"25rem"} label={host} openDelay={0} closeDelay={0}>
<Text
maxW="50%"
fontWeight="semibold"
fontSize="sm"
overflow="hidden"
textOverflow="ellipsis">
{host}
</Text>
</Tooltip>
)}
<HStack>
<HStack maxW="50%">
{authenticated != null && (
<Box boxSize="2" bg={authenticated ? "green.400" : "orange.400"} rounded="full" />
<Box
flexShrink="0"
boxSize="2"
bg={authenticated ? "green.400" : "orange.400"}
rounded="full"
/>
)}
<Text fontSize="xs" fontWeight="normal">
{host}
</Text>
<Tooltip maxW={"25rem"} label={host} openDelay={0} closeDelay={0}>
<Text
overflow="hidden"
textOverflow="ellipsis"
whiteSpace="nowrap"
marginTop="1px"
fontSize="xs"
fontWeight="normal">
{host}
</Text>
</Tooltip>
{host !== HOST_OSS && (
<Menu>
<MenuButton
Expand Down
Loading