feat(metrics): recompute reads manual entries, methodology states them

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Dave 2026-09-19 10:34:25 +02:00
parent 47d19f9f38
commit 5d772ef672
2 changed files with 11 additions and 1 deletions

View file

@ -38,6 +38,15 @@ export function Methodology({ metrics }: { metrics: ProjectMetrics }) {
)}
</p>
{metrics.manualMinutes > 0 && (
<p>
<span className="tabular">{Math.round(metrics.manualMinutes / 60)}</span>{" "}
{Math.round(metrics.manualMinutes / 60) === 1 ? "hour was" : "hours were"}{" "}
logged directly by the developer rather than estimated from commit
timing.
</p>
)}
<p>
Active days are counted against{" "}
<strong className="text-text-primary">workdays</strong> — weekdays

View file

@ -42,7 +42,7 @@ export async function recomputeMetrics(projectId: string): Promise<ProjectMetric
const commits = await pb.collection("commits").getFullList<CommitRecord>({
filter: `project = "${projectId}"`,
fields: "type,scope,authored_at,is_merge",
fields: "type,scope,authored_at,is_merge,source,manual_minutes",
});
const metrics = computeProjectMetrics(
@ -51,6 +51,7 @@ export async function recomputeMetrics(projectId: string): Promise<ProjectMetric
scope: c.scope ?? "",
authoredAt: c.authored_at,
isMerge: Boolean(c.is_merge),
manualMinutes: c.source === "manual" ? (c.manual_minutes ?? 0) : undefined,
})),
constantsFor(project)
);