fix: adress pr comments

- Added validation to check if the specified worktree path exists before generating commit messages.
- Implemented a check to ensure the worktree path is a valid git repository by verifying the presence of the .git directory.
- Improved error handling by returning appropriate responses for invalid paths and non-git repositories.
This commit is contained in:
Shirone
2026-01-12 21:41:34 +01:00
parent cca4638b71
commit 47c188d8f9
6 changed files with 75 additions and 61 deletions

View File

@@ -20,14 +20,16 @@ export function AgentView() {
const { currentProject } = useAppStore();
const [input, setInput] = useState('');
const [currentTool, setCurrentTool] = useState<string | null>(null);
// Initialize session manager state based on screen size (hidden on mobile)
const [showSessionManager, setShowSessionManager] = useState(() => {
// Initialize session manager state - starts as true to match SSR
// Then updates on mount based on actual screen size to prevent hydration mismatch
const [showSessionManager, setShowSessionManager] = useState(true);
// Update session manager visibility based on screen size after mount
useEffect(() => {
// Check if we're on a mobile screen (< lg breakpoint = 1024px)
if (typeof window !== 'undefined') {
return window.innerWidth >= 1024;
}
return true; // Default to showing on SSR
});
const isDesktop = window.innerWidth >= 1024;
setShowSessionManager(isDesktop);
}, []);
const [modelSelection, setModelSelection] = useState<PhaseModelEntry>({ model: 'sonnet' });
// Input ref for auto-focus