fix: PRD tracker shows sections complete (0 of 12), not internal phases

Made-with: Cursor
This commit is contained in:
2026-03-17 16:22:02 -07:00
parent 2e3b405893
commit f9f3156d49

View File

@@ -139,8 +139,10 @@ export function FreshIdeaMain({ projectId, projectName }: FreshIdeaMainProps) {
);
}
const completedCount = savedPhaseIds.size;
const totalPhases = DISCOVERY_PHASES.length;
const completedSections = PRD_SECTIONS.filter(({ phase }) =>
phase === null ? allDone : savedPhaseIds.has(phase)
).length;
const totalSections = PRD_SECTIONS.length;
return (
<div style={{ height: "100%", display: "flex", flexDirection: "row", overflow: "hidden" }}>
@@ -229,12 +231,12 @@ export function FreshIdeaMain({ projectId, projectName }: FreshIdeaMainProps) {
<div style={{
height: "100%", borderRadius: 99,
background: "#1a1a1a",
width: `${Math.round((completedCount / totalPhases) * 100)}%`,
width: `${Math.round((completedSections / totalSections) * 100)}%`,
transition: "width 0.4s ease",
}} />
</div>
<div style={{ fontSize: "0.68rem", color: "#a09a90", marginTop: 5 }}>
{completedCount} of {totalPhases} phases complete
{completedSections} of {totalSections} sections complete
</div>
</div>