From fbdc14b4085de41f1bea6a215d341ef0ab0b6e47 Mon Sep 17 00:00:00 2001 From: Chris Scott <> Date: Thu, 8 Oct 2026 03:03:29 +0000 Subject: [PATCH] fix(mobile): tighten repo header actions and hide empty reports inbox Group the back button with the title so the repo name truncates instead of colliding with actions, unify the mobile header buttons to 40px ghost icons, collapse the reports inbox when nothing is unread, and let Header.Title truncate on every page. --- .../ScheduleReportsBell.test.tsx | 19 ++++++++++++--- .../notifications/ScheduleReportsBell.tsx | 2 ++ .../components/repo/ProjectActionsMenu.tsx | 4 ++-- frontend/src/components/ui/header.tsx | 2 +- .../components/ui/pending-action-badge.tsx | 4 ++-- frontend/src/pages/RepoDetail.tsx | 24 ++++++++++++------- 6 files changed, 39 insertions(+), 16 deletions(-) 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}
- -
+ +
+