diff options
| author | soryu <soryu@soryu.co> | 2026-03-09 17:20:52 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-09 17:20:52 +0000 |
| commit | f49aaa39a32661b54c109ba002d24cbdf73f4ea3 (patch) | |
| tree | 457f763ebf0eb5f8d0c66b147f8de5acf8e378fe /makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx | |
| parent | afaae8aba719bf74404a64b57426ecc6a7e70775 (diff) | |
| download | soryu-f49aaa39a32661b54c109ba002d24cbdf73f4ea3.tar.gz soryu-f49aaa39a32661b54c109ba002d24cbdf73f4ea3.zip | |
feat: worktree diff/commit endpoints and frontend diff viewing (#88)
* feat: soryu-co/soryu - makima: Fix worktree info failing when origin ref is missing
* WIP: heartbeat checkpoint
* WIP: heartbeat checkpoint
* WIP: heartbeat checkpoint
* feat: soryu-co/soryu - makima: Add worktree commit endpoint and diff endpoint for regular users
* feat: soryu-co/soryu - makima: Add frontend diff viewing with clickable worktree files
Diffstat (limited to 'makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx')
| -rw-r--r-- | makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx | 7 |
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 |
