From d70a7188bfa01b3bfb5bbda92d89d20be58d164c Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Wed, 5 Mar 2025 14:40:30 +0100 Subject: [PATCH] feat(laravel-insights): Improve table responsiveness --- .../pages/backend/laravelOverviewPage.tsx | 74 +++++++++++-------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/static/app/views/insights/pages/backend/laravelOverviewPage.tsx b/static/app/views/insights/pages/backend/laravelOverviewPage.tsx index adac656464d98c..ca2b61606b79e5 100644 --- a/static/app/views/insights/pages/backend/laravelOverviewPage.tsx +++ b/static/app/views/insights/pages/backend/laravelOverviewPage.tsx @@ -1,5 +1,5 @@ import {Fragment, useCallback, useMemo} from 'react'; -import {useTheme} from '@emotion/react'; +import {css, useTheme} from '@emotion/react'; import styled from '@emotion/styled'; import type {Location} from 'history'; import pick from 'lodash/pick'; @@ -949,23 +949,8 @@ const getCellColor = (value: number, thresholds: Record) => { return Object.entries(thresholds).find(([_, threshold]) => value >= threshold)?.[0]; }; -const PathCell = styled('div')` - display: flex; - flex-direction: column; - padding: ${space(1)} ${space(2)}; - justify-content: center; - gap: ${space(0.5)}; - min-width: 200px; -`; - -const ControllerText = styled('div')` - color: ${p => p.theme.gray300}; - font-size: ${p => p.theme.fontSizeSmall}; - line-height: 1; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - min-width: 0px; +const StyledPanelTable = styled(PanelTable)` + grid-template-columns: max-content minmax(200px, 1fr) repeat(5, max-content); `; const Cell = styled('div')` @@ -992,6 +977,22 @@ const HeaderCell = styled(Cell)` padding: 0; `; +const PathCell = styled(Cell)` + flex-direction: column; + justify-content: center; + align-items: flex-start; + gap: ${space(0.5)}; + min-width: 0px; +`; + +const ControllerText = styled('div')` + ${p => p.theme.overflowEllipsis}; + color: ${p => p.theme.gray300}; + font-size: ${p => p.theme.fontSizeSmall}; + line-height: 1; + min-width: 0px; +`; + function RoutesTable({query}: {query?: string}) { const organization = useOrganization(); const pageFilterChartParams = usePageFilterChartParams(); @@ -1087,7 +1088,7 @@ function RoutesTable({query}: {query?: string}) { }, [transactionsRequest.data, routeControllersRequest.data]); return ( - {transaction.method} - - {transaction.transaction} - + + {transaction.transaction} + + {routeControllersRequest.isLoading ? ( ) : ( @@ -1136,6 +1149,7 @@ function RoutesTable({query}: {query?: string}) { position="top" maxWidth={400} showOnlyOnOverflow + skipWrapper > {transaction.controller} @@ -1157,6 +1171,6 @@ function RoutesTable({query}: {query?: string}) { ); })} - + ); }