diff --git a/src/renderer/src/components/tab-bar/TabBarCreateEntry.tsx b/src/renderer/src/components/tab-bar/TabBarCreateEntry.tsx index a2665ef1786..3a43294bb46 100644 --- a/src/renderer/src/components/tab-bar/TabBarCreateEntry.tsx +++ b/src/renderer/src/components/tab-bar/TabBarCreateEntry.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useMemo, useRef, useState } from 'react' import { Input } from '@/components/ui/input' +import { cn } from '@/lib/class-names' import { useRuntimeFileListForWorktree } from '../quick-open-file-list' import { createTabEntryAllowAbsolutePathsSelector, @@ -275,9 +276,15 @@ function TabBarCreateEntrySession({ }) } + const hasStatusRows = Boolean( + error || switchError || selectionGuidance || (activeOptions.length > 0 && statusOption) + ) + const hasResultRows = !error && (activeOptions.length > 0 || hasQuery) + const hasBodyRows = hasStatusRows || hasResultRows + return (
{ event.preventDefault() submitOption() @@ -316,7 +323,7 @@ function TabBarCreateEntrySession({ }} onPointerDown={(event) => event.stopPropagation()} > -
+
{/* Keep a mounted live region above usable rows so stale-target failures announce without removing other choices. */} -
+
{error ? ( -
+
) : null} - {switchError ? ( -
- -
- ) : null} - {selectionGuidance ? ( -
- -
- ) : null} + {switchError ? : null} + {selectionGuidance ? : null} {activeOptions.length > 0 && statusOption ? ( -
- -
+ ) : null}
- {!error && (activeOptions.length > 0 || hasQuery) ? ( + {hasResultRows ? (
0 ? 'listbox' : undefined} > diff --git a/src/renderer/src/components/tab-bar/tab-bar-surface.tsx b/src/renderer/src/components/tab-bar/tab-bar-surface.tsx index f7f899c8dda..549394f5847 100644 --- a/src/renderer/src/components/tab-bar/tab-bar-surface.tsx +++ b/src/renderer/src/components/tab-bar/tab-bar-surface.tsx @@ -262,7 +262,7 @@ export function renderTabBarSurface( onSelectMenuOption={handleSelectCreateMenuOption} onDidOpenEntry={() => setNewTabMenuOpen(false)} /> - {showStaticCreateMenuItems ? : null} + {showStaticCreateMenuItems ? : null} ) : null} {showStaticCreateMenuItems ? (