Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6d285e6
Add panel header component
gggritso Dec 20, 2024
55f66d1
Add body component
gggritso Dec 20, 2024
239b95d
Truncate the link
gggritso Dec 20, 2024
bac440b
Use new drawer in HTTP samples panel
gggritso Dec 20, 2024
3434676
Extract drawer hook
gggritso Dec 20, 2024
bd92a4c
Use new drawer in Caches
gggritso Dec 20, 2024
0798e8c
Use new Drawer in Queues
gggritso Dec 20, 2024
eb92e0d
Pass through a React node instead
gggritso Dec 20, 2024
4e474ad
Omit query when closing the drawer
gggritso Dec 20, 2024
f3b970f
Use new Drawer in Queries and Resources
gggritso Dec 20, 2024
0c48ed6
Custon `onClose`
gggritso Dec 23, 2024
232eea8
Revert "Custon `onClose`"
gggritso Dec 23, 2024
c3be758
Use drawer in Web Vitals
gggritso Dec 23, 2024
f5e8179
Give vitals drawer a more specific name
gggritso Dec 23, 2024
69908e0
Omit more span properties from URL on close
gggritso Dec 23, 2024
2d031f1
Use drawer in Mobile
gggritso Dec 23, 2024
ec734d8
Fold me into rename
gggritso Dec 23, 2024
a746b40
Project is optional for rendering the drawer header
gggritso Dec 23, 2024
532748d
Use heading for header
gggritso Dec 23, 2024
be1647b
Do not gate header behind project
gggritso Dec 23, 2024
27cf161
Fix data loading in cache panel
gggritso Dec 23, 2024
3082221
Add subtitle support to drawer header
gggritso Dec 23, 2024
37b8e15
Add subtitle to queue panels
gggritso Dec 23, 2024
a367042
Remove unneeded test
gggritso Dec 23, 2024
0c78723
Rename bad interface
gggritso Dec 23, 2024
34a1266
Remove unused prop
gggritso Dec 23, 2024
1befd8b
Fix bad truncations
gggritso Dec 23, 2024
8c01969
Fix analytics
gggritso Dec 23, 2024
882b1dc
Rename over-specified component
gggritso Jan 6, 2025
e0216fc
Add subtitle delimiter
gggritso Jan 6, 2025
678e702
Update specs
gggritso Jan 6, 2025
4318294
Avoid repeatedly re-opening the drawer
gggritso Jan 7, 2025
afd9d2f
Use a simpler URL hook rendering model
gggritso Jan 7, 2025
f6ea428
Omit more URL parameters on close
gggritso Jan 7, 2025
a7980f6
Improve layout
gggritso Jan 8, 2025
3656d53
Merge branch 'master' into feat/insights/new-slideout-panel-design-ii
gggritso Jan 10, 2025
f1dbc69
Unroll drawer change
gggritso Jan 10, 2025
0244618
Whoops wrong router
gggritso Jan 12, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {ModuleBodyUpsellHook} from 'sentry/views/insights/common/components/modu
import {ToolRibbon} from 'sentry/views/insights/common/components/ribbon';
import {useSpanMetrics} from 'sentry/views/insights/common/queries/useDiscover';
import {useModuleURL} from 'sentry/views/insights/common/utils/useModuleURL';
import {useSamplesDrawer} from 'sentry/views/insights/common/utils/useSamplesDrawer';
import SubregionSelector from 'sentry/views/insights/common/views/spans/selectors/subregionSelector';
import {SampleList} from 'sentry/views/insights/common/views/spanSummaryPage/sampleList';
import {FrontendHeader} from 'sentry/views/insights/pages/frontend/frontendPageHeader';
Expand All @@ -43,6 +44,20 @@ function ResourceSummary() {
const {groupId} = useParams();
const filters = useResourceModuleFilters();
const selectedSpanOp = filters[SPAN_OP];

useSamplesDrawer({
Component: (
<SampleList
groupId={groupId!}
moduleName={ModuleName.RESOURCE}
transactionRoute={webVitalsModuleURL}
referrer={TraceViewSources.ASSETS_MODULE}
/>
),
moduleName: ModuleName.RESOURCE,
requiredParams: ['transaction'],
});

const {data, isPending} = useSpanMetrics(
{
search: MutableSearch.fromQueryObject({
Expand Down Expand Up @@ -135,15 +150,6 @@ function ResourceSummary() {
<ModuleLayout.Full>
<ResourceSummaryTable />
</ModuleLayout.Full>

<ModuleLayout.Full>
<SampleList
groupId={groupId!}
moduleName={ModuleName.RESOURCE}
transactionRoute={webVitalsModuleURL}
referrer={TraceViewSources.ASSETS_MODULE}
/>
</ModuleLayout.Full>
</ModuleLayout.Layout>
</Layout.Main>
</Layout.Body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {useMemo} from 'react';
import styled from '@emotion/styled';

import type {LineChartSeries} from 'sentry/components/charts/lineChart';
import {DrawerHeader} from 'sentry/components/globalDrawer/components';
import type {
GridColumnHeader,
GridColumnOrder,
Expand Down Expand Up @@ -38,7 +39,7 @@ import type {
} from 'sentry/views/insights/browser/webVitals/types';
import decodeBrowserTypes from 'sentry/views/insights/browser/webVitals/utils/queryParameterDecoders/browserType';
import useProfileExists from 'sentry/views/insights/browser/webVitals/utils/useProfileExists';
import DetailPanel from 'sentry/views/insights/common/components/detailPanel';
import {SampleDrawerBody} from 'sentry/views/insights/common/components/sampleDrawerBody';
import {SpanIndexedField, type SubregionCode} from 'sentry/views/insights/types';
import {TraceViewSources} from 'sentry/views/performance/newTraceDetails/traceHeader/breadcrumbs';
import {generateReplayLink} from 'sentry/views/performance/transactionSummary/utils';
Expand Down Expand Up @@ -77,9 +78,7 @@ const inpSort: GridColumnSortBy<keyof InteractionSpanSampleRowWithScore> = {

export function PageOverviewWebVitalsDetailPanel({
webVital,
onClose,
}: {
onClose: () => void;
webVital: WebVitals | null;
}) {
const location = useLocation();
Expand Down Expand Up @@ -367,7 +366,9 @@ export function PageOverviewWebVitalsDetailPanel({

return (
<PageAlertProvider>
<DetailPanel detailKey={webVital ?? undefined} onClose={onClose}>
<DrawerHeader />

<SampleDrawerBody>
{webVital && (
<WebVitalDetailHeader
value={
Expand Down Expand Up @@ -410,7 +411,7 @@ export function PageOverviewWebVitalsDetailPanel({
)}
</TableContainer>
<PageAlert />
</DetailPanel>
</SampleDrawerBody>
</PageAlertProvider>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ const Value = styled('h2')`

const WebVitalName = styled('h4')`
margin-bottom: ${space(1)};
margin-top: 40px;
max-width: 400px;
${p => p.theme.overflowEllipsis}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('WebVitalsDetailPanel', function () {
});

it('renders correctly with empty results', async () => {
render(<WebVitalsDetailPanel onClose={() => undefined} webVital="lcp" />, {
render(<WebVitalsDetailPanel webVital="lcp" />, {
organization,
});
await waitForElementToBeRemoved(() => screen.queryByTestId('loading-indicator'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {useEffect, useMemo} from 'react';
import styled from '@emotion/styled';

import type {LineChartSeries} from 'sentry/components/charts/lineChart';
import {DrawerHeader} from 'sentry/components/globalDrawer/components';
import type {
GridColumnHeader,
GridColumnOrder,
Expand Down Expand Up @@ -34,7 +35,7 @@ import type {
WebVitals,
} from 'sentry/views/insights/browser/webVitals/types';
import decodeBrowserTypes from 'sentry/views/insights/browser/webVitals/utils/queryParameterDecoders/browserType';
import DetailPanel from 'sentry/views/insights/common/components/detailPanel';
import {SampleDrawerBody} from 'sentry/views/insights/common/components/sampleDrawerBody';
import {SpanIndexedField, type SubregionCode} from 'sentry/views/insights/types';

type Column = GridColumnHeader;
Expand All @@ -51,13 +52,7 @@ const sort: GridColumnSortBy<keyof Row> = {key: 'count()', order: 'desc'};

const MAX_ROWS = 10;

export function WebVitalsDetailPanel({
webVital,
onClose,
}: {
onClose: () => void;
webVital: WebVitals | null;
}) {
export function WebVitalsDetailPanel({webVital}: {webVital: WebVitals | null}) {
const location = useLocation();
const organization = useOrganization();
const browserTypes = decodeBrowserTypes(location.query[SpanIndexedField.BROWSER_NAME]);
Expand Down Expand Up @@ -133,8 +128,6 @@ export function WebVitalsDetailPanel({
seriesName: webVital ?? '',
};

const detailKey = webVital;

useEffect(() => {
if (webVital !== null) {
trackAnalytics('insight.vital.vital_sidebar_opened', {
Expand Down Expand Up @@ -243,7 +236,9 @@ export function WebVitalsDetailPanel({

return (
<PageAlertProvider>
<DetailPanel detailKey={detailKey ?? undefined} onClose={onClose}>
<DrawerHeader />

<SampleDrawerBody>
{webVital && (
<WebVitalDescription
value={
Expand Down Expand Up @@ -274,7 +269,7 @@ export function WebVitalsDetailPanel({
/>
</TableContainer>
<PageAlert />
</DetailPanel>
</SampleDrawerBody>
</PageAlertProvider>
);
}
Expand Down
32 changes: 21 additions & 11 deletions static/app/views/insights/browser/webVitals/views/pageOverview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {Fragment, useMemo, useState} from 'react';
import React, {Fragment, useEffect, useMemo, useState} from 'react';
import styled from '@emotion/styled';
import omit from 'lodash/omit';

Expand Down Expand Up @@ -32,6 +32,7 @@ import {ModulePageFilterBar} from 'sentry/views/insights/common/components/modul
import {ModulePageProviders} from 'sentry/views/insights/common/components/modulePageProviders';
import {ModuleBodyUpsellHook} from 'sentry/views/insights/common/components/moduleUpsellHookWrapper';
import {useModuleURL} from 'sentry/views/insights/common/utils/useModuleURL';
import {useWebVitalsDrawer} from 'sentry/views/insights/common/utils/useWebVitalsDrawer';
import {FrontendHeader} from 'sentry/views/insights/pages/frontend/frontendPageHeader';
import {useDomainViewFilters} from 'sentry/views/insights/pages/useFilters';
import {
Expand Down Expand Up @@ -106,6 +107,25 @@ export function PageOverview() {
const {data: projectScores, isPending: isProjectScoresLoading} =
useProjectWebVitalsScoresQuery({transaction, browserTypes, subregions});

const {openVitalsDrawer} = useWebVitalsDrawer({
Component: <PageOverviewWebVitalsDetailPanel webVital={state.webVital} />,
webVital: state.webVital,
onClose: () => {
router.replace({
pathname: router.location.pathname,
query: omit(router.location.query, 'webVital'),
});

setState({...state, webVital: null});
},
});

useEffect(() => {
if (state.webVital) {
openVitalsDrawer();
}
});

if (transaction === undefined) {
// redirect user to webvitals landing page
window.location.href = moduleURL;
Expand Down Expand Up @@ -239,16 +259,6 @@ export function PageOverview() {
</Layout.Body>
)}
</ModuleBodyUpsellHook>
<PageOverviewWebVitalsDetailPanel
webVital={state.webVital}
onClose={() => {
router.replace({
pathname: router.location.pathname,
query: omit(router.location.query, 'webVital'),
});
setState({...state, webVital: null});
}}
/>
</Tabs>
</React.Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {Fragment, useState} from 'react';
import React, {Fragment, useEffect, useState} from 'react';
import styled from '@emotion/styled';
import omit from 'lodash/omit';

import Alert from 'sentry/components/alert';
import {Button} from 'sentry/components/button';
Expand All @@ -11,7 +10,6 @@ import {t, tct} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import {decodeList} from 'sentry/utils/queryString';
import {useLocation} from 'sentry/utils/useLocation';
import useRouter from 'sentry/utils/useRouter';
import BrowserTypeSelector from 'sentry/views/insights/browser/webVitals/components/browserTypeSelector';
import {PerformanceScoreChart} from 'sentry/views/insights/browser/webVitals/components/charts/performanceScoreChart';
import {PagePerformanceTable} from 'sentry/views/insights/browser/webVitals/components/tables/pagePerformanceTable';
Expand All @@ -26,6 +24,7 @@ import {ModulePageFilterBar} from 'sentry/views/insights/common/components/modul
import {ModulePageProviders} from 'sentry/views/insights/common/components/modulePageProviders';
import {ModulesOnboarding} from 'sentry/views/insights/common/components/modulesOnboarding';
import {ModuleBodyUpsellHook} from 'sentry/views/insights/common/components/moduleUpsellHookWrapper';
import {useWebVitalsDrawer} from 'sentry/views/insights/common/utils/useWebVitalsDrawer';
import {FrontendHeader} from 'sentry/views/insights/pages/frontend/frontendPageHeader';
import {
ModuleName,
Expand All @@ -38,8 +37,6 @@ const WEB_VITALS_COUNT = 5;
export function WebVitalsLandingPage() {
const location = useLocation();

const router = useRouter();

const [state, setState] = useState<{webVital: WebVitals | null}>({
webVital: (location.query.webVital as WebVitals) ?? null,
});
Expand All @@ -61,6 +58,20 @@ export function WebVitalsLandingPage() {
? undefined
: getWebVitalScoresFromTableDataRow(projectScores?.data?.[0]);

const {openVitalsDrawer} = useWebVitalsDrawer({
Component: <WebVitalsDetailPanel webVital={state.webVital} />,
webVital: state.webVital,
onClose: () => {
setState({webVital: null});
},
});

useEffect(() => {
if (state.webVital) {
openVitalsDrawer();
}
});

return (
<React.Fragment>
<FrontendHeader module={ModuleName.VITAL} />
Expand Down Expand Up @@ -130,16 +141,6 @@ export function WebVitalsLandingPage() {
</Layout.Main>
</Layout.Body>
</ModuleBodyUpsellHook>
<WebVitalsDetailPanel
webVital={state.webVital}
onClose={() => {
router.replace({
pathname: router.location.pathname,
query: omit(router.location.query, 'webVital'),
});
setState({...state, webVital: null});
}}
/>
</React.Fragment>
);
}
Expand Down
Loading
Loading