Fix directory switcher not working in active chat sessions and file browser not defaulting to current session directory path (#3791)

This commit is contained in:
Zane
2025-08-04 08:46:53 -07:00
committed by GitHub
parent 092ece780c
commit 7a364de187
3 changed files with 55 additions and 11 deletions
+1 -1
View File
@@ -1239,7 +1239,7 @@ export default function ChatInput({
{/* Secondary actions and controls row below input */}
<div className="flex flex-row items-center gap-1 p-2 relative">
{/* Directory path */}
<DirSwitcher hasMessages={messages.length > 0} className="mr-0" />
<DirSwitcher className="mr-0" />
<div className="w-px h-4 bg-border-default mx-2" />
{/* Attach button */}
@@ -3,22 +3,14 @@ import { FolderDot } from 'lucide-react';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/Tooltip';
interface DirSwitcherProps {
hasMessages?: boolean;
className?: string;
}
export const DirSwitcher: React.FC<DirSwitcherProps> = ({
hasMessages = false,
className = '',
}) => {
export const DirSwitcher: React.FC<DirSwitcherProps> = ({ className = '' }) => {
const [isTooltipOpen, setIsTooltipOpen] = useState(false);
const handleDirectoryChange = async () => {
if (hasMessages) {
window.electron.directoryChooser();
} else {
window.electron.directoryChooser(true);
}
window.electron.directoryChooser(true);
};
return (