cmdPhaseComplete used replaceInCurrentMilestone() to update the overview bullet checkbox (- [ ] → - [x]), but that function scopes replacements to content after the last </details> tag. The current milestone's overview bullets appear before any <details> blocks, so the replacement never matched. Switch to direct .replace() which correctly finds and updates the first matching unchecked checkbox. This is safe because unchecked checkboxes ([ ]) only exist in the current milestone — archived phases have [x]. Closes #1998 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -712,7 +712,7 @@ function cmdPhaseComplete(cwd, phaseNum, raw) {
|
||||
`(-\\s*\\[)[ ](\\]\\s*.*Phase\\s+${escapeRegex(phaseNum)}[:\\s][^\\n]*)`,
|
||||
'i'
|
||||
);
|
||||
roadmapContent = replaceInCurrentMilestone(roadmapContent, checkboxPattern, `$1x$2 (completed ${today})`);
|
||||
roadmapContent = roadmapContent.replace(checkboxPattern, `$1x$2 (completed ${today})`);
|
||||
|
||||
// Progress table: update Status to Complete, add date (handles 4 or 5 column tables)
|
||||
const phaseEscaped = escapeRegex(phaseNum);
|
||||
|
||||
Reference in New Issue
Block a user