Skip to content

Commit

Permalink
fix(issues): Collapse grouping info by default (#76612)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Aug 28, 2024
1 parent c26c6ef commit 77749ef
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
1 change: 1 addition & 0 deletions static/app/components/events/groupingInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export function EventGroupingInfo({
)
}
type={SectionKey.GROUPING_INFO}
initialCollapse
>
{!openState ? <GroupInfoSummary groupInfo={groupInfo} /> : null}
{openState ? (
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/issueDetails/streamline/foldSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down
51 changes: 28 additions & 23 deletions static/app/views/issueDetails/streamline/interimSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,39 @@ 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';

/**
* This section is meant to provide a shared component while the streamline UI
* for issue details is being developed. Once GA'd, all occurances should be replaced
* with just <FoldSection />
*/
export const InterimSection = forwardRef<HTMLElement, EventDataSectionProps>(
function InterimSection(
{children, title, type, actions = null, ...props}: EventDataSectionProps,
ref
) {
const hasStreamlinedUI = useHasStreamlinedUI();
export const InterimSection = forwardRef<
HTMLElement,
EventDataSectionProps & Pick<FoldSectionProps, 'initialCollapse'>
>(function InterimSection(
{children, title, type, actions = null, initialCollapse, ...props},
ref
) {
const hasStreamlinedUI = useHasStreamlinedUI();

return hasStreamlinedUI ? (
<FoldSection
sectionKey={type as SectionKey}
title={title}
actions={actions}
ref={ref}
>
{children}
</FoldSection>
) : (
<EventDataSection title={title} actions={actions} type={type} {...props}>
{children}
</EventDataSection>
);
}
);
return hasStreamlinedUI ? (
<FoldSection
sectionKey={type as SectionKey}
title={title}
actions={actions}
ref={ref}
initialCollapse={initialCollapse}
>
{children}
</FoldSection>
) : (
<EventDataSection title={title} actions={actions} type={type} {...props}>
{children}
</EventDataSection>
);
});

0 comments on commit 77749ef

Please sign in to comment.