From 8b593754045bd439ceabe327ae4c99f6bbadfb9c Mon Sep 17 00:00:00 2001 From: AndyMik90 Date: Sat, 20 Dec 2025 11:44:21 +0100 Subject: [PATCH] fix: extract human-readable title from spec.md when feature field is spec ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the implementation_plan.json feature field contains the spec directory name (e.g., "054-version-2-5-5-displays-version-2-5-0-in-updater") instead of a human-readable title, the task card and modal showed the ugly spec ID. Now detects when the feature field looks like a spec ID (starts with 3 digits and a dash) and extracts the actual title from spec.md's first heading, handling prefixes like "Quick Spec:" and "Specification:". Example: "054-version..." → "Fix Version 2.5.5 Display in Updater" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- auto-claude-ui/src/main/project-store.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/auto-claude-ui/src/main/project-store.ts b/auto-claude-ui/src/main/project-store.ts index 2776b94e..31a785b9 100644 --- a/auto-claude-ui/src/main/project-store.ts +++ b/auto-claude-ui/src/main/project-store.ts @@ -326,11 +326,30 @@ export class ProjectStore { const stagedInMainProject = planWithStaged?.stagedInMainProject; const stagedAt = planWithStaged?.stagedAt; + // Determine title - check if feature looks like a spec ID (e.g., "054-something-something") + let title = plan?.feature || plan?.title || dir.name; + const looksLikeSpecId = /^\d{3}-/.test(title); + if (looksLikeSpecId && existsSync(specFilePath)) { + try { + const specContent = readFileSync(specFilePath, 'utf-8'); + // Extract title from first # line, handling patterns like: + // "# Quick Spec: Title" -> "Title" + // "# Specification: Title" -> "Title" + // "# Title" -> "Title" + const titleMatch = specContent.match(/^#\s+(?:Quick Spec:|Specification:)?\s*(.+)$/m); + if (titleMatch && titleMatch[1]) { + title = titleMatch[1].trim(); + } + } catch { + // Keep the original title on error + } + } + tasks.push({ id: dir.name, // Use spec directory name as ID specId: dir.name, projectId, - title: plan?.feature || plan?.title || dir.name, + title, description, status, reviewReason,