fix(app): keep session options button active while sharing

Avoid a one-frame active-state flicker when transitioning from the options dropdown to the share popover by treating the pending-share state as active until the popover opens.
This commit is contained in:
David Hill 2026-03-11 15:45:06 +00:00
commit d2747d70d6

View file

@ -744,7 +744,11 @@ export function MessageTimeline(props: {
icon="dot-grid" icon="dot-grid"
variant="ghost" variant="ghost"
class="size-6 rounded-md data-[expanded]:bg-surface-base-active" class="size-6 rounded-md data-[expanded]:bg-surface-base-active"
classList={{
"bg-surface-base-active": share.open || title.pendingShare,
}}
aria-label={language.t("common.moreOptions")} aria-label={language.t("common.moreOptions")}
aria-expanded={title.menuOpen || share.open || title.pendingShare}
ref={(el: HTMLButtonElement) => { ref={(el: HTMLButtonElement) => {
more = el more = el
}} }}
@ -761,8 +765,10 @@ export function MessageTimeline(props: {
} }
if (title.pendingShare) { if (title.pendingShare) {
event.preventDefault() event.preventDefault()
setTitle("pendingShare", false) requestAnimationFrame(() => {
requestAnimationFrame(() => setShare({ open: true, dismiss: null })) setShare({ open: true, dismiss: null })
setTitle("pendingShare", false)
})
} }
}} }}
> >