[Update] bulk update
This commit is contained in:
@@ -151,9 +151,16 @@ export function extractTodoItems(message: string): TodoItem[] {
|
||||
|
||||
export function extractDoneSteps(message: string): number[] {
|
||||
const steps: number[] = [];
|
||||
for (const match of message.matchAll(/\[DONE:(\d+)\]/gi)) {
|
||||
const step = Number(match[1]);
|
||||
if (Number.isFinite(step)) steps.push(step);
|
||||
// LOCAL EDIT: upstream matched only the literal `[DONE:3]`. Small local models
|
||||
// drift on it, and one missed tag pins the plan widget on screen forever, so
|
||||
// also accept `[DONE 3]`, `[DONE-3]` and comma lists `[DONE:1,2]`. The brackets
|
||||
// stay required on purpose: a bare "done 3" in prose must not mark a step.
|
||||
for (const match of message.matchAll(/\[\s*DONE\s*[:\-=]?\s*([\d,\s]+?)\s*\]/gi)) {
|
||||
for (const part of match[1].split(/[,\s]+/)) {
|
||||
if (part === "") continue;
|
||||
const step = Number(part);
|
||||
if (Number.isFinite(step)) steps.push(step);
|
||||
}
|
||||
}
|
||||
return steps;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user