Skip to content

Commit 5ccf2e0

Browse files
committed
fix: show active filters in empty state instead of clearing on page switch
Reverts automatic filter clearing on page switch so filters stay sticky. When filters cause zero results, the empty state now shows which filters are active and provides a 'Clear all filters' button.
1 parent bfa66c1 commit 5ccf2e0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/ReportPageLayout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,15 @@ export function ReportPageLayout({ schema, allowedReportTypes, metricOptions }:
570570
No matching usage rows
571571
</Heading>
572572
<Text as="p" className={styles.surfaceDescription}>
573-
Try a different search term or clear the current period filter.
573+
{Object.keys(filters).length > 0
574+
? `Active filters (${Object.entries(filters).map(([k, v]) => `${k}: ${v.join(', ')}`).join('; ')}) may not apply to this report.`
575+
: 'Try a different search term or clear the current period filter.'}
574576
</Text>
577+
{Object.keys(filters).length > 0 && (
578+
<Button variant="default" size="small" onClick={clearAllToolbarFilters} sx={{ mt: 2 }}>
579+
Clear all filters
580+
</Button>
581+
)}
575582
</div>
576583
)}
577584

0 commit comments

Comments
 (0)