6f41fa7cbe
- Install @phosphor-icons/react package - Create centralized Icon component with size/weight/color variants - Create icon registry with 34 icons across 5 categories - Replace all raw Unicode symbols with proper icon components - Add icons to navigation, buttons, status indicators, git operations - Add icon CSS with consistent sizing and spacing - Fix type definitions for Phosphor icon compatibility Quality gates: typecheck ✓, lint ✓, build ✓ (375KB bundle)
1.9 KiB
1.9 KiB
Smart Git URL Parsing for Repository Creation
Problem
When users add a new repository, they often paste a full browser URL that includes branch names, file paths, or query parameters instead of a clean repository URL. This causes the clone operation to fail with unclear error messages.
Examples of problematic URLs:
https://github.com/user/repo/tree/main(includes branch path)https://github.com/user/repo/blob/main/README.md(includes file path)https://github.com/user/repo?tab=readme-ov-file(includes query params)https://github.com/user/repo/pull/123(includes PR path)
Current behavior: The backend attempts to clone the exact URL, which fails with "fatal: repository not found" or similar errors.
User confusion: Users don't understand why the clone failed since the URL works in their browser.
Solution
Implement smart URL parsing that:
- Detects non-repo URLs: Recognizes when a URL contains paths like
/tree/,/blob/,/pull/, or query parameters - Extracts base repo URL: Strips away branch names, file paths, query parameters to get
https://host/owner/repo.git - Suggests correction: Shows the user the extracted base URL and asks for confirmation
- Improves clone handling: Handles edge cases and provides clear error messages
Benefits
- Better UX: Users get helpful suggestions instead of cryptic errors
- Fewer support issues: Self-service correction reduces confusion
- More robust: Handles common copy-paste mistakes automatically
- Educational: Teaches users what a proper git URL looks like
Scope
Backend
- URL parsing utilities to detect and extract base repo URLs
- Enhanced validation in repository creation endpoint
- Clear error messages for unsupported URLs
Frontend
- UI dialog to show URL correction suggestions
- Option to accept or edit the suggested URL
- Visual indicator for URL validation status