mirror of
https://github.com/hoornet/vega.git
synced 2026-05-11 22:51:18 -07:00
Fix lightbox Escape navigating away, sidebar profile hidden at large font
This commit is contained in:
@@ -12,7 +12,10 @@ export function ImageLightbox({ images, index, onClose, onNavigate }: ImageLight
|
|||||||
const hasNext = index < images.length - 1;
|
const hasNext = index < images.length - 1;
|
||||||
|
|
||||||
const handleKeyDown = useCallback((e: KeyboardEvent) => {
|
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 === "ArrowLeft" && hasPrev) onNavigate(index - 1);
|
||||||
if (e.key === "ArrowRight" && hasNext) onNavigate(index + 1);
|
if (e.key === "ArrowRight" && hasNext) onNavigate(index + 1);
|
||||||
}, [onClose, onNavigate, index, hasPrev, hasNext]);
|
}, [onClose, onNavigate, index, hasPrev, hasNext]);
|
||||||
|
|||||||
@@ -120,8 +120,12 @@ export function Sidebar() {
|
|||||||
})}
|
})}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{/* Account switcher (full) — expanded only */}
|
{/* Account switcher (full) — expanded only, always visible at bottom */}
|
||||||
{!c && <AccountSwitcher />}
|
{!c && (
|
||||||
|
<div className="shrink-0">
|
||||||
|
<AccountSwitcher />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export async function notifyMention(authorName: string, preview: string): Promis
|
|||||||
if (!(await ensurePermission())) return;
|
if (!(await ensurePermission())) return;
|
||||||
sendNotification({
|
sendNotification({
|
||||||
title: `${authorName} mentioned you`,
|
title: `${authorName} mentioned you`,
|
||||||
body: preview.slice(0, 120),
|
body: preview.slice(0, 120) || "New mention",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user