File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3275,7 +3275,7 @@ export default function ChatView(props: ChatViewProps) {
32753275 />
32763276 < div
32773277 { ...conversationArea }
3278- className = "relative flex min-h-0 flex-1 flex-col bg-background outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring "
3278+ className = "relative flex min-h-0 flex-1 flex-col bg-background"
32793279 >
32803280 < ThreadTimeline
32813281 threadDetailRef = { routeThreadDetailRef }
Original file line number Diff line number Diff line change @@ -1423,9 +1423,12 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
14231423 const handleProjectButtonClick = ( event : React . MouseEvent < HTMLButtonElement > ) => {
14241424 if ( suppressProjectClickForContextMenuRef . current ) {
14251425 suppressProjectClickForContextMenuRef . current = false ;
1426- event . preventDefault ( ) ;
1427- event . stopPropagation ( ) ;
1428- return ;
1426+ // A keyboard-made click (detail 0) never follows a context menu.
1427+ if ( event . detail !== 0 ) {
1428+ event . preventDefault ( ) ;
1429+ event . stopPropagation ( ) ;
1430+ return ;
1431+ }
14291432 }
14301433 if ( dragInProgressRef . current ) {
14311434 event . preventDefault ( ) ;
@@ -1652,8 +1655,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
16521655
16531656 const handleProjectButtonContextMenu = ( event : React . MouseEvent < HTMLButtonElement > ) => {
16541657 event . preventDefault ( ) ;
1655- // Keyboard menus dispatch an untrusted contextmenu with no click after it.
1656- suppressProjectClickForContextMenuRef . current = event . isTrusted ;
1658+ suppressProjectClickForContextMenuRef . current = true ;
16571659 void ( async ( ) => {
16581660 const api = readLocalApi ( ) ;
16591661 if ( ! api ) return ;
Original file line number Diff line number Diff line change @@ -2577,3 +2577,9 @@ code {
25772577 }
25782578 }
25792579}
2580+
2581+ /* A workspace area with no control of its own takes F6 focus itself; keep that visible. */
2582+ [data-workspace-area ]: focus-visible {
2583+ outline : 2px solid var ( --ring ) ;
2584+ outline-offset : -2px ;
2585+ }
Original file line number Diff line number Diff line change @@ -247,4 +247,14 @@ describe("workspace area focus", () => {
247247 header . append ( moved ) ;
248248 await vi . waitFor ( ( ) => expect ( document . activeElement ) . toBe ( moved ) ) ;
249249 } ) ;
250+
251+ it ( "keeps moving while a hover popup without focus is open" , ( ) => {
252+ using fixture = setup ( ) ;
253+ const composer = fixture . area ( "composer" , 2 ) ;
254+ const terminal = fixture . area ( "terminal" , 4 ) ;
255+ fixture . append ( '<div data-slot="popover-popup">New split terminal</div>' ) ;
256+ composer . button . focus ( ) ;
257+ expect ( fixture . controller . move ( 1 ) ) . toBe ( true ) ;
258+ expect ( document . activeElement ) . toBe ( terminal . button ) ;
259+ } ) ;
250260} ) ;
Original file line number Diff line number Diff line change @@ -209,16 +209,13 @@ export function createWorkspaceFocusController(doc: Document) {
209209 doc . querySelectorAll < HTMLElement > ( FOCUS_BOUNDARY_SELECTOR ) ,
210210 ) . filter ( ( boundary ) => boundary !== appModal ) ;
211211 if ( activePopup && ! activePopup . closest ( AREA_SELECTOR ) ) boundaries . push ( activePopup ) ;
212+ // A modal keeps focus wherever it is; any other popup only while it holds focus,
213+ // so hover popups and notifications never swallow the key.
212214 if (
213215 boundaries . some (
214216 ( boundary ) =>
215217 ! ( closingPalette && boundary . closest ( "[data-command-palette]" ) ) &&
216- // Base UI names notifications as non-modal dialogs, including anchored
217- // toast popups. Their presence must not block navigation elsewhere.
218- ! (
219- boundary . matches ( '[aria-modal="false"]:is([role="dialog"], [role="alertdialog"])' ) &&
220- boundary . closest ( '[data-slot^="toast-viewport"]' )
221- ) &&
218+ ( boundary . matches ( '[aria-modal="true"]' ) || boundary . contains ( doc . activeElement ) ) &&
222219 isWorkspaceElementVisible ( boundary ) ,
223220 )
224221 )
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ function SettingsContentLayout() {
120120 < AppRouteModal label = "Settings" >
121121 < div className = "relative flex min-h-0 flex-1" >
122122 < SettingsSidebarNav pathname = { location . pathname } />
123- < div { ...contentArea } className = "flex min-h-0 min-w-0 flex-1 flex-col outline-none " >
123+ < div { ...contentArea } className = "flex min-h-0 min-w-0 flex-1 flex-col" >
124124 < header className = "flex h-12 shrink-0 items-center gap-3 border-b ps-5 pe-2" >
125125 < SettingsBreadcrumb pathname = { location . pathname } />
126126 < div className = "ms-auto flex shrink-0 items-center gap-1" >
You can’t perform that action at this time.
0 commit comments