fix(app): prevent stale session tab reads (#39767)

This commit is contained in:
OpeOginni 2026-07-31 07:14:09 +02:00 committed by GitHub
commit db4dbaa289
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 10 deletions

View file

@ -289,9 +289,9 @@ export function SessionHeader() {
return ( return (
<> <>
<Show when={search() && centerMount()}> <Show when={search() && centerMount()} keyed>
{(mount) => ( {(mount) => (
<Portal mount={mount()}> <Portal mount={mount}>
<Button <Button
type="button" type="button"
variant="ghost" variant="ghost"
@ -308,10 +308,10 @@ export function SessionHeader() {
</span> </span>
</div> </div>
<Show when={hotkey()}> <Show when={hotkey()} keyed>
{(keybind) => ( {(keybind) => (
<Keybind class="shrink-0 !border-0 !bg-transparent !shadow-none px-0 text-text-weaker"> <Keybind class="shrink-0 !border-0 !bg-transparent !shadow-none px-0 text-text-weaker">
{keybind()} {keybind}
</Keybind> </Keybind>
)} )}
</Show> </Show>
@ -319,9 +319,9 @@ export function SessionHeader() {
</Portal> </Portal>
)} )}
</Show> </Show>
<Show when={rightMount()}> <Show when={rightMount()} keyed>
{(mount) => ( {(mount) => (
<Portal mount={mount()}> <Portal mount={mount}>
<Show <Show
when={isV2} when={isV2}
fallback={ fallback={

View file

@ -224,6 +224,7 @@ export function TabNavItem(props: {
<span data-slot="project-avatar-slot" class="flex size-4 shrink-0 items-center justify-center"> <span data-slot="project-avatar-slot" class="flex size-4 shrink-0 items-center justify-center">
<Show <Show
when={props.session()} when={props.session()}
keyed
fallback={ fallback={
<span class="block size-4 rounded-[3px] border border-v2-border-border-muted" aria-hidden="true" /> <span class="block size-4 rounded-[3px] border border-v2-border-border-muted" aria-hidden="true" />
} }
@ -231,8 +232,8 @@ export function TabNavItem(props: {
{(session) => ( {(session) => (
<SessionTabAvatar <SessionTabAvatar
project={project()} project={project()}
directory={session().directory} directory={session.directory}
sessionId={session().id} sessionId={session.id}
server={props.server} server={props.server}
/> />
)} )}

View file

@ -78,9 +78,9 @@ export function NewSessionStatus(props: { mount: Accessor<HTMLElement | null>; v
const language = useLanguage() const language = useLanguage()
return ( return (
<Show when={props.mount()}> <Show when={props.mount()} keyed>
{(mount) => ( {(mount) => (
<Portal mount={mount()}> <Portal mount={mount}>
<Show when={props.visible()}> <Show when={props.visible()}>
<Tooltip placement="bottom" value={language.t("status.popover.trigger")}> <Tooltip placement="bottom" value={language.t("status.popover.trigger")}>
<StatusPopoverV2 /> <StatusPopoverV2 />