From e8fa04404f470a7cc7d89e82058d2c07fad74837 Mon Sep 17 00:00:00 2001 From: Jake Howell Date: Mon, 9 Feb 2026 23:20:44 +1100 Subject: [PATCH] fix: remove `@mui/` components from `` (#22003) Migrates `ConnectionLogRow` and `ConnectionLogDescription` off MUI and Emotion. Replaces `@mui/material/Link` with the existing shadcn-based `Link` component, swaps the deprecated `Stack` wrappers for plain divs with Tailwind flex utilities, and converts all Emotion `css` prop styles to Tailwind classes. Also fixes a pre-existing lint issue where `tabIndex` was set on a non-interactive div. --- .../ConnectionLogDescription.tsx | 20 ++- .../ConnectionLogRow/ConnectionLogRow.tsx | 127 +++++------------- 2 files changed, 44 insertions(+), 103 deletions(-) diff --git a/site/src/pages/ConnectionLogPage/ConnectionLogRow/ConnectionLogDescription/ConnectionLogDescription.tsx b/site/src/pages/ConnectionLogPage/ConnectionLogRow/ConnectionLogDescription/ConnectionLogDescription.tsx index fba3a9c20c..a559a845ee 100644 --- a/site/src/pages/ConnectionLogPage/ConnectionLogRow/ConnectionLogDescription/ConnectionLogDescription.tsx +++ b/site/src/pages/ConnectionLogPage/ConnectionLogRow/ConnectionLogDescription/ConnectionLogDescription.tsx @@ -1,5 +1,5 @@ -import Link from "@mui/material/Link"; import type { ConnectionLog } from "api/typesGenerated"; +import { Link } from "components/Link/Link"; import type { FC, ReactNode } from "react"; import { Link as RouterLink } from "react-router"; import { connectionTypeToFriendlyName } from "utils/connection"; @@ -62,11 +62,10 @@ export const ConnectionLogDescription: FC = ({ {user ? user.username : "Unauthenticated user"} {actionText} in{" "} {isOwnWorkspace ? "their" : `${workspace_owner_username}'s`}{" "} - - {workspace_name} + + + {workspace_name} + {" "} workspace @@ -81,11 +80,10 @@ export const ConnectionLogDescription: FC = ({ return ( {friendlyType} session to {workspace_owner_username}'s{" "} - - {workspace_name} + + + {workspace_name} + {" "} workspace{" "} diff --git a/site/src/pages/ConnectionLogPage/ConnectionLogRow/ConnectionLogRow.tsx b/site/src/pages/ConnectionLogPage/ConnectionLogRow/ConnectionLogRow.tsx index 3ad86c1917..98b810318a 100644 --- a/site/src/pages/ConnectionLogPage/ConnectionLogRow/ConnectionLogRow.tsx +++ b/site/src/pages/ConnectionLogPage/ConnectionLogRow/ConnectionLogRow.tsx @@ -1,8 +1,6 @@ -import type { CSSObject, Interpolation, Theme } from "@emotion/react"; -import Link from "@mui/material/Link"; import type { ConnectionLog } from "api/typesGenerated"; import { Avatar } from "components/Avatar/Avatar"; -import { Stack } from "components/Stack/Stack"; +import { Link } from "components/Link/Link"; import { StatusPill } from "components/StatusPill/StatusPill"; import { TableCell } from "components/Table/Table"; import { TimelineEntry } from "components/Timeline/TimelineEntry"; @@ -38,18 +36,9 @@ export const ConnectionLogRow: FC = ({ data-testid={`connection-log-row-${connectionLog.id}`} clickable={false} > - - - + +
+
{/* Non-web logs don't have an associated user, so we * display a default network icon instead */} {connectionLog.web_info?.user ? ( @@ -63,27 +52,17 @@ export const ConnectionLogRow: FC = ({ )} - - +
+
- + {new Date(connectionLog.connect_time).toLocaleTimeString()} {connectionLog.ssh_info?.disconnect_time && ` → ${new Date(connectionLog.ssh_info.disconnect_time).toLocaleTimeString()}`} - +
- +
{code !== undefined && ( = ({ )} - ({ - color: theme.palette.info.light, - })} - /> + -
+
{connectionLog.ip && (
-

IP:

+

+ IP: +

{connectionLog.ip}
)} {userAgent?.os.name && (
-

OS:

+

+ OS: +

{userAgent.os.name}
)} {userAgent?.browser.name && (
-

Browser:

+

+ Browser: +

{userAgent.browser.name} {userAgent.browser.version}
@@ -123,21 +104,26 @@ export const ConnectionLogRow: FC = ({ )} {connectionLog.organization && (
-

+

Organization:

- {connectionLog.organization.display_name || - connectionLog.organization.name} + + {connectionLog.organization.display_name || + connectionLog.organization.name} +
)} {connectionLog.ssh_info?.disconnect_reason && (
-

+

Close Reason:

{connectionLog.ssh_info?.disconnect_reason}
@@ -146,54 +132,11 @@ export const ConnectionLogRow: FC = ({
- - - - +
+
+
+
); }; - -const styles = { - connectionLogCell: { - padding: "0 !important", - border: 0, - }, - - connectionLogHeader: { - padding: "16px 32px", - }, - - connectionLogHeaderInfo: { - flex: 1, - }, - - connectionLogSummary: (theme) => ({ - ...(theme.typography.body1 as CSSObject), - fontFamily: "inherit", - }), - - connectionLogTime: (theme) => ({ - color: theme.palette.text.secondary, - fontSize: 12, - }), - - connectionLogInfoheader: (theme) => ({ - margin: 0, - color: theme.palette.text.primary, - fontSize: 14, - lineHeight: "150%", - fontWeight: 600, - }), - - connectionLogInfoTooltip: { - display: "flex", - flexDirection: "column", - gap: 8, - }, - - fullWidth: { - width: "100%", - }, -} satisfies Record>;