From f49aaa39a32661b54c109ba002d24cbdf73f4ea3 Mon Sep 17 00:00:00 2001
From: soryu <soryu@soryu.co>
Date: Mon, 9 Mar 2026 17:20:52 +0000
Subject: 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
---
 makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'makima/frontend/src/components/mesh/WorktreeFilesPanel.tsx')

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
-- 
cgit v1.2.3

