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:
70
frontend/src/types/git.ts
Normal file
70
frontend/src/types/git.ts
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user