| ... | @@ -18,6 +18,7 @@ import { useEnvironmentQuery } from "../../state/query"; | ... | @@ -18,6 +18,7 @@ import { useEnvironmentQuery } from "../../state/query"; |
| 18 | import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider"; | 18 | import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider"; |
| 19 | import { FileTreeBrowser } from "./FileTreeBrowser"; | 19 | import { FileTreeBrowser } from "./FileTreeBrowser"; |
| 20 | import { preloadWorkspaceFileContents } from "./preload-workspace-file"; | 20 | import { preloadWorkspaceFileContents } from "./preload-workspace-file"; |
| | 21 | import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout"; |
| 21 | | 22 | |
| 22 | export function ThreadFileNavigatorPane(props: { | 23 | export function ThreadFileNavigatorPane(props: { |
| 23 | readonly cwd: string; | 24 | readonly cwd: string; |
| ... | @@ -28,6 +29,7 @@ export function ThreadFileNavigatorPane(props: { | ... | @@ -28,6 +29,7 @@ export function ThreadFileNavigatorPane(props: { |
| 28 | readonly onSelectFile: (path: string) => void; | 29 | readonly onSelectFile: (path: string) => void; |
| 29 | }) { | 30 | }) { |
| 30 | const [searchQuery, setSearchQuery] = useState(""); | 31 | const [searchQuery, setSearchQuery] = useState(""); |
| | 32 | const { toggleAuxiliaryPane } = useAdaptiveWorkspaceLayout(); |
| 31 | const { themeAppearance: highlightTheme } = useAppearancePreferences(); | 33 | const { themeAppearance: highlightTheme } = useAppearancePreferences(); |
| 32 | const theme = useUniwindTheme(); | 34 | const theme = useUniwindTheme(); |
| 33 | const foregroundColor = theme["--color-foreground"]; | 35 | const foregroundColor = theme["--color-foreground"]; |
| ... | @@ -64,8 +66,18 @@ export function ThreadFileNavigatorPane(props: { | ... | @@ -64,8 +66,18 @@ export function ThreadFileNavigatorPane(props: { |
| 64 | type: "button" as const, | 66 | type: "button" as const, |
| 65 | width: 44, | 67 | width: 44, |
| 66 | }, | 68 | }, |
| | 69 | { |
| | 70 | accessibilityLabel: "Close files", |
| | 71 | icon: { name: "xmark", type: "sfSymbol" as const }, |
| | 72 | identifier: "thread-file-navigator-close", |
| | 73 | onPress: toggleAuxiliaryPane, |
| | 74 | sharesBackground: false, |
| | 75 | tintColor: foregroundColor, |
| | 76 | type: "button" as const, |
| | 77 | width: 44, |
| | 78 | }, |
| 67 | ] as ComponentProps<typeof ScreenStackHeaderConfig>["headerRightBarButtonItems"], | 79 | ] as ComponentProps<typeof ScreenStackHeaderConfig>["headerRightBarButtonItems"], |
| 68 | [entriesQuery.refresh, foregroundColor], | 80 | [entriesQuery.refresh, foregroundColor, toggleAuxiliaryPane], |
| 69 | ); | 81 | ); |
| 70 | | 82 | |
| 71 | const fileTree = ( | 83 | const fileTree = ( |
| ... | @@ -159,6 +171,15 @@ export function ThreadFileNavigatorPane(props: { | ... | @@ -159,6 +171,15 @@ export function ThreadFileNavigatorPane(props: { |
| 159 | type="monochrome" | 171 | type="monochrome" |
| 160 | /> | 172 | /> |
| 161 | </Pressable> | 173 | </Pressable> |
| | 174 | <Pressable |
| | 175 | accessibilityRole="button" |
| | 176 | accessibilityLabel="Close files" |
| | 177 | hitSlop={8} |
| | 178 | className="h-8 w-8 items-center justify-center rounded-full active:bg-subtle" |
| | 179 | onPress={toggleAuxiliaryPane} |
| | 180 | > |
| | 181 | <SymbolView name="xmark" size={14} tintColorClassName="accent-icon-muted" /> |
| | 182 | </Pressable> |
| 162 | </View> | 183 | </View> |
| 163 | <View className="flex-row items-center gap-2 border-t border-border px-3 py-2"> | 184 | <View className="flex-row items-center gap-2 border-t border-border px-3 py-2"> |
| 164 | <SymbolView | 185 | <SymbolView |