fix: keep the title in the phone notifications header

This commit is contained in:
Linus Rath
2026-11-03 05:33:24 +01:00
parent 8fa9a72d61
commit 091ef34a5e
@@ -63,13 +63,15 @@ export function NotificationPanel({ onClose, className, sheet = false }: { onClo
<div className="flex items-center gap-1 px-3 h-12 border-b border-border shrink-0">
{/* Full screen on a phone it is a dialog of its own, titled like one. */}
<h2 className={cn("flex-1 min-w-0 truncate font-semibold", sheet ? "text-lg" : "text-sm")}>{t("title")}</h2>
<Button variant="ghost" size="xs" onClick={markAllRead} disabled={unread === 0} className="gap-1 px-2 text-xs text-muted-foreground">
{/* On a phone the title keeps the room and the actions are icons: their
labels pushed the title out, and "Mark all as read" wrapped. */}
<Button variant="ghost" size="xs" onClick={markAllRead} disabled={unread === 0} className="gap-1 px-2 text-xs text-muted-foreground shrink-0" title={t("mark_all_read")}>
<CheckCheck className="w-4 h-4" />
<span>{t("mark_all_read")}</span>
<span className={cn(sheet && "max-sm:sr-only")}>{t("mark_all_read")}</span>
</Button>
<Button variant="ghost" size="xs" onClick={clear} disabled={entries.length === 0} className="gap-1 px-2 text-xs text-muted-foreground">
<Button variant="ghost" size="xs" onClick={clear} disabled={entries.length === 0} className="gap-1 px-2 text-xs text-muted-foreground shrink-0" title={t("clear")}>
<Trash2 className="w-4 h-4" />
<span>{t("clear")}</span>
<span className={cn(sheet && "max-sm:sr-only")}>{t("clear")}</span>
</Button>
{sheet && (
<IconButton size="icon-lg" label={t("close")} title="" onClick={onClose} className="text-muted-foreground">