diff --git a/frontend/src/components/notifications/ScheduleReportsBell.test.tsx b/frontend/src/components/notifications/ScheduleReportsBell.test.tsx index b6b3705e..fdf7cb3d 100644 --- a/frontend/src/components/notifications/ScheduleReportsBell.test.tsx +++ b/frontend/src/components/notifications/ScheduleReportsBell.test.tsx @@ -53,12 +53,25 @@ describe('ScheduleReportsBell', () => { expect(screen.getByTestId('schedule-reports-count')).toHaveClass('bg-destructive') }) - it('shows the all-caught-up empty state when there are no unread runs', async () => { - const user = userEvent.setup() + it('renders nothing when there are no unread runs', () => { mocks.useUnreadScheduleRuns.mockReturnValue({ data: { runs: [], total: 0, failed: 0 } }) renderBell() - await user.click(screen.getByRole('button', { name: 'Reports, 0 unread' })) + expect(screen.queryByRole('button', { name: /Reports/ })).not.toBeInTheDocument() + }) + + it('stays open with the all-caught-up state after the last unread run is cleared', async () => { + const user = userEvent.setup() + mocks.useUnreadScheduleRuns.mockReturnValue({ data: { runs: [], total: 1, failed: 0 } }) + const { rerender } = renderBell() + + await user.click(screen.getByRole('button', { name: 'Reports, 1 unread' })) + mocks.useUnreadScheduleRuns.mockReturnValue({ data: { runs: [], total: 0, failed: 0 } }) + rerender( + + + , + ) expect(await screen.findByText('All caught up')).toBeInTheDocument() }) diff --git a/frontend/src/components/notifications/ScheduleReportsBell.tsx b/frontend/src/components/notifications/ScheduleReportsBell.tsx index ac864181..576aad79 100644 --- a/frontend/src/components/notifications/ScheduleReportsBell.tsx +++ b/frontend/src/components/notifications/ScheduleReportsBell.tsx @@ -130,6 +130,8 @@ export function ScheduleReportsBell() { markAllViewed.mutate() } + if (total === 0 && !open) return null + const trigger = ( diff --git a/frontend/src/components/ui/header.tsx b/frontend/src/components/ui/header.tsx index 9e465e81..eb93795f 100644 --- a/frontend/src/components/ui/header.tsx +++ b/frontend/src/components/ui/header.tsx @@ -40,7 +40,7 @@ function HeaderTitle({ children, logo, className }: HeaderTitleProps) { const theme = useTheme(); return ( -
+
{logo && typeof children === "string" && children === "OpenCode" ? ( 1 ? 's' : ''}`} > - +
- -
+
+ {repoName} {isWorktree ? ( @@ -225,20 +225,28 @@ export function RepoDetail() { ) : null}
- -
+ +
+