summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx')
-rw-r--r--makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx b/makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx
index b529588..bb3361d 100644
--- a/makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx
+++ b/makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx
@@ -4,6 +4,7 @@ import { getWorktreeInfo } from "../../lib/api";
interface WorktreeFilesPanelProps {
taskId: string;
+ onFileClick?: (filePath: string) => void;
}
/** Get status badge styling based on file status */
@@ -35,7 +36,7 @@ function getStatusStyle(status: string): { color: string; bgColor: string; label
}
}
-export function WorktreeFilesPanel({ taskId }: WorktreeFilesPanelProps) {
+export function WorktreeFilesPanel({ taskId, onFileClick }: WorktreeFilesPanelProps) {
const [worktreeInfo, setWorktreeInfo] = useState<WorktreeInfo | null>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
@@ -116,6 +117,7 @@ export function WorktreeFilesPanel({ taskId }: WorktreeFilesPanelProps) {
const { stats, files } = worktreeInfo;
const displayFiles = expanded ? files : files.slice(0, 10);
+ const isClickable = !!onFileClick;
return (
<div className="bg-[rgba(0,0,0,0.2)] border border-[rgba(117,170,252,0.15)]">
@@ -152,7 +154,8 @@ export function WorktreeFilesPanel({ taskId }: WorktreeFilesPanelProps) {
return (
<div
key={file.path}
- className="flex items-center gap-2 px-3 py-1.5 hover:bg-[rgba(117,170,252,0.03)]"
+ className={`flex items-center gap-2 px-3 py-1.5 ${onFileClick ? 'cursor-pointer hover:bg-[rgba(117,170,252,0.08)]' : 'hover:bg-[rgba(117,170,252,0.03)]'}`}
+ onClick={() => onFileClick?.(file.path)}
>
{/* Status badge */}
<span