Account menu: scroll on a short screen, and spell out "Stay signed in" #221

Merged
jcoffey-dev merged 1 commits from fix/216-account-menu-phone into main 2026-11-16 15:56:02 +00:00
2 changed files with 18 additions and 9 deletions

No files matched your search

+12 -6
View File
@@ -269,18 +269,24 @@ function AccountMenu() {
// #197: closing the installed app or the browser keeps the sign-in.
role="menuitemcheckbox"
aria-checked={stay}
title={t(
'staySignedIn.hint',
'Stay signed in when the app or browser closes. Leave this off on a shared computer.',
)}
className="items-start"
onSelect={(e) => {
e.preventDefault();
setStaySignedIn(!stay);
setStay(!stay);
}}
>
<Check className={cn('mr-2 h-4 w-4', !stay && 'invisible')} />
{t('staySignedIn.label', 'Stay signed in on this device')}
<Check className={cn('mr-2 mt-0.5 h-4 w-4 shrink-0', !stay && 'invisible')} />
{/* The explanation is written out, not a tooltip: a phone never shows a tooltip (#216). */}
<span className="flex flex-col">
{t('staySignedIn.label', 'Stay signed in on this device')}
<span className="text-xs text-muted-foreground">
{t(
'staySignedIn.hint',
'Stay signed in when the app or browser closes. Leave this off on a shared computer.',
)}
</span>
</span>
</DropdownMenuItem>
<DropdownMenuItem onClick={() => signOut(navigate)}>
<LogOut className="mr-2 h-4 w-4" />
+6 -3
View File
@@ -14,8 +14,11 @@ import { ChevronRight, Circle } from 'lucide-react';
import { cn } from '@/lib/utils';
// The panel and the item rows, shared by the menu and its submenus.
// inbuxa: never taller than the room Radix measured beside the trigger, and
// scrolling past that, or the last items of a long menu (the account menu's
// "Stay signed in" and Logout) are cut off on a phone held sideways (#216).
const panel = [
'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground',
'z-50 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground',
'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',
'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
];
@@ -40,7 +43,7 @@ function DropdownMenuContent({
<DropdownMenuPrimitive.Content
data-slot="dropdown-menu-content"
sideOffset={sideOffset}
className={cn(panel, 'shadow-md', className)}
className={cn(panel, 'max-h-[var(--radix-dropdown-menu-content-available-height)] shadow-md', className)}
{...props}
/>
</DropdownMenuPrimitive.Portal>
@@ -151,7 +154,7 @@ function DropdownMenuSubContent({
return (
<DropdownMenuPrimitive.SubContent
data-slot="dropdown-menu-sub-content"
className={cn(panel, 'shadow-lg', className)}
className={cn(panel, 'max-h-[var(--radix-dropdown-menu-content-available-height)] shadow-lg', className)}
{...props}
/>
);