From 80d27c57c0b4a97229f0cb4057bb2ea3c7ebeb9e Mon Sep 17 00:00:00 2001 From: Shubhdeep Chhabra Date: Fri, 1 Dec 2023 20:35:34 +0530 Subject: [PATCH] fix(breadcrumbs): breadcrumbs ui improvement and minor bug fix (#194) * some UI improvement * bug fix - if statement for checking empty screen in breadcrumbs was missing a condition --------- Co-authored-by: Lukas Stracke --- .../sentry/components/EventBreadcrumbs.tsx | 27 ++++++++++++------- packages/overlay/tailwind.config.ts | 3 +++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/packages/overlay/src/integrations/sentry/components/EventBreadcrumbs.tsx b/packages/overlay/src/integrations/sentry/components/EventBreadcrumbs.tsx index 3048edb9..dccfbd1b 100644 --- a/packages/overlay/src/integrations/sentry/components/EventBreadcrumbs.tsx +++ b/packages/overlay/src/integrations/sentry/components/EventBreadcrumbs.tsx @@ -1,3 +1,5 @@ +import { Fragment } from 'react'; +import classNames from '~/lib/classNames'; import { Breadcrumb, SentryEvent } from '../types'; import Time from './Time'; @@ -21,9 +23,9 @@ function extractBreadcrumbs(event: SentryEvent): Breadcrumb[] | undefined { export default function EventBreadcrumbs({ event }: { event: SentryEvent }) { const breadcrumbs = extractBreadcrumbs(event); - if (!breadcrumbs) { + if (!breadcrumbs || !breadcrumbs.length) { return ( -
+
No breadcrumbs available for this event. Try adding some to make debugging easier.
@@ -32,19 +34,26 @@ export default function EventBreadcrumbs({ event }: { event: SentryEvent }) { ); } return ( -
+
{breadcrumbs.map((crumb, crumbIdx) => { if (!crumb.message) return null; return ( -
-
-
+ +
+
{crumb.category || ' '}
+
-
{crumb.category || ' '}
-
{crumb.message}
-
+
+              {crumb.message}
+            
+ ); })}
diff --git a/packages/overlay/tailwind.config.ts b/packages/overlay/tailwind.config.ts index bb90ae80..26940c1f 100644 --- a/packages/overlay/tailwind.config.ts +++ b/packages/overlay/tailwind.config.ts @@ -14,6 +14,9 @@ export default { colors: { primary: colors.indigo, }, + gridTemplateColumns: { + '2-auto': 'minmax(auto, max-content) 1fr', + }, }, }, } satisfies Config;