fix: hover card maiden name false positive, editor placeholder on non-empty content, mention persistence #375

Merged
marcel merged 12 commits from fix/hover-card-placeholder-maiden-name into main 2026-04-29 21:33:18 +02:00
Showing only changes of commit 3c7c7a9aa4 - Show all commits

View File

@@ -97,9 +97,11 @@ function currentViewport() {
};
}
let closeTimer: ReturnType<typeof setTimeout> | null = null;
let closeTimer = $state<ReturnType<typeof setTimeout> | null>(null);
function scheduleCardClose() {
// 150ms: long enough for pointer movement from mention to card, short enough
// to feel responsive. Matches the Radix/shadcn hover card delay.
closeTimer = setTimeout(() => {
activeCard = null;
closeTimer = null;
@@ -152,7 +154,7 @@ async function handleMentionEnter(event: Event) {
}
}
function handleMentionLeave(event: Event) {
function scheduleMentionLeave(event: Event) {
const link = event.target as HTMLAnchorElement;
link.removeAttribute('aria-describedby');
scheduleCardClose();
@@ -195,7 +197,7 @@ function attachMentionHandlers(node: HTMLElement) {
}
function onLeave(e: Event) {
const t = e.target as HTMLElement;
if (t.matches?.(PERSON_MENTION_SELECTOR)) handleMentionLeave(e);
if (t.matches?.(PERSON_MENTION_SELECTOR)) scheduleMentionLeave(e);
}
function onClick(e: MouseEvent) {
const t = e.target as HTMLElement;