GeezerVison is showing github.com — fix(mobile): workspace tabs open with their last page instead of an e… · pingdotgg/t3code@120d79e
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/App.tsx +12-1Lines changed: 12 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -32,6 +32,11 @@ import { SubscriptionUsageCoordinator } from "./widgets/SubscriptionUsageCoordin | 32 | 32 | import { VoiceInputProvider } from "./features/voice-input/VoiceInputProvider"; | 33 | 33 | import { GlobalVoiceInputControl } from "./features/voice-input/GlobalVoiceInputControl"; | 34 | 34 | import { restoreSettingsLinkState } from "./features/settings/settings-navigation"; | | 35 | +import { | | 36 | + hydrateWorkspaceSelections, | | 37 | + launchWorkspaceURL, | | 38 | + recordWorkspaceSelections, | | 39 | +} from "./features/workspace/workspace-selection-store"; | 35 | 40 | import { NativeLayoutMetricsProvider } from "./native/native-layout-metrics"; | 36 | 41 |
| 37 | 42 | import "../global.css"; | @@ -41,11 +46,13 @@ if (process.env.EXPO_PUBLIC_SHOWCASE === "1") { | 41 | 46 | } | 42 | 47 |
| 43 | 48 | void SplashScreen.preventAutoHideAsync().catch(() => {}); | | 49 | +void hydrateWorkspaceSelections(); | 44 | 50 |
| 45 | 51 | const appLinking = { | 46 | 52 | prefixes: [Linking.createURL("/"), "t3code://", "t3code-dev://", "t3code-preview://"], | 47 | 53 | config: { initialRouteName: "Home" }, | 48 | 54 | filter: shouldHandleAppLink, | | 55 | + getInitialURL: async () => (await Linking.getInitialURL()) ?? (await launchWorkspaceURL()), | 49 | 56 | getStateFromPath: (path: string, options: Parameters<typeof getStateFromPath>[1]) => | 50 | 57 | restoreSettingsLinkState(restoreDraftLinkState(getStateFromPath(path, options), path)), | 51 | 58 | }; | @@ -108,7 +115,11 @@ function AppContent() { | 108 | 115 | <GlobalVoiceInputControl> | 109 | 116 | <NativeLayoutMetricsProvider> | 110 | 117 | <IncomingShareProvider> | 111 | | - <Navigation linking={appLinking} theme={navigationTheme} /> | | 118 | + <Navigation | | 119 | + linking={appLinking} | | 120 | + theme={navigationTheme} | | 121 | + onStateChange={recordWorkspaceSelections} | | 122 | + /> | 112 | 123 | </IncomingShareProvider> | 113 | 124 | <Dialog.Host /> | 114 | 125 | <ThreadArrangementHost /> | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/Stack.tsx +4-2Lines changed: 4 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -124,7 +124,7 @@ import { SettingsNotificationsRouteScreen } from "./features/settings/SettingsNo | 124 | 124 | import { SettingsRouteScreen } from "./features/settings/SettingsRouteScreen"; | 125 | 125 | import { SettingsThreadsRouteScreen } from "./features/settings/SettingsThreadsRouteScreen"; | 126 | 126 | import { SettingsEnvironmentFilterProvider } from "./features/settings/settings-environment-filter"; | 127 | | -import { openSettings, settingsOpenIn } from "./features/settings/settings-navigation"; | | 127 | +import { settingsOpenIn } from "./features/settings/settings-navigation"; | 128 | 128 | import { ShowcaseCaptureCoordinator } from "./features/showcase/ShowcaseCaptureCoordinator"; | 129 | 129 | import { | 130 | 130 | SettingsLegalDocumentCloseHeaderButton, | @@ -143,6 +143,7 @@ import { nativeHeaderScrollEdgeEffects } from "./native/StackHeader"; | 143 | 143 | import { HORIZONTAL_FORM_SHEET_OPTIONS, formSheetDetents } from "./native/sheet-surface"; | 144 | 144 | import { useThreadOutboxDrain } from "./state/use-thread-outbox-drain"; | 145 | 145 | import { useComposerAttachmentUploadWorker } from "./state/composer-attachment-uploads"; | | 146 | +import { useSelectWorkspaceTab } from "./features/workspace/useSelectWorkspaceTab"; | 146 | 147 |
| 147 | 148 | const HEADER_SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version); | 148 | 149 |
| @@ -1045,10 +1046,11 @@ function GuardedScreenLayout(props: { | 1045 | 1046 |
| 1046 | 1047 | function ScreenRenderFallback(props: RenderFailureProps & { readonly routeName: string }) { | 1047 | 1048 | const navigation = useNavigation(); | | 1049 | + const selectTab = useSelectWorkspaceTab(); | 1048 | 1050 | const exit = navigation.canGoBack() | 1049 | 1051 | ? { label: "Go back", onPress: () => navigation.goBack() } | 1050 | 1052 | : props.routeName === "Home" | 1051 | | - ? { label: "Open settings", onPress: () => openSettings(navigation) } | | 1053 | + ? { label: "Open settings", onPress: () => selectTab("settings") } | 1052 | 1054 | : { label: "Return home", onPress: () => navigation.dispatch(StackActions.replace("Home")) }; | 1053 | 1055 |
| 1054 | 1056 | return <RenderFailureView {...props} exit={exit} />; | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/home/HomeRouteScreen.tsx +4-2Lines changed: 4 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -35,6 +35,7 @@ import { useThreadListActions } from "./useThreadListActions"; | 35 | 35 | import { getConnectionAwareBrandHeaderOptions } from "./WorkspaceConnectionTitle"; | 36 | 36 | import { useWorkspaceTabs } from "../workspace/WorkspaceTabsContext"; | 37 | 37 | import { openSettings } from "../settings/settings-navigation"; | | 38 | +import { useSelectWorkspaceTab } from "../workspace/useSelectWorkspaceTab"; | 38 | 39 |
| 39 | 40 | export function HomeRouteScreen() { | 40 | 41 | const { width: windowWidth } = useWindowDimensions(); | @@ -55,6 +56,7 @@ export function HomeRouteScreen() { | 55 | 56 | const { environments: workspaceEnvironments, state: catalogState } = useWorkspaceState(); | 56 | 57 | const { savedConnectionsById } = useSavedRemoteConnections(); | 57 | 58 | const navigation = useNavigation(); | | 59 | + const selectTab = useSelectWorkspaceTab(); | 58 | 60 | const workspace = useWorkspaceTabs(); | 59 | 61 | const [localSearchQuery, setLocalSearchQuery] = useState(""); | 60 | 62 | const searchQuery = | @@ -229,7 +231,7 @@ export function HomeRouteScreen() { | 229 | 231 | onEnvironmentChange={setSelectedEnvironmentId} | 230 | 232 | onProjectChange={setSelectedProjectKey} | 231 | 233 | onOpenEnvironments={() => openSettings(navigation, "SettingsEnvironments")} | 232 | | - onOpenSettings={() => openSettings(navigation, "Settings")} | | 234 | + onOpenSettings={() => selectTab("settings")} | 233 | 235 | onSearchQueryChange={setSearchQuery} | 234 | 236 | onStartNewTask={startNewTask} | 235 | 237 | /> | @@ -252,7 +254,7 @@ export function HomeRouteScreen() { | 252 | 254 | onRegenerateThreadTitle={regenerateThreadTitle} | 253 | 255 | onEnvironmentChange={setSelectedEnvironmentId} | 254 | 256 | onProjectChange={setSelectedProjectKey} | 255 | | - onOpenSettings={() => openSettings(navigation, "Settings")} | | 257 | + onOpenSettings={() => selectTab("settings")} | 256 | 258 | onSearchQueryChange={setSearchQuery} | 257 | 259 | onSelectThread={handleSelectThread} | 258 | 260 | onSelectPendingTask={openPendingTask} | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/keyboard/CommandPalette.tsx +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -44,6 +44,7 @@ import { parseActiveThreadPath, type HardwareKeyboardCommand } from "./hardwareK | 44 | 44 | import { threadJumpIndex } from "./threadKeyboardShortcuts"; | 45 | 45 | import { PullRequestGlyph } from "../pull-requests/pullRequestGlyphs"; | 46 | 46 | import { openSettings } from "../settings/settings-navigation"; | | 47 | +import { useSelectWorkspaceTab } from "../workspace/useSelectWorkspaceTab"; | 47 | 48 |
| 48 | 49 | const PALETTE_COMMANDS: ReadonlyArray<HardwareKeyboardCommand> = [ | 49 | 50 | "commandPalette", | @@ -156,6 +157,7 @@ export function CommandPalette(props: { | 156 | 157 | readonly onCommand: (command: HardwareKeyboardCommand) => void; | 157 | 158 | }) { | 158 | 159 | const navigation = useNavigation(); | | 160 | + const selectTab = useSelectWorkspaceTab(); | 159 | 161 | const { themeVariables } = useAppearancePreferences(); | 160 | 162 | const { selectThread, selectThreadRoute } = useAdaptiveWorkspaceLayout(); | 161 | 163 | const runCommand = props.onCommand; | @@ -219,7 +221,7 @@ export function CommandPalette(props: { | 219 | 221 | kind: "action", | 220 | 222 | title: "Open settings", | 221 | 223 | searchTerms: ["preferences", "configuration"], | 222 | | - run: () => openSettings(navigation, "Settings"), | | 224 | + run: () => selectTab("settings"), | 223 | 225 | }, | 224 | 226 | { | 225 | 227 | key: "appearance", | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx +13-3Lines changed: 13 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -94,6 +94,9 @@ import { AndroidHingeObserver } from "../../native/AndroidHingeObserver"; | 94 | 94 | import { WindowHingeContext } from "../../native/window-hinge-context"; | 95 | 95 | import { useAndroidWorkspaceRoot } from "../workspace/AndroidWorkspaceTabsProvider"; | 96 | 96 | import { openSettings } from "../settings/settings-navigation"; | | 97 | +import { resetRootStack } from "../../lib/root-stack-reset"; | | 98 | +import { currentWorkspaceSelections } from "../workspace/workspace-selection-store"; | | 99 | +import { workspaceTabNavigationState } from "../workspace/workspace-tab-navigation"; | 97 | 100 |
| 98 | 101 | export { useAdaptiveWorkspaceLayout }; | 99 | 102 |
| @@ -460,9 +463,16 @@ function AdaptiveWorkspaceLayoutContent( | 460 | 463 | } | 461 | 464 | setSupplementaryPanePreferredWidth(nextWidth); | 462 | 465 | }; | 463 | | - const handleOpenSettings = () => { | 464 | | - openSettings(navigation, "Settings"); | 465 | | - }; | | 466 | + // This layout provides the context useSelectWorkspaceTab reads, so it builds the state itself. | | 467 | + const handleOpenSettings = () => | | 468 | + resetRootStack(navigation, (state) => | | 469 | + workspaceTabNavigationState( | | 470 | + state, | | 471 | + "settings", | | 472 | + currentWorkspaceSelections(), | | 473 | + Platform.OS === "ios" && layout.usesSplitView, | | 474 | + ), | | 475 | + ); | 466 | 476 |
| 467 | 477 | const selectAndroidWorkspace = useAndroidWorkspaceSelection(); | 468 | 478 | const deferredThreadSelection = useMemo(() => createDeferredNavigation(), []); | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx +27-15Lines changed: 27 additions & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | createNavigatorFactory, | 3 | 3 | NavigationContext, | 4 | 4 | NavigationRouteContext, | 5 | | - StackActions, | 6 | 5 | StackRouter, | 7 | 6 | useNavigationBuilder, | 8 | 7 | type NavigatorTypeBagBase, | @@ -29,6 +28,9 @@ import { WorkspaceTabsProvider, useWorkspaceTabs } from "../workspace/WorkspaceT | 29 | 28 | import { WorkspaceNativeTabs } from "../workspace/WorkspaceNativeTabs.ios"; | 30 | 29 | import { workspaceUsesColumns } from "../workspace/workspace-tabs-state"; | 31 | 30 | import { isSettingsRoute, settingsOpenIn } from "../settings/settings-navigation"; | | 31 | +import { resetRootStack } from "../../lib/root-stack-reset"; | | 32 | +import { currentWorkspaceSelections } from "../workspace/workspace-selection-store"; | | 33 | +import { workspaceTabNavigationState } from "../workspace/workspace-tab-navigation"; | 32 | 34 | import { useWorkspaceSidebarHeaderItem } from "./useWorkspaceSidebarHeaderItem"; | 33 | 35 | import { useDeviceType, useNativeLayoutMetrics } from "../../native/native-layout-metrics"; | 34 | 36 |
| @@ -212,16 +214,6 @@ function WorkspaceColumns( | 212 | 214 | const workspaceTabs = useWorkspaceTabs(); | 213 | 215 | const selectedTab = workspaceTabs?.state.selectedTab; | 214 | 216 | const settingsOpen = workspaceTabs?.settingsOpen ?? false; | 215 | | - // A split view can't give the list the whole width, so with columns side by side Settings | 216 | | - // opens a first page beside its list, like the system Settings app. | 217 | | - const settingsNeedsPage = | 218 | | - settingsOpen && | 219 | | - layout.usesSplitView && | 220 | | - !layout.primarySidebarOverlaysContent && | 221 | | - props.detail.length === 0; | 222 | | - useEffect(() => { | 223 | | - if (settingsNeedsPage) props.navigation.dispatch(StackActions.push("SettingsEnvironments")); | 224 | | - }, [settingsNeedsPage, props.navigation]); | 225 | 217 | const openNewTask = startNewTask; | 226 | 218 | // The cover detail rail needs room for thread tools above the fixed tabs. | 227 | 219 | // The unfolded Duo keeps compose in its detail bar. | @@ -311,6 +303,30 @@ function WorkspaceColumns( | 311 | 303 | }} | 312 | 304 | onExpand={() => { | 313 | 305 | collapsed.current = false; | | 306 | + // Native callbacks can outlive the render that created them, so decide from the live | | 307 | + // router state: expanding gives the tab a detail column, filled with its last page. | | 308 | + const live = props.navigation.getState(); | | 309 | + const isOverlay = (route: { readonly key: string }) => { | | 310 | + const presentation = props.descriptors[route.key]?.options.presentation; | | 311 | + return presentation !== undefined && presentation !== "card"; | | 312 | + }; | | 313 | + const routes = live.routes.slice(0, live.index + 1); | | 314 | + const firstOverlay = routes.findIndex(isOverlay); | | 315 | + const workspaceRoutes = firstOverlay < 0 ? routes : routes.slice(0, firstOverlay); | | 316 | + if (workspaceRoutes.some((route) => route.name !== "Home" && route.name !== "Settings")) | | 317 | + return; | | 318 | + const settings = workspaceRoutes.some((route) => route.name === "Settings"); | | 319 | + const tab = (["threads", "pullRequests", "usage"] as const).find((candidate) => | | 320 | + workspaceTabs?.isTabActive(candidate), | | 321 | + ); | | 322 | + resetRootStack(props.navigation, (state) => | | 323 | + workspaceTabNavigationState( | | 324 | + state, | | 325 | + settings ? "settings" : (tab ?? "threads"), | | 326 | + currentWorkspaceSelections(), | | 327 | + true, | | 328 | + ), | | 329 | + ); | 314 | 330 | }} | 315 | 331 | preferredDisplayMode={ | 316 | 332 | // UIKit applies the mode as a collapsed split expands, before the new width reaches JS, so a | @@ -452,10 +468,6 @@ function WorkspaceStackView(props: ViewProps & { readonly nativeColumns: boolean | 452 | 468 | !layout.usesSplitView && | 453 | 469 | (metrics?.verticalBarEdge ?? "none") === "none" | 454 | 470 | } | 455 | | - onSelect={() => { | 456 | | - if (props.state.index > 0) | 457 | | - props.navigation.dispatch({ type: "POP_TO_TOP", target: props.state.key }); | 458 | | - }} | 459 | 471 | > | 460 | 472 | {props.nativeColumns && !workspacePage ? ( | 461 | 473 | <WorkspaceColumns | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/workspace/WorkspaceNativeTabs.ios.tsx +5-16Lines changed: 5 additions & 16 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -import { useNavigation } from "@react-navigation/native"; | 2 | 1 | import { | 3 | 2 | WORKSPACE_TAB_LABELS, | 4 | 3 | NAVIGATION_TAB_ICONS, | 5 | 4 | useEnabledNavigationTabs, | 6 | 5 | } from "./navigation-tabs"; | 7 | 6 | import { useCallback, useMemo, useState, type ReactNode } from "react"; | 8 | | -import { Keyboard, View, useWindowDimensions, type NativeSyntheticEvent } from "react-native"; | | 7 | +import { View, useWindowDimensions, type NativeSyntheticEvent } from "react-native"; | 9 | 8 | import { | 10 | 9 | Tabs, | 11 | 10 | type TabSelectedEvent, | @@ -26,7 +25,7 @@ import { useControlTheme } from "../../components/ui/useControlTheme"; | 26 | 25 | import { useDeviceType } from "../../native/native-layout-metrics"; | 27 | 26 | import { WorkspaceSidebarTabs } from "./WorkspaceSidebarTabs"; | 28 | 27 | import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout"; | 29 | | -import { openSettings } from "../settings/settings-navigation"; | | 28 | +import { useSelectWorkspaceTab } from "./useSelectWorkspaceTab"; | 30 | 29 |
| 31 | 30 | const PULL_REQUEST_ICON = require("../../../assets/icons/pull-request.png"); | 32 | 31 |
| @@ -61,13 +60,12 @@ function RetainedWorkspaceTab(props: { | 61 | 60 | export function WorkspaceNativeTabs(props: { | 62 | 61 | readonly children: ReactNode; | 63 | 62 | readonly hidden: boolean; | 64 | | - readonly onSelect: () => void; | 65 | 63 | }) { | 66 | 64 | const workspace = useWorkspaceTabs()!; | 67 | 65 | const order = useEnabledNavigationTabs(); | 68 | 66 | const primaryTabs = order.slice(0, 4); | 69 | 67 | const overflow = order[4]; | 70 | | - const navigation = useNavigation(); | | 68 | + const selectTab = useSelectWorkspaceTab(); | 71 | 69 | const [provenance, setProvenance] = useState(0); | 72 | 70 | const systemTabBar = useSystemWorkspaceTabBar(); | 73 | 71 | const deviceType = useDeviceType(); | @@ -99,9 +97,7 @@ export function WorkspaceNativeTabs(props: { | 99 | 97 | onTabSelectionPrevented={({ | 100 | 98 | nativeEvent, | 101 | 99 | }: NativeSyntheticEvent<TabSelectionPreventedEvent>) => { | 102 | | - if (nativeEvent.preventedScreenKey === "settings") { | 103 | | - openSettings(navigation, "Settings"); | 104 | | - } | | 100 | + if (nativeEvent.preventedScreenKey === "settings") selectTab("settings"); | 105 | 101 | }} | 106 | 102 | onTabSelectionRejected={({ | 107 | 103 | nativeEvent, | @@ -113,14 +109,7 @@ export function WorkspaceNativeTabs(props: { | 113 | 109 | if (nativeEvent.actionOrigin === "programmatic-js") return; | 114 | 110 | const tab = workspaceTabForNativeSlot(primaryTabs, nativeEvent.selectedScreenKey); | 115 | 111 | // UIKit sends reselects here even when preventNativeSelection is enabled. | 116 | | - if (tab === "settings") { | 117 | | - openSettings(navigation, "Settings"); | 118 | | - return; | 119 | | - } | 120 | | - if (!tab) return; | 121 | | - Keyboard.dismiss(); | 122 | | - props.onSelect(); | 123 | | - workspace.dispatch({ type: "select", tab }); | | 112 | + if (tab) selectTab(tab); | 124 | 113 | }} | 125 | 114 | > | 126 | 115 | {NATIVE_WORKSPACE_TAB_SLOTS.map((slot, index) => { | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -46,6 +46,7 @@ import { | 46 | 46 | useSystemWorkspaceTabBar, | 47 | 47 | } from "./useSystemWorkspaceTabBar"; | 48 | 48 | import { openSettings } from "../settings/settings-navigation"; | | 49 | +import { useSelectWorkspaceTab } from "./useSelectWorkspaceTab"; | 49 | 50 |
| 50 | 51 | const TAB_TITLES = WORKSPACE_TAB_LABELS; | 51 | 52 |
| @@ -72,6 +73,7 @@ function WorkspaceRootTitle(props: { | 72 | 73 |
| 73 | 74 | function WorkspaceRootContent() { | 74 | 75 | const navigation = useNavigation(); | | 76 | + const selectTab = useSelectWorkspaceTab(); | 75 | 77 | const { width: windowWidth } = useWindowDimensions(); | 76 | 78 | const { layout, startNewTask } = useAdaptiveWorkspaceLayout(); | 77 | 79 | const primaryColumn = use(NativePrimaryColumnContext); | @@ -186,7 +188,7 @@ function WorkspaceRootContent() { | 186 | 188 | { | 187 | 189 | accessibilityLabel: "Settings", | 188 | 190 | icon: "gearshape", | 189 | | - onPress: () => openSettings(navigation, "Settings"), | | 191 | + onPress: () => selectTab("settings"), | 190 | 192 | }, | 191 | 193 | ]} | 192 | 194 | /> | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/workspace/WorkspaceSectionToolbar.tsx +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,6 @@ import { | 12 | 12 | import { useWorkspaceTabs } from "./WorkspaceTabsContext"; | 13 | 13 | import { useSelectWorkspaceTab } from "./useSelectWorkspaceTab"; | 14 | 14 | import { useCompactWorkspaceTabs, useSidebarWorkspaceTabs } from "./useSystemWorkspaceTabBar"; | 15 | | -import { openSettings } from "../settings/settings-navigation"; | 16 | 15 |
| 17 | 16 | const PULL_REQUEST_ICON = require("../../../assets/icons/pull-request.png"); | 18 | 17 |
| @@ -50,7 +49,7 @@ export function WorkspaceTabToolbarButtons() { | 50 | 49 | accessibilityLabel="Settings" | 51 | 50 | icon="gearshape" | 52 | 51 | tintColor={selected === "settings" ? selectedTint : undefined} | 53 | | - onPress={() => openSettings(navigation, "Settings")} | | 52 | + onPress={() => selectTab("settings")} | 54 | 53 | /> | 55 | 54 | </> | 56 | 55 | ); | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/workspace/WorkspaceSidebarTabs.ios.tsx +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,6 @@ import { useControlTheme } from "../../components/ui/useControlTheme"; | 6 | 6 | import { useNavigationTabOrder, useHiddenNavigationTabs } from "./navigation-tabs"; | 7 | 7 | import { useWorkspaceTabs } from "./WorkspaceTabsContext"; | 8 | 8 | import { useSelectWorkspaceTab } from "./useSelectWorkspaceTab"; | 9 | | -import { openSettings } from "../settings/settings-navigation"; | 10 | 9 |
| 11 | 10 | const NativeSidebarTabBar = requireNativeView< | 12 | 11 | ViewProps & { | @@ -52,7 +51,7 @@ export function WorkspaceSidebarTabs(props: { | 52 | 51 | onCompose={() => props.onNewTask?.()} | 53 | 52 | onSelectionChange={({ nativeEvent }) => { | 54 | 53 | const tab = tabs.find((candidate) => candidate === nativeEvent.tab); | 55 | | - if (tab === "settings") openSettings(navigation, "Settings"); | | 54 | + if (tab === "settings") selectTab("settings"); | 56 | 55 | else if (tab) selectTab(tab); | 57 | 56 | }} | 58 | 57 | // Keep the host stable while UIKit updates the bars' intrinsic size and safe area together. | |
|