Add global permission request system with centralized context and dialog

This commit is contained in:
Chris Scott committed 2025-12-26 13:36:18 -05:00
1 parent 6ce3548dfe
commit e3a3cbde84
12 files changed
+371 -45

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ function rowToRepo(row: RepoRow): Repo {
}
export function createRepo(db: Database, repo: CreateRepoInput): Repo {
const normalizedPath = repo.localPath.replace(/\/+$/, '')
const normalizedPath = repo.localPath.trim().replace(/\/+$/, '')
const existing = repo.isLocal
? getRepoByLocalPath(db, normalizedPath)
+2 -1
View File
@@ -233,7 +233,8 @@ export async function renameOrMoveFile(userPath: string, body: { newPath: string
}
function validatePath(userPath: string): string {
const normalized = path.normalize(userPath).replace(/^(\.\.(\/|\\|$))+/, '')
const trimmed = userPath.trim()
const normalized = path.normalize(trimmed).replace(/^(\.\.(\/|\\|$))+/, '')
const fullPath = path.join(SHARED_WORKSPACE_BASE, normalized)
const resolved = path.resolve(fullPath)
+1 -1
View File
@@ -108,7 +108,7 @@ export async function initLocalRepo(
localPath: string,
branch?: string
): Promise<Repo> {
const normalizedPath = localPath.replace(/\/+$/, '')
const normalizedPath = localPath.trim().replace(/\/+$/, '')
const fullPath = path.resolve(getReposPath(), normalizedPath)
const existing = db.getRepoByLocalPath(database, normalizedPath)