feat(goal): let a goal be a number against a target, and a period a month
Weekly chores like 2,100 activity points are a number, not a count of days, and monthly ones need a month. The status shape now carries its measure and period start, so tasks can reuse it whole. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e0aca3b1fb
commit
e7ee43f92d
4 files changed
+172
-28
No files matched your search
+4
-3
@@ -1170,8 +1170,8 @@ describe("goals in the dailies strip", () => {
|
||||
sourceUrl: "https://example.test",
|
||||
} as never;
|
||||
const status = (over: Partial<GoalStatus> = {}): GoalStatus => ({
|
||||
scope: "week", required: 5, count: 3, met: false, needed: 2,
|
||||
open: 4, shortfall: false, ...over,
|
||||
scope: "week", measure: "days", periodStart: "2026-10-12", required: 5, count: 3,
|
||||
met: false, needed: 2, open: 4, shortfall: false, ...over,
|
||||
});
|
||||
const strip = (goal: GoalStatus) =>
|
||||
render(
|
||||
@@ -1280,7 +1280,8 @@ describe("DailyChecklist with a goal", () => {
|
||||
logged={["2026-10-12"]}
|
||||
onToggleDay={() => {}}
|
||||
goal={{
|
||||
scope: "week", required: 5, count: 1, met: false, needed: 4, open: 4, shortfall: false,
|
||||
scope: "week", measure: "days", periodStart: "2026-10-12", required: 5, count: 1,
|
||||
met: false, needed: 4, open: 4, shortfall: false,
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user