mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 15:23:29 +00:00
fix(day): keep focus where the person moved it when the day's heading mounts late
Opening the conversations beside a docked day dropped focus to the page in most runs. A day opened on load asks for its heading to take focus; when the heading had not mounted yet the request waited, and it was honoured whenever the heading appeared, even after the person had moved on and opened the conversations. Focus jumped into the folding day and fell to the page as it went inert. A waiting request is now honoured only while focus is still where it was asked from, never inside an inert panel, and it ends with the day. The timeline range check measured the popover during its slide-in and read it up to 8 px too high; it now waits for the entry animation. The label-in-name fixes move their name composition into small helpers (score ring link, IP copy button, sortable header, period marker, the day's title focus), so every function ends at or below its old length and the size baselines only fall.
This commit is contained in:
1 parent
562ff8a277
commit
6d23cca4a3
8 files changed
+183
-96
No files matched your search
@@ -493,33 +493,14 @@ export function LoginOverviewSection() {
|
||||
</td>
|
||||
<td className="text-muted-foreground px-3 py-2 font-mono text-xs">
|
||||
{entry.ipAddress ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
<IpCopyButton
|
||||
ip={entry.ipAddress}
|
||||
copied={copiedIp === entry.id}
|
||||
label={t("admin.copyIp")}
|
||||
onCopy={() =>
|
||||
copyIp(entry.id, entry.ipAddress as string)
|
||||
}
|
||||
title={entry.ipAddress}
|
||||
data-slot="login-overview-ip"
|
||||
className="hover:text-foreground focus-visible:ring-ring inline-flex max-w-[10rem] items-center gap-1 rounded font-mono focus-visible:ring-2 focus-visible:outline-none"
|
||||
>
|
||||
<span className="sr-only">
|
||||
{t("admin.copyIp")}
|
||||
</span>
|
||||
<span className="truncate">
|
||||
{entry.ipAddress}
|
||||
</span>
|
||||
{copiedIp === entry.id ? (
|
||||
<Check
|
||||
className="text-success h-3 w-3 shrink-0"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
) : (
|
||||
<Copy
|
||||
className="h-3 w-3 shrink-0 opacity-60"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
)}
|
||||
</button>
|
||||
/>
|
||||
) : (
|
||||
"—"
|
||||
)}
|
||||
@@ -591,3 +572,38 @@ export function LoginOverviewSection() {
|
||||
</SettingsCard>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* One login row's IP address, a button that copies it. Named by the address
|
||||
* it shows with the action added for screen readers, so the accessible name
|
||||
* contains the visible text (WCAG 2.5.3).
|
||||
*/
|
||||
function IpCopyButton({
|
||||
ip,
|
||||
copied,
|
||||
label,
|
||||
onCopy,
|
||||
}: {
|
||||
ip: string;
|
||||
copied: boolean;
|
||||
label: string;
|
||||
onCopy: () => void;
|
||||
}) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onCopy}
|
||||
title={ip}
|
||||
data-slot="login-overview-ip"
|
||||
className="hover:text-foreground focus-visible:ring-ring inline-flex max-w-[10rem] items-center gap-1 rounded font-mono focus-visible:ring-2 focus-visible:outline-none"
|
||||
>
|
||||
<span className="sr-only">{label}</span>
|
||||
<span className="truncate">{ip}</span>
|
||||
{copied ? (
|
||||
<Check className="text-success h-3 w-3 shrink-0" aria-hidden="true" />
|
||||
) : (
|
||||
<Copy className="h-3 w-3 shrink-0 opacity-60" aria-hidden="true" />
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user