fix(app): shorten paths in project picker and close sidebar on workspace press
This commit is contained in:
@@ -13,6 +13,7 @@ import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { router, usePathname } from "expo-router";
|
||||
import { useKeyboardShortcutsStore } from "@/stores/keyboard-shortcuts-store";
|
||||
import { shortenPath } from "@/utils/shorten-path";
|
||||
import {
|
||||
normalizeWorkspaceDescriptor,
|
||||
useSessionStore,
|
||||
@@ -294,7 +295,7 @@ export function ProjectPickerModal() {
|
||||
]}
|
||||
numberOfLines={1}
|
||||
>
|
||||
{path}
|
||||
{shortenPath(path)}
|
||||
</Text>
|
||||
</View>
|
||||
</Pressable>
|
||||
|
||||
@@ -1361,6 +1361,7 @@ export function SidebarWorkspaceList({
|
||||
if (!serverId || project.projectKind !== 'git') {
|
||||
return
|
||||
}
|
||||
onWorkspacePress?.()
|
||||
router.push(
|
||||
buildHostNewAgentRoute(serverId, {
|
||||
workingDir: project.iconWorkingDir,
|
||||
@@ -1368,7 +1369,7 @@ export function SidebarWorkspaceList({
|
||||
}) as any
|
||||
)
|
||||
},
|
||||
[serverId]
|
||||
[serverId, onWorkspacePress]
|
||||
)
|
||||
|
||||
const renderProject = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user