From cb254c6e31274343e9acbfe647e5be9a832a6830 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 12 Jan 2026 17:46:39 +0200 Subject: [PATCH] Fix mobile menu not closing when clicking See all notifications The LinkButton component wasn't passing onClick to internal Link components, only to external anchor tags. This prevented the onClose callback from firing when navigating via the notifications footer link. Co-Authored-By: Claude Opus 4.5 --- ...--show-all-notifications-link-doesnt-close-menu-on-m.md | 5 +++-- app/components/MobileNav.tsx | 1 + app/components/elements/Button.tsx | 1 + app/components/layout/NotificationPopover.tsx | 7 +++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.beans/sendou.ink-ja9h--show-all-notifications-link-doesnt-close-menu-on-m.md b/.beans/sendou.ink-ja9h--show-all-notifications-link-doesnt-close-menu-on-m.md index e97bbf6a3..dfb45aeae 100644 --- a/.beans/sendou.ink-ja9h--show-all-notifications-link-doesnt-close-menu-on-m.md +++ b/.beans/sendou.ink-ja9h--show-all-notifications-link-doesnt-close-menu-on-m.md @@ -1,10 +1,11 @@ --- # sendou.ink-ja9h title: Show all notifications link doesn't close menu on mobile -status: todo +status: completed type: bug +priority: normal created_at: 2026-01-11T19:22:01Z -updated_at: 2026-01-11T19:22:01Z +updated_at: 2026-01-12T15:32:45Z parent: sendou.ink-6eko --- diff --git a/app/components/MobileNav.tsx b/app/components/MobileNav.tsx index 2594fe7ac..9d1729da0 100644 --- a/app/components/MobileNav.tsx +++ b/app/components/MobileNav.tsx @@ -495,6 +495,7 @@ function YouPanel({ onClose }: { onClose: () => void }) { ) : null} diff --git a/app/components/elements/Button.tsx b/app/components/elements/Button.tsx index dd677e841..56fbdb9a1 100644 --- a/app/components/elements/Button.tsx +++ b/app/components/elements/Button.tsx @@ -108,6 +108,7 @@ export function LinkButton({ data-testid={testId} prefetch={prefetch} preventScrollReset={preventScrollReset} + onClick={onClick} > {icon && React.cloneElement(icon, { diff --git a/app/components/layout/NotificationPopover.tsx b/app/components/layout/NotificationPopover.tsx index 58042d12c..d1bc1fa84 100644 --- a/app/components/layout/NotificationPopover.tsx +++ b/app/components/layout/NotificationPopover.tsx @@ -39,9 +39,11 @@ export function useNotifications() { export function NotificationContent({ notifications, unseenIds, + onClose, }: { notifications: LoaderNotification[]; unseenIds: number[]; + onClose?: () => void; }) { const { t } = useTranslation(["common"]); const { revalidate, state } = useRevalidator(); @@ -81,13 +83,13 @@ export function NotificationContent({ )} {notifications.length === NOTIFICATIONS.PEEK_COUNT ? ( - + ) : null} ); } -function NotificationsFooter() { +function NotificationsFooter({ onClose }: { onClose?: () => void }) { const { t } = useTranslation(["common"]); return ( @@ -99,6 +101,7 @@ function NotificationsFooter() { to={NOTIFICATIONS_URL} className="mt-1-5" testId="notifications-see-all-button" + onClick={onClose} > {t("common:notifications.seeAll")}