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 { useQuery } from "@tanstack/react-query";
|
||||||
import { router, usePathname } from "expo-router";
|
import { router, usePathname } from "expo-router";
|
||||||
import { useKeyboardShortcutsStore } from "@/stores/keyboard-shortcuts-store";
|
import { useKeyboardShortcutsStore } from "@/stores/keyboard-shortcuts-store";
|
||||||
|
import { shortenPath } from "@/utils/shorten-path";
|
||||||
import {
|
import {
|
||||||
normalizeWorkspaceDescriptor,
|
normalizeWorkspaceDescriptor,
|
||||||
useSessionStore,
|
useSessionStore,
|
||||||
@@ -294,7 +295,7 @@ export function ProjectPickerModal() {
|
|||||||
]}
|
]}
|
||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
>
|
>
|
||||||
{path}
|
{shortenPath(path)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|||||||
@@ -1361,6 +1361,7 @@ export function SidebarWorkspaceList({
|
|||||||
if (!serverId || project.projectKind !== 'git') {
|
if (!serverId || project.projectKind !== 'git') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
onWorkspacePress?.()
|
||||||
router.push(
|
router.push(
|
||||||
buildHostNewAgentRoute(serverId, {
|
buildHostNewAgentRoute(serverId, {
|
||||||
workingDir: project.iconWorkingDir,
|
workingDir: project.iconWorkingDir,
|
||||||
@@ -1368,7 +1369,7 @@ export function SidebarWorkspaceList({
|
|||||||
}) as any
|
}) as any
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
[serverId]
|
[serverId, onWorkspacePress]
|
||||||
)
|
)
|
||||||
|
|
||||||
const renderProject = useCallback(
|
const renderProject = useCallback(
|
||||||
|
|||||||
Reference in New Issue
Block a user