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:
@@ -10,6 +10,7 @@ import { handleTables, handleStats, handleTableSchema, handleTableData, handleQu
|
||||
import { handleWhisperRoutes } from './whisper'
|
||||
import { handleRecordingsRoutes } from './recordings'
|
||||
import { handleClaudeStatus } from './claude-status'
|
||||
import { handleGitStatus, handleGitDiff, handleGitLog, handleGitLogCommit, handleGitCompare, handleGitBranches, handleGitCurrentBranch } from './git'
|
||||
|
||||
export async function handleRequest(req: Request): Promise<Response> {
|
||||
const url = new URL(req.url)
|
||||
@@ -189,5 +190,35 @@ export async function handleRequest(req: Request): Promise<Response> {
|
||||
if (res) return res
|
||||
}
|
||||
|
||||
// Git
|
||||
if (path === '/api/git/status' && req.method === 'GET') {
|
||||
return handleGitStatus()
|
||||
}
|
||||
|
||||
if (path === '/api/git/diff' && req.method === 'GET') {
|
||||
return handleGitDiff(url)
|
||||
}
|
||||
|
||||
if (path === '/api/git/log' && req.method === 'GET') {
|
||||
return handleGitLog(url)
|
||||
}
|
||||
|
||||
const gitLogCommitMatch = path.match(/^\/api\/git\/log\/([a-f0-9]+)$/)
|
||||
if (gitLogCommitMatch && req.method === 'GET') {
|
||||
return handleGitLogCommit(gitLogCommitMatch[1])
|
||||
}
|
||||
|
||||
if (path === '/api/git/compare' && req.method === 'POST') {
|
||||
return handleGitCompare(req)
|
||||
}
|
||||
|
||||
if (path === '/api/git/branches' && req.method === 'GET') {
|
||||
return handleGitBranches()
|
||||
}
|
||||
|
||||
if (path === '/api/git/branch/current' && req.method === 'GET') {
|
||||
return handleGitCurrentBranch()
|
||||
}
|
||||
|
||||
return notFoundResponse()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user