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.
title-bar-cleanup
David Hill 2026-03-11 15:45:06 +00:00
parent 5ca2dc87b7
commit d2747d70d6
1 changed files with 8 additions and 2 deletions

View File

@ -744,7 +744,11 @@ export function MessageTimeline(props: {
icon="dot-grid"
variant="ghost"
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-expanded={title.menuOpen || share.open || title.pendingShare}
ref={(el: HTMLButtonElement) => {
more = el
}}
@ -761,8 +765,10 @@ export function MessageTimeline(props: {
}
if (title.pendingShare) {
event.preventDefault()
setTitle("pendingShare", false)
requestAnimationFrame(() => setShare({ open: true, dismiss: null }))
requestAnimationFrame(() => {
setShare({ open: true, dismiss: null })
setTitle("pendingShare", false)
})
}
}}
>