@@ -5,12 +5,7 @@ import {
55} from "./navigation-tabs" ;
66import { useCallback , useLayoutEffect , useMemo , useRef , useState , type ReactNode } from "react" ;
77import { View , useWindowDimensions , type NativeSyntheticEvent } from "react-native" ;
8- import {
9- Tabs ,
10- type TabSelectedEvent ,
11- type TabSelectionPreventedEvent ,
12- type TabSelectionRejectedEvent ,
13- } from "react-native-screens" ;
8+ import { Tabs , type TabSelectedEvent , type TabSelectionRejectedEvent } from "react-native-screens" ;
149
1510import { WorkspaceTabsContext , useWorkspaceTabs } from "./WorkspaceTabsContext" ;
1611import {
@@ -31,7 +26,6 @@ import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
3126import { useSelectWorkspaceTab } from "./useSelectWorkspaceTab" ;
3227
3328const PULL_REQUEST_ICON = require ( "../../../assets/icons/pull-request.png" ) ;
34- const SEARCH_SLOT = "search" ;
3529
3630/** Retain each native controller tree; removing its root can leave RNS's stack empty. */
3731function RetainedWorkspaceTab ( props : {
@@ -99,17 +93,6 @@ export function WorkspaceNativeTabs(props: {
9993 const { colors } = useControlTheme ( ) ;
10094 const selectedTab = workspace . state . selectedTab ;
10195 const selectedSlot = workspace . settingsOpen ? - 1 : primaryTabs . indexOf ( selectedTab ) ;
102- // The folded Duo opens list search from a search tab UIKit sets apart below the others.
103- const searchTab = deviceType === "duo-folded" ;
104- // Searching is list state: the list's toolbar mounts its field and focuses it.
105- const openSearch = ( ) => {
106- const tab =
107- ! workspace . settingsOpen && workspaceUsesColumns ( selectedTab ) ? selectedTab : "threads" ;
108- // Back on the tab's list first: folded, a chat open on top would hide the field.
109- selectTab ( tab ) ;
110- workspace . dispatch ( { type : "scroll" , tab, offset : workspace . getScrollOffset ( tab ) } ) ;
111- workspace . dispatch ( { type : "search" , tab } ) ;
112- } ;
11396 const request = useMemo (
11497 ( ) => ( {
11598 selectedScreenKey :
@@ -133,19 +116,9 @@ export function WorkspaceNativeTabs(props: {
133116 } : NativeSyntheticEvent < TabSelectionRejectedEvent > ) =>
134117 setProvenance ( nativeEvent . provenance )
135118 }
136- onTabSelectionPrevented = { ( {
137- nativeEvent,
138- } : NativeSyntheticEvent < TabSelectionPreventedEvent > ) => {
139- if ( nativeEvent . preventedScreenKey === SEARCH_SLOT ) openSearch ( ) ;
140- } }
141119 onTabSelected = { ( { nativeEvent } : NativeSyntheticEvent < TabSelectedEvent > ) => {
142120 setProvenance ( nativeEvent . provenance ) ;
143121 if ( nativeEvent . actionOrigin === "programmatic-js" ) return ;
144- // UIKit reports reselecting a tab here even when its selection is prevented.
145- if ( nativeEvent . selectedScreenKey === SEARCH_SLOT ) {
146- openSearch ( ) ;
147- return ;
148- }
149122 const tab = workspaceTabForNativeSlot ( primaryTabs , nativeEvent . selectedScreenKey ) ;
150123 if ( tab ) selectTab ( tab ) ;
151124 } }
@@ -183,24 +156,6 @@ export function WorkspaceNativeTabs(props: {
183156 </ Tabs . Screen >
184157 ) ;
185158 } ) }
186- { searchTab ? (
187- // It never becomes the selected tab; pressing it opens the current list's search.
188- < Tabs . Screen
189- key = { SEARCH_SLOT }
190- screenKey = { SEARCH_SLOT }
191- title = ""
192- tabBarItemAccessibilityLabel = "Search"
193- preventNativeSelection
194- ios = { {
195- role : "search" ,
196- systemItem : "search" ,
197- // iOS 27 only sets the search tab apart while it activates search.
198- automaticallyActivatesSearch : true ,
199- } }
200- >
201- < View />
202- </ Tabs . Screen >
203- ) : null }
204159 </ Tabs . Host >
205160 { ( deviceType === "pad" ||
206161 compactTabs ||
0 commit comments