From 5cb2811b45190eef1fee2cebdb067c727da75a71 Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Fri, 13 Nov 2026 18:53:42 +0000 Subject: [PATCH] fix(native-chat): switch subagents from the switcher by pointer, and open no preview on handed-back focus The switcher's modal-less menu closed on pointerdown before the item could take the click; it is modal now. Focus handed back to a roster entry after a pointer Back no longer pops its hover preview; keyboard focus and hover still do. --- .../native-chat/subagents/NativeChatSubagentRun.tsx | 13 ++++++++++++- .../subagents/NativeChatSubagentViewBar.tsx | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/native-chat/subagents/NativeChatSubagentRun.tsx b/src/renderer/src/components/native-chat/subagents/NativeChatSubagentRun.tsx index 82c00d72321..ada9f47a1d9 100644 --- a/src/renderer/src/components/native-chat/subagents/NativeChatSubagentRun.tsx +++ b/src/renderer/src/components/native-chat/subagents/NativeChatSubagentRun.tsx @@ -152,6 +152,17 @@ export function NativeChatSubagentEntries({ ) } +/** A hidden row opens no preview; nor does focus handed back after a click, only keyboard focus or a hover. */ +function previewAllowed(trigger: HTMLElement | null): boolean { + return ( + trigger === null || + (!trigger.closest('[inert]') && + (!trigger.matches(':focus') || + trigger.matches(':focus-visible') || + trigger.matches(':hover'))) + ) +} + /** Hover preview: role, model, timing and the longer text the row truncates. */ function SubagentEntryPreview({ agent, @@ -182,7 +193,7 @@ function SubagentEntryPreview({ return ( setOpen(next && !triggerRef.current?.closest('[inert]'))} + onOpenChange={(next) => setOpen(next && previewAllowed(triggerRef.current))} openDelay={300} closeDelay={100} > diff --git a/src/renderer/src/components/native-chat/subagents/NativeChatSubagentViewBar.tsx b/src/renderer/src/components/native-chat/subagents/NativeChatSubagentViewBar.tsx index 5a04f8f756c..e267f5e6da3 100644 --- a/src/renderer/src/components/native-chat/subagents/NativeChatSubagentViewBar.tsx +++ b/src/renderer/src/components/native-chat/subagents/NativeChatSubagentViewBar.tsx @@ -88,7 +88,7 @@ export function NativeChatSubagentViewBar({ / - +