From 690163a865cd18f56943ba54aded95d896fd11fd Mon Sep 17 00:00:00 2001 From: Hugo Gu Date: Wed, 13 May 2026 23:57:38 +0800 Subject: [PATCH] feat(web): Support GitLab repository urls. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add GitLab URL input mode alongside existing GitHub and local modes: - GitLab URL validation for gitlab.com and self-hosted instances - GitLab icon component (custom SVG, matching existing GitHub icon pattern) - Mode tab UI with GitLab option - Backend API integration for GitLab HTTPS URLs No token configuration included — public repositories supported only. Close: #378 Co-authored-by: Claude AI-model: kimi-for-coding/k2p6 --- gitnexus-web/src/components/RepoAnalyzer.tsx | 100 ++++++++++++++++++- gitnexus-web/src/lib/lucide-icons.tsx | 61 +++++++++++ 2 files changed, 157 insertions(+), 4 deletions(-) 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 +