Update files
This commit is contained in:
@@ -204,6 +204,18 @@ function AgentScreenContent({
|
|||||||
|
|
||||||
// Derive isExplorerOpen from the unified panel state
|
// Derive isExplorerOpen from the unified panel state
|
||||||
const isExplorerOpen = isMobile ? mobileView === "file-explorer" : desktopFileExplorerOpen;
|
const isExplorerOpen = isMobile ? mobileView === "file-explorer" : desktopFileExplorerOpen;
|
||||||
|
const openExplorerWithDefaultTab = useCallback(() => {
|
||||||
|
// Generic explorer toggles should land on Changes by default.
|
||||||
|
setExplorerTab("changes");
|
||||||
|
openFileExplorer();
|
||||||
|
}, [openFileExplorer, setExplorerTab]);
|
||||||
|
const handleToggleExplorer = useCallback(() => {
|
||||||
|
if (isExplorerOpen) {
|
||||||
|
toggleFileExplorer();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
openExplorerWithDefaultTab();
|
||||||
|
}, [isExplorerOpen, openExplorerWithDefaultTab, toggleFileExplorer]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
translateX: explorerTranslateX,
|
translateX: explorerTranslateX,
|
||||||
@@ -253,7 +265,7 @@ function AgentScreenContent({
|
|||||||
const shouldOpen = event.translationX < -explorerWindowWidth / 3 || event.velocityX < -500;
|
const shouldOpen = event.translationX < -explorerWindowWidth / 3 || event.velocityX < -500;
|
||||||
if (shouldOpen) {
|
if (shouldOpen) {
|
||||||
animateExplorerToOpen();
|
animateExplorerToOpen();
|
||||||
runOnJS(openFileExplorer)();
|
runOnJS(openExplorerWithDefaultTab)();
|
||||||
} else {
|
} else {
|
||||||
animateExplorerToClose();
|
animateExplorerToClose();
|
||||||
}
|
}
|
||||||
@@ -269,7 +281,7 @@ function AgentScreenContent({
|
|||||||
explorerBackdropOpacity,
|
explorerBackdropOpacity,
|
||||||
animateExplorerToOpen,
|
animateExplorerToOpen,
|
||||||
animateExplorerToClose,
|
animateExplorerToClose,
|
||||||
openFileExplorer,
|
openExplorerWithDefaultTab,
|
||||||
isExplorerGesturing,
|
isExplorerGesturing,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@@ -612,7 +624,7 @@ function AgentScreenContent({
|
|||||||
rightContent={
|
rightContent={
|
||||||
<View style={styles.headerRightContent}>
|
<View style={styles.headerRightContent}>
|
||||||
<HeaderToggleButton
|
<HeaderToggleButton
|
||||||
onPress={toggleFileExplorer}
|
onPress={handleToggleExplorer}
|
||||||
tooltipLabel="Toggle explorer"
|
tooltipLabel="Toggle explorer"
|
||||||
tooltipKeys={["mod", "E"]}
|
tooltipKeys={["mod", "E"]}
|
||||||
tooltipSide="left"
|
tooltipSide="left"
|
||||||
|
|||||||
Reference in New Issue
Block a user