Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion static/app/utils/issueTypeConfig/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const BASE_CONFIG: IssueTypeConfig = {
},
defaultTimePeriod: {sinceFirstSeen: true},
header: {
filterBar: {enabled: true, fixedEnvironment: false},
filterBar: {enabled: true, fixedEnvironment: false, searchBar: {enabled: true}},
graph: {enabled: true, type: 'discover-events'},
tagDistribution: {enabled: true},
occurrenceSummary: {enabled: false},
Expand Down
2 changes: 1 addition & 1 deletion static/app/utils/issueTypeConfig/metricConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const metricConfig: IssueCategoryConfigMapping = {
ctaText: t('View monitor details'),
},
header: {
filterBar: {enabled: true, fixedEnvironment: true},
filterBar: {enabled: true, fixedEnvironment: true, searchBar: {enabled: false}},
graph: {enabled: true, type: 'detector-history'},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: false},
Expand Down
2 changes: 2 additions & 0 deletions static/app/utils/issueTypeConfig/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export type IssueTypeConfig = {
filterBar: DisabledWithReasonConfig & {
// Display the environment filter in an inactive, locked state
fixedEnvironment?: boolean;
// The search bar can be hidden if the issue type does not support event filtering
searchBar?: DisabledWithReasonConfig;
};
graph: DisabledWithReasonConfig & {
type?: 'detector-history' | 'discover-events' | 'cron-checks' | 'uptime-checks';
Expand Down
35 changes: 19 additions & 16 deletions static/app/views/issueDetails/streamline/eventDetailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export function EventDetailsHeader({group, event, project}: EventDetailsHeaderPr
}

const FilterBar = theme.isChonk ? PageFilterBar : StyledPageFilterBar;
const searchBarEnabled = issueTypeConfig.header.filterBar.searchBar?.enabled !== false;

return (
<PageErrorBoundary mini message={t('There was an error loading the event filters')}>
Expand Down Expand Up @@ -171,22 +172,24 @@ export function EventDetailsHeader({group, event, project}: EventDetailsHeaderPr
}}
/>
</FilterBar>
<EventSearch
group={group}
handleSearch={query => {
navigate(
{...location, query: {...location.query, query}},
{replace: true}
);
}}
environments={environments}
query={searchQuery}
queryBuilderProps={{
disallowFreeText: true,
placeholder: searchText,
label: searchText,
}}
/>
{searchBarEnabled && (
<EventSearch
group={group}
handleSearch={query => {
navigate(
{...location, query: {...location.query, query}},
{replace: true}
);
}}
environments={environments}
query={searchQuery}
queryBuilderProps={{
disallowFreeText: true,
placeholder: searchText,
label: searchText,
}}
/>
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Visual gaps in grid when search is disabled.

When searchBarEnabled is false, the Grid has only one child (FilterBar) but still uses a 3-column template columns="auto minmax(100px, 1fr) auto". This causes the second column (minmax(100px, 1fr)) to render as empty space, creating unwanted visual gaps. The grid columns need to be adjusted dynamically based on whether the search bar is visible.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected

</Grid>
<ToggleSidebar />
</Flex>
Expand Down
Loading