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

@@ -82,10 +82,13 @@ export function ClaudeUsageSection() {
useEffect(() => {
// Initial fetch if authenticated and stale
if (canFetchUsage && isStale) {
// Compute staleness inside effect to avoid re-running when Date.now() changes
const isDataStale =
!claudeUsageLastUpdated || Date.now() - claudeUsageLastUpdated > STALE_THRESHOLD_MS;
if (canFetchUsage && isDataStale) {
void fetchUsage();
}
}, [fetchUsage, canFetchUsage, isStale]);
}, [fetchUsage, canFetchUsage, claudeUsageLastUpdated]);
useEffect(() => {
if (!canFetchUsage) return undefined;

View File

@@ -175,28 +175,29 @@ export function SettingsNavigation({
}: SettingsNavigationProps) {
// On mobile, only show when isOpen is true
// On desktop (lg+), always show regardless of isOpen
const shouldShow = isOpen;
if (!shouldShow) {
return null;
}
// The desktop visibility is handled by CSS, but we need to render on mobile only when open
return (
<>
{/* Mobile backdrop overlay */}
<div
className="fixed inset-0 bg-black/50 z-20 lg:hidden"
onClick={onClose}
data-testid="settings-nav-backdrop"
/>
{/* Mobile backdrop overlay - only shown when isOpen is true on mobile */}
{isOpen && (
<div
className="fixed inset-0 bg-black/50 z-20 lg:hidden"
onClick={onClose}
data-testid="settings-nav-backdrop"
/>
)}
{/* Navigation sidebar */}
<nav
className={cn(
// Mobile: fixed position overlay
// Mobile: fixed position overlay with slide transition
'fixed inset-y-0 left-0 w-72 z-30',
// Desktop: relative position in layout
'lg:relative lg:w-64 lg:z-auto',
'transition-transform duration-200 ease-out',
// Hide on mobile when closed, show when open
isOpen ? 'translate-x-0' : '-translate-x-full',
// Desktop: relative position in layout, always visible
'lg:relative lg:w-64 lg:z-auto lg:translate-x-0',
'shrink-0 overflow-y-auto',
'border-r border-border/50',
'bg-gradient-to-b from-card/95 via-card/90 to-card/85 backdrop-blur-xl',