Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default function SecurityAgentFilterFindingsRoute() {
<View className="flex-1 bg-background">
<EmptyState
icon={Info}
className="flex-1"
title={t('securityAgent.filter.noFilters')}
description={t('securityAgent.filter.noFiltersDescription')}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ describe('AuditReportScreen states', () => {
expect(empty).toHaveLength(1);
expect(empty[0]?.props.title).toBe('Audit report unavailable');
expect(findByType(root.root, 'QueryError')).toHaveLength(0);
expect(empty[0]?.props.className ?? '').not.toMatch(/\bflex-1\b/);
});

it('treats a personal UNAUTHORIZED as a retryable session error', () => {
Expand All @@ -259,6 +260,10 @@ describe('AuditReportScreen states', () => {
expect(findByType(root.root, 'EmptyState')).toHaveLength(0);
});

// Explorer audit-report-empty: see the Yoga note in audit-report-screen.tsx.
// A `flex-1` child (flexBasis 0%) collapses to zero height inside
// CenteredState's auto-height wrapper, which blanks the title/description, so
// the centered states must reach EmptyState with no flex basis.
it('renders EmptyState for an empty period', () => {
setQueryState({
data: {
Expand All @@ -273,6 +278,7 @@ describe('AuditReportScreen states', () => {
expect(empty[0]?.props.title).toBe('No recorded activity');
expect(empty[0]?.props.placement).not.toBe('top');
expect(findByType(root.root, 'TabScreenScrollView')).toHaveLength(0);
expect(empty[0]?.props.className ?? '').not.toMatch(/\bflex-1\b/);
});

it('retains a cached report with an inline retry after a transient failure', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,14 @@ function AuditReportView({
const end = formatDate(parseTimestamp(report.period.displayEnd), i18n.language, {
timeZone: 'UTC',
});
// No `flex-1` here: CenteredState centers its child by measuring the
// child's intrinsic height, and a `flex-1` (flexBasis 0%) child inside its
// auto-height wrapper collapses to zero, which zeroes the height Yoga lets
// the title and description measure into. The screenshot then shows the
// icon bubble with no readable copy (explorer audit-report-empty).
return (
<EmptyState
icon={FileText}
className="flex-1"
title={t('securityAgent.auditReport.noActivity')}
description={t('securityAgent.auditReport.noActivityDescription', { start, end })}
/>
Expand Down Expand Up @@ -215,7 +219,6 @@ export function AuditReportScreen({ scope }: Readonly<{ scope: string }>) {
{forbidden && (
<EmptyState
icon={ShieldOff}
className="flex-1"
title={t('securityAgent.auditReport.unavailable')}
description={t('securityAgent.auditReport.unavailableDescription')}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export function DismissFindingScreen({ scope, findingId }: Readonly<DismissFindi
<ScreenHeader title={t('securityAgent.dismiss.title')} modal />
<EmptyState
icon={ShieldOff}
className="flex-1"
title={t('securityAgent.dismiss.notFoundTitle')}
description={t('securityAgent.dismiss.notFoundDescription')}
/>
Expand All @@ -161,7 +160,6 @@ export function DismissFindingScreen({ scope, findingId }: Readonly<DismissFindi
<View className="flex-1 bg-background">
<ScreenHeader title={t('securityAgent.dismiss.title')} modal />
<QueryError
className="flex-1"
message={t('securityAgent.dismiss.couldNotLoad')}
onRetry={() => void findingQuery.refetch()}
/>
Expand All @@ -174,7 +172,6 @@ export function DismissFindingScreen({ scope, findingId }: Readonly<DismissFindi
<View className="flex-1 bg-background">
<ScreenHeader title={t('securityAgent.dismiss.title')} modal />
<QueryError
className="flex-1"
message={t('securityAgent.dismiss.couldNotCheckPermissions')}
onRetry={() => void capability.refetch()}
/>
Expand All @@ -199,7 +196,6 @@ export function DismissFindingScreen({ scope, findingId }: Readonly<DismissFindi
<ScreenHeader title={t('securityAgent.dismiss.title')} modal />
<EmptyState
icon={ShieldOff}
className="flex-1"
title={t('securityAgent.dismiss.cannotDismissTitle')}
description={t('securityAgent.dismiss.cannotDismissDescription')}
/>
Expand All @@ -213,7 +209,6 @@ export function DismissFindingScreen({ scope, findingId }: Readonly<DismissFindi
<ScreenHeader title={t('securityAgent.dismiss.title')} modal />
<EmptyState
icon={ShieldOff}
className="flex-1"
title={t('securityAgent.dismiss.cannotDismissTitle')}
description={t('securityAgent.dismiss.alreadyResolvedDescription')}
/>
Expand Down
Loading