Add local repository scanning and UI

Implement local repository scanning end-to-end. Frontend: add UI (toolbar, local-scan panel, list/cards), CSS styles, icons, new state fields, and templates; convert recent repo items to buttons and wire up actions to select, view and open scanned repos. JS: add helper utilities (repoNameFromPath, normalizeRemoteUrl, serverRepoRemoteUrls), scanForLocalRepos/selectLocalRepo functions, render template for scan results, and call scanLocalRepos via tauri-api. Tauri API: expose scan_local_repos (tauri command) in tauri-api.js. Backend (Rust): add LocalRepoCandidate type and a scanner implementation that walks configurable/default roots, deduplicates paths, matches local remotes against allowed server URLs, enforces depth/result limits, and returns matched candidates; register scan_local_repos in the command list. Includes error handling and user-facing messages for missing roots or remotes.
This commit is contained in:
2026-05-10 14:32:41 +12:00
parent f0358dbdfe
commit 346f8536f0
5 changed files with 678 additions and 28 deletions
+11
View File
@@ -35,6 +35,17 @@ export async function runGitBranch(repoPath, gitPath) {
return invoke("git_branch", { repoPath, gitPath: gitPath || null });
}
export async function scanLocalRepos(roots = [], allowedRemoteUrls = [], gitPath = "", maxDepth = 4, maxResults = 200) {
ensureInvoke();
return invoke("scan_local_repos", {
roots,
allowedRemoteUrls,
gitPath: gitPath || null,
maxDepth,
maxResults,
});
}
export async function listLocalRepoBranches(repoPath, gitPath) {
ensureInvoke();
return invoke("local_repo_branches", { repoPath, gitPath: gitPath || null });