diff --git a/src/model/parse.ts b/src/model/parse.ts index 1dacdde..dfb8bcc 100644 --- a/src/model/parse.ts +++ b/src/model/parse.ts @@ -26,6 +26,8 @@ export function parseMacroplan(source: string): RawPlan { return { title: data.title != null ? String(data.title) : 'Untitled Macroplan', + start: data.start != null ? toYmdOr('plan', 'start', data.start) : undefined, + end: data.end != null ? toYmdOr('plan', 'end', data.end) : undefined, features, milestones, } diff --git a/src/model/plan.ts b/src/model/plan.ts index 0288b57..5b28f15 100644 --- a/src/model/plan.ts +++ b/src/model/plan.ts @@ -25,7 +25,11 @@ export function buildPlan(raw: RawPlan, today: Date | string = new Date()): Plan }) // Range: earliest start to last marker/milestone (CONTEXT.md). Empty weeks drawn. + // Optional authored `start`/`end` widen this span with lead-in / trailing weeks; + // they only ever extend it — a Feature or marker outside them is never clipped. const allWeeks: WeekId[] = [] + if (raw.start != null) allWeeks.push(mondayOf(raw.start)) + if (raw.end != null) allWeeks.push(mondayOf(raw.end)) for (const r of rows) { allWeeks.push(r.startWeek, r.barEndWeek) for (const mk of r.markers) allWeeks.push(mk.week) diff --git a/src/model/types.ts b/src/model/types.ts index 4e1f385..68d90be 100644 --- a/src/model/types.ts +++ b/src/model/types.ts @@ -23,6 +23,8 @@ export interface RawMilestone { export interface RawPlan { title: string + start?: string // yyyy-mm-dd — optional authored left edge of the plan's span + end?: string // yyyy-mm-dd — optional authored right edge of the plan's span features: RawFeature[] milestones: RawMilestone[] }