Browse Source

fix(traces): Click on trace id should not expand traces row (#81040)

When cmd clicking on the trace id, it should not toggle the expanded
state of the trace row as that is jarring behaviour opening a link in a
new tab and the current tab changes slightly.
Tony Xiao 3 months ago
parent
commit
3fa796c498

+ 1 - 1
static/app/views/explore/tables/tracesTable/fieldRenderers.tsx

@@ -433,7 +433,7 @@ interface TraceIdRendererProps {
   location: Location;
   timestamp: number; // in milliseconds
   traceId: string;
-  onClick?: () => void;
+  onClick?: React.ComponentProps<typeof Link>['onClick'];
   transactionId?: string;
 }
 

+ 4 - 3
static/app/views/explore/tables/tracesTable/index.tsx

@@ -244,12 +244,13 @@ function TraceRow({
         <TraceIdRenderer
           traceId={trace.trace}
           timestamp={trace.end}
-          onClick={() =>
+          onClick={event => {
+            event.stopPropagation();
             trackAnalytics('trace_explorer.open_trace', {
               organization,
               source: 'new explore',
-            })
-          }
+            });
+          }}
           location={location}
         />
       </StyledPanelItem>

+ 1 - 1
static/app/views/traces/fieldRenderers.tsx

@@ -444,7 +444,7 @@ interface TraceIdRendererProps {
   location: Location;
   timestamp: number; // in milliseconds
   traceId: string;
-  onClick?: () => void;
+  onClick?: React.ComponentProps<typeof Link>['onClick'];
   transactionId?: string;
 }
 

+ 4 - 3
static/app/views/traces/tracesTable.tsx

@@ -202,12 +202,13 @@ function TraceRow({defaultExpanded, trace}: {defaultExpanded; trace: TraceResult
         <TraceIdRenderer
           traceId={trace.trace}
           timestamp={trace.end}
-          onClick={() =>
+          onClick={event => {
+            event.stopPropagation();
             trackAnalytics('trace_explorer.open_trace', {
               organization,
               source: 'trace explorer',
-            })
-          }
+            });
+          }}
           location={location}
         />
       </StyledPanelItem>