added diff info and hover for commits

This commit is contained in:
2026-11-11 16:18:03 +00:00
parent a3a418a037
commit 0b958ae3eb
2 changed files with 53 additions and 23 deletions

View File

@@ -7,6 +7,13 @@ export interface GitCommit {
url: string;
timestamp: Date;
user: string;
diff: Diff;
}
export interface Diff {
additions: number;
deletions: number;
total: number;
}
const CACHE_TTL = 3 * 60 * 60 * 1000;
@@ -68,12 +75,17 @@ async function fetchLatestCommits(
let newCommit: GitCommit = {
message: commit.commit.message,
hash: commit.sha,
shortHash: commit.sha.substring(0, 8),
shortHash: commit.sha.substring(0, 6),
timestamp: new Date(commit.created),
url: commit.html_url,
parentRepo: repo.full_name,
parentBranch: 'main', // I know this is a shit solution
user: commit.commit.author.name
user: commit.commit.author.name,
diff: {
additions: commit.stats.additions,
deletions: commit.stats.deletions,
total: commit.stats.total
}
};
commitList.push(newCommit);
}