diff --git a/gitnexus-web/src/components/RepoAnalyzer.tsx b/gitnexus-web/src/components/RepoAnalyzer.tsx index 5781d2629..3676e7676 100644 --- a/gitnexus-web/src/components/RepoAnalyzer.tsx +++ b/gitnexus-web/src/components/RepoAnalyzer.tsx @@ -9,6 +9,7 @@ import { useState, useRef, useEffect, useId } from 'react'; import { Github, + Gitlab, FolderOpen, Loader2, Check, @@ -26,15 +27,20 @@ import { AnalyzeProgress } from './AnalyzeProgress'; // ── Helpers ────────────────────────────────────────────────────────────────── -type InputMode = 'github' | 'local'; +type InputMode = 'github' | 'gitlab' | 'local'; const GITHUB_RE = /^https?:\/\/(www\.)?github\.com\/[^/\s]+\/[^/\s]+/i; +const GITLAB_RE = /^https?:\/\/[^/\s]+\/[^/\s]+\/[^/\s]+(\/.*)?$/i; const IS_WINDOWS = navigator.userAgent.toLowerCase().includes('win'); function isValidGithubUrl(value: string): boolean { return GITHUB_RE.test(value.trim()); } +function isValidGitlabUrl(value: string): boolean { + return GITLAB_RE.test(value.trim()); +} + // ── Mode tabs ──────────────────────────────────────────────────────────────── function ModeTabs({ mode, onChange }: { mode: InputMode; onChange: (m: InputMode) => void }) { @@ -53,6 +59,19 @@ function ModeTabs({ mode, onChange }: { mode: InputMode; onChange: (m: InputMode GitHub URL +