From 77749ef81b7d3e8705a8af021bdaffdda2006dd8 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 28 Aug 2024 09:48:46 -0700 Subject: [PATCH] fix(issues): Collapse grouping info by default (#76612) --- .../components/events/groupingInfo/index.tsx | 1 + .../issueDetails/streamline/foldSection.tsx | 2 +- .../streamline/interimSection.tsx | 51 ++++++++++--------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/static/app/components/events/groupingInfo/index.tsx b/static/app/components/events/groupingInfo/index.tsx index 2c526350211b0..da6501858214d 100644 --- a/static/app/components/events/groupingInfo/index.tsx +++ b/static/app/components/events/groupingInfo/index.tsx @@ -162,6 +162,7 @@ export function EventGroupingInfo({ ) } type={SectionKey.GROUPING_INFO} + initialCollapse > {!openState ? : null} {openState ? ( diff --git a/static/app/views/issueDetails/streamline/foldSection.tsx b/static/app/views/issueDetails/streamline/foldSection.tsx index fdd46408253e5..f9a32f7029159 100644 --- a/static/app/views/issueDetails/streamline/foldSection.tsx +++ b/static/app/views/issueDetails/streamline/foldSection.tsx @@ -22,7 +22,7 @@ export function getFoldSectionKey(key: SectionKey) { return `'issue-details-fold-section-collapse:${key}`; } -interface FoldSectionProps { +export interface FoldSectionProps { children: React.ReactNode; sectionKey: SectionKey; /** diff --git a/static/app/views/issueDetails/streamline/interimSection.tsx b/static/app/views/issueDetails/streamline/interimSection.tsx index babc3be5c13f3..03f7fe57a7eae 100644 --- a/static/app/views/issueDetails/streamline/interimSection.tsx +++ b/static/app/views/issueDetails/streamline/interimSection.tsx @@ -5,7 +5,10 @@ import { type EventDataSectionProps, } from 'sentry/components/events/eventDataSection'; import type {SectionKey} from 'sentry/views/issueDetails/streamline/context'; -import {FoldSection} from 'sentry/views/issueDetails/streamline/foldSection'; +import { + FoldSection, + type FoldSectionProps, +} from 'sentry/views/issueDetails/streamline/foldSection'; import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils'; /** @@ -13,26 +16,28 @@ import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils'; * for issue details is being developed. Once GA'd, all occurances should be replaced * with just */ -export const InterimSection = forwardRef( - function InterimSection( - {children, title, type, actions = null, ...props}: EventDataSectionProps, - ref - ) { - const hasStreamlinedUI = useHasStreamlinedUI(); +export const InterimSection = forwardRef< + HTMLElement, + EventDataSectionProps & Pick +>(function InterimSection( + {children, title, type, actions = null, initialCollapse, ...props}, + ref +) { + const hasStreamlinedUI = useHasStreamlinedUI(); - return hasStreamlinedUI ? ( - - {children} - - ) : ( - - {children} - - ); - } -); + return hasStreamlinedUI ? ( + + {children} + + ) : ( + + {children} + + ); +});