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

View File

@@ -21,13 +21,14 @@ import {
createSourceCodeHandlers,
createTerminalHandlers,
createResponseHandlers,
createGitHandlers,
type ToolConfig
} from './tools/handlers'
import { setRouter } from './tools/handlers/globalHandlers'
import { setGiteaCredentials, clearGiteaCredentials } from './tools/handlers/sourceCodeHandlers'
import { ALL_TOOL_METAS, getAllToolNames, type ToolCategory } from './tools/toolDefinitions'
export type PageName = 'home' | 'canvas' | 'components' | 'themes' | 'projects' | 'project-canvas' | 'database' | 'source' | 'terminal' | 'tools'
export type PageName = 'home' | 'canvas' | 'components' | 'themes' | 'projects' | 'project-canvas' | 'database' | 'source' | 'terminal' | 'tools' | 'git'
// Internal webmcp functions (not exported for external use)
let webmcpInstance: any = null
@@ -115,7 +116,8 @@ function getToolConfigs(): Map<string, ToolConfig> {
...createProjectCanvasHandlers(),
...createSourceCodeHandlers(),
...createTerminalHandlers(),
...createResponseHandlers()
...createResponseHandlers(),
...createGitHandlers()
]
for (const config of allHandlers) {
@@ -134,7 +136,8 @@ const categoryTools: Record<ToolCategory, string[]> = {
database: ['list_tables', 'get_table_schema', 'get_table_data', 'get_database_stats', 'execute_query'],
source: ['get_repo_info', 'list_repo_files', 'read_repo_file', 'search_repo_code'],
project: ['list_canvases', 'create_canvas', 'get_canvas', 'update_canvas', 'delete_canvas', 'clone_canvas', 'add_component_to_canvas', 'remove_component_from_canvas', 'get_canvas_components'],
terminal: ['terminal_open', 'terminal_close', 'terminal_toggle', 'terminal_move', 'terminal_resize', 'bubbleResponse']
terminal: ['terminal_open', 'terminal_close', 'terminal_toggle', 'terminal_move', 'terminal_resize', 'bubbleResponse'],
git: ['get_git_status', 'get_git_diff', 'compare_commits', 'git_log', 'get_git_branches']
}
// Page to categories mapping
@@ -148,7 +151,8 @@ const pageCategories: Record<PageName, ToolCategory[]> = {
database: ['global', 'database', 'terminal'],
source: ['global', 'source', 'terminal'],
terminal: ['global', 'terminal'],
tools: ['global', 'terminal']
tools: ['global', 'terminal'],
git: ['global', 'git', 'terminal']
}
let currentPage: PageName | null = null