From 9a09e464b5cae24e3f03667516348372880ee2ee Mon Sep 17 00:00:00 2001 From: Jure <44338+hoornet@users.noreply.github.com> Date: Tue, 24 Mar 2026 15:14:12 +0100 Subject: [PATCH] Fix lightbox Escape navigating away, sidebar profile hidden at large font --- src/components/shared/ImageLightbox.tsx | 5 ++++- src/components/sidebar/Sidebar.tsx | 8 ++++++-- src/lib/notifications.ts | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/shared/ImageLightbox.tsx b/src/components/shared/ImageLightbox.tsx index 9c7589d..cc072e8 100644 --- a/src/components/shared/ImageLightbox.tsx +++ b/src/components/shared/ImageLightbox.tsx @@ -12,7 +12,10 @@ export function ImageLightbox({ images, index, onClose, onNavigate }: ImageLight const hasNext = index < images.length - 1; const handleKeyDown = useCallback((e: KeyboardEvent) => { - if (e.key === "Escape") onClose(); + if (e.key === "Escape") { + e.stopImmediatePropagation(); + onClose(); + } if (e.key === "ArrowLeft" && hasPrev) onNavigate(index - 1); if (e.key === "ArrowRight" && hasNext) onNavigate(index + 1); }, [onClose, onNavigate, index, hasPrev, hasNext]); diff --git a/src/components/sidebar/Sidebar.tsx b/src/components/sidebar/Sidebar.tsx index 680abbb..bc7216f 100644 --- a/src/components/sidebar/Sidebar.tsx +++ b/src/components/sidebar/Sidebar.tsx @@ -120,8 +120,12 @@ export function Sidebar() { })} - {/* Account switcher (full) — expanded only */} - {!c && } + {/* Account switcher (full) — expanded only, always visible at bottom */} + {!c && ( +
+ +
+ )} ); diff --git a/src/lib/notifications.ts b/src/lib/notifications.ts index 36b6149..d81a23b 100644 --- a/src/lib/notifications.ts +++ b/src/lib/notifications.ts @@ -43,7 +43,7 @@ export async function notifyMention(authorName: string, preview: string): Promis if (!(await ensurePermission())) return; sendNotification({ title: `${authorName} mentioned you`, - body: preview.slice(0, 120), + body: preview.slice(0, 120) || "New mention", }); }