From 0da42e4fa414ab3268d4f71896455097239f8590 Mon Sep 17 00:00:00 2001
From: bndw <ben@bdw.to>
Date: Sat, 28 Feb 2026 20:45:23 -0800
Subject: feat: Complete 9 tasks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- ✅ **Change 1** — `src/main/git.ts`: Add `LOCK_FILES`, `buildTaskSubject`, `getStagedFileNames`, `buildFileSubject` helpers; rewrite `commitMsg` block in `autoCommitTurn`
- ✅ **Change 2a** — `src/main/ipc/handlers.ts`: Update import to include `ensureGitIgnore`; strip branch creation from `sessions:create`; add bare `ensureGitIgnore` call
- ✅ **Change 2b** — `src/main/ipc/handlers.ts`: Update `workflow:advance` to create branch on implement transition; return `{ phase, git_branch }`
- ✅ **Change 3** — `src/main/preload.ts`: Update `advancePhase` return type in `ClaudeFlowAPI` interface
- ✅ **Change 4** — `renderer/src/App.tsx`: Destructure `{ phase, git_branch }` from advance result; spread `git_branch` into `setSelectedSession`
- ✅ **Change 5a** — `renderer/src/components/Header.tsx`: Remove branch from `<option>` text
- ✅ **Change 5b** — `renderer/src/components/Header.tsx`: Add `phase !== "implement"` guard to rename button
- ✅ **Change 5c** — `renderer/src/components/Header.tsx`: Gate badge on `gitBranch` truthy; remove disabled/unavailable state
- ✅ **Change 6** — `renderer/src/styles/globals.css`: Delete `.branch-badge.branch-unavailable` rule
---
 renderer/src/components/Header.tsx | 41 +++++++++++++++-----------------------
 1 file changed, 16 insertions(+), 25 deletions(-)

(limited to 'renderer/src/components/Header.tsx')

diff --git a/renderer/src/components/Header.tsx b/renderer/src/components/Header.tsx
index e56264f..fc0289d 100644
--- a/renderer/src/components/Header.tsx
+++ b/renderer/src/components/Header.tsx
@@ -152,21 +152,23 @@ export function Header({
                 {sessions.map((s) => (
                   <option key={s.id} value={s.id}>
                     {s.name}
-                    {s.git_branch ? ` · ${s.git_branch}` : " · git unavailable"}
                   </option>
                 ))}
               </select>
             )}
             <button onClick={onCreateSession}>+ Session</button>
-            {selectedSession && onRenameSession && !isRenamingSession && (
-              <button
-                onClick={startRename}
-                className="btn-rename"
-                title="Rename session"
-              >
-                ✏️
-              </button>
-            )}
+            {selectedSession &&
+              onRenameSession &&
+              !isRenamingSession &&
+              selectedSession.phase !== "implement" && (
+                <button
+                  onClick={startRename}
+                  className="btn-rename"
+                  title="Rename session"
+                >
+                  ✏️
+                </button>
+              )}
             {selectedSession && onDeleteSession && (
               <button
                 onClick={handleDeleteSession}
@@ -204,26 +206,15 @@ export function Header({
         )}
 
         {/* ── Branch badge ── */}
-        {selectedSession && (
+        {selectedSession && gitBranch && (
           <button
-            className={[
-              "branch-badge",
-              gitBranch ? "" : "branch-unavailable",
-              copied ? "branch-copied" : "",
-            ]
+            className={["branch-badge", copied ? "branch-copied" : ""]
               .filter(Boolean)
               .join(" ")}
             onClick={handleCopyBranch}
-            disabled={!gitBranch}
-            title={
-              gitBranch
-                ? copied
-                  ? "Copied!"
-                  : `Click to copy: ${gitBranch}`
-                : "Git unavailable for this session"
-            }
+            title={copied ? "Copied!" : `Click to copy: ${gitBranch}`}
           >
-            ⎇ {gitBranch ?? "git unavailable"}
+            ⎇ {gitBranch}
           </button>
         )}
 
-- 
cgit v1.2.3

