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