feat(dailies): put weekly and monthly tasks beside a game's dailies
Tasks sit at the end of their game's group and are counted by their own period, so a chore due Sunday is not "waiting on you today" every morning. A number chip opens an editor under the strip instead of ticking, since a chip is one target. Catch up offers last period's number the way it offers yesterday's tick. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e97e8b002f
commit
595ae55f4a
4 files changed
+442
-28
No files matched your search
@@ -34,6 +34,7 @@ import {
|
||||
import { clockFor, formatRemaining } from "../shared/time.ts";
|
||||
import { dailySummary, isDaily, resolveDaily } from "../shared/daily.ts";
|
||||
import { goalStatus, readGoal, type GoalStatus } from "../shared/goal.ts";
|
||||
import { taskStatus, type Task } from "../shared/task.ts";
|
||||
import { strandedOccurrences } from "../shared/recurrence.ts";
|
||||
import { orderGames } from "./state/gameOrder.ts";
|
||||
import { GameMetaProvider, type MetaResolver } from "./state/gameMeta.tsx";
|
||||
@@ -187,9 +188,19 @@ export function App() {
|
||||
game: row.event.game,
|
||||
now,
|
||||
logged: daily.daysFor(row.event.id),
|
||||
amounts: amounts.amountsFor(row.event.id),
|
||||
});
|
||||
};
|
||||
|
||||
const taskStatusOf = (task: Task): GoalStatus =>
|
||||
taskStatus({
|
||||
task,
|
||||
region: prefs.region,
|
||||
now,
|
||||
logged: daily.daysFor(task.id),
|
||||
amounts: amounts.amountsFor(task.id),
|
||||
});
|
||||
|
||||
/** Today's state for a repeating event, or undefined if it does not repeat. */
|
||||
const dailyBadge = (row: RowEvent): DailyBadge | undefined => {
|
||||
if (!repeatsDaily(row)) return undefined;
|
||||
@@ -577,6 +588,10 @@ export function App() {
|
||||
const row = todo.find((r) => r.event.id === id);
|
||||
return row === undefined ? undefined : goalStatusOf(row);
|
||||
}}
|
||||
tasks={tasks.tasks}
|
||||
taskStatusFor={taskStatusOf}
|
||||
onSetAmount={amounts.setAmount}
|
||||
amountFor={(key, period) => amounts.amountsFor(key)[period]?.value}
|
||||
/>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
Reference in new issue
Block a user