mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
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.
This commit is contained in:
1 parent
e42ce1bd56
commit
fbdc14b408
6 files changed
+39
-16
No files matched your search
@@ -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(
|
||||
<MemoryRouter>
|
||||
<ScheduleReportsBell />
|
||||
</MemoryRouter>,
|
||||
)
|
||||
|
||||
expect(await screen.findByText('All caught up')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
@@ -130,6 +130,8 @@ export function ScheduleReportsBell() {
|
||||
markAllViewed.mutate()
|
||||
}
|
||||
|
||||
if (total === 0 && !open) return null
|
||||
|
||||
const trigger = (
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
@@ -170,9 +170,9 @@ export function ProjectActionsMenu({ repoId, directory }: ProjectActionsMenuProp
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
aria-label="Project actions"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||
className="h-10 w-10 text-muted-foreground hover:text-foreground sm:h-8 sm:w-8"
|
||||
>
|
||||
<Play className="h-4 w-4" />
|
||||
<Play className="h-5 w-5 sm:h-4 sm:w-4" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" className="w-56">
|
||||
|
||||
@@ -40,7 +40,7 @@ function HeaderTitle({ children, logo, className }: HeaderTitleProps) {
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<div className={cn("flex items-center gap-2", className)}>
|
||||
<div className={cn("flex min-w-0 items-center gap-2", className)}>
|
||||
{logo && typeof children === "string" && children === "OpenCode" ? (
|
||||
<img
|
||||
src={theme === 'light' ? "/opencode-wordmark-light.svg" : "/opencode-wordmark-dark.svg"}
|
||||
|
||||
@@ -44,7 +44,7 @@ export function PendingActionBadge({
|
||||
size="icon"
|
||||
onClick={onClick}
|
||||
className={cn(
|
||||
'relative h-8 w-8 transition-all duration-200',
|
||||
'relative h-10 w-10 transition-all duration-200 sm:h-8 sm:w-8',
|
||||
styles.bg,
|
||||
styles.hover,
|
||||
styles.text,
|
||||
@@ -52,7 +52,7 @@ export function PendingActionBadge({
|
||||
)}
|
||||
title={`${count} pending ${label}${count > 1 ? 's' : ''}`}
|
||||
>
|
||||
<Icon className="w-4 h-4" />
|
||||
<Icon className="w-5 h-5 sm:w-4 sm:h-4" />
|
||||
<span
|
||||
className={cn(
|
||||
'absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full animate-pulse',
|
||||
|
||||
Reference in new issue
Block a user