feat: Add Git page with branch selector, commit history, and diff viewer

Includes FileTree, CommitList, BranchSelector and DiffViewer components,
Git API routes, and mobile keyboard visibility handling for FAB buttons
This commit is contained in:
2026-02-14 05:49:16 -06:00
parent 2133e2d057
commit a856fefd98
18 changed files with 3015 additions and 13 deletions

70
frontend/src/types/git.ts Normal file
View File

@@ -0,0 +1,70 @@
export interface FileChange {
path: string
status: 'added' | 'modified' | 'deleted' | 'renamed' | 'copied' | 'untracked'
oldPath?: string
staged: boolean
}
export interface GitStatus {
branch: string
staged: FileChange[]
unstaged: FileChange[]
untracked: string[]
ahead: number
behind: number
}
export interface CommitInfo {
sha: string
shortSha: string
author: string
email: string
timestamp: number
message: string
body?: string
files?: FileDiff[]
}
export interface DiffLine {
type: 'context' | 'add' | 'delete'
content: string
}
export interface DiffHunk {
oldStart: number
oldLines: number
newStart: number
newLines: number
header?: string
lines: DiffLine[]
}
export interface FileDiff {
path: string
oldPath?: string
status: 'added' | 'modified' | 'deleted' | 'renamed'
isBinary: boolean
hunks: DiffHunk[]
}
export interface DiffResult {
raw: string
files: FileDiff[]
}
export interface BranchInfo {
name: string
isCurrent: boolean
isRemote: boolean
}
export interface CompareResult {
base: string
head: string
files: FileDiff[]
stats: {
filesChanged: number
additions: number
deletions: number
}
}