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

@@ -10,42 +10,6 @@ import type { PipelineConfig } from '@automaker/types';
import { RowActions, type RowActionHandlers } from './row-actions';
import { getColumnWidth, getColumnAlign } from './list-header';
/**
* Format a date string for display in the table
*/
function formatRelativeDate(dateString: string | undefined): string {
if (!dateString) return '-';
const date = new Date(dateString);
const now = new Date();
const diffMs = now.getTime() - date.getTime();
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
if (diffDays === 0) {
// Today - show time
return date.toLocaleTimeString('en-US', {
hour: 'numeric',
minute: '2-digit',
hour12: true,
});
}
if (diffDays === 1) {
return 'Yesterday';
}
if (diffDays < 7) {
return `${diffDays} days ago`;
}
// Older - show date
return date.toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: date.getFullYear() !== now.getFullYear() ? 'numeric' : undefined,
});
}
/**
* Get the priority display configuration
*/