Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub-backed Source implementation so the app can parse GitHub URLs and navigate repositories (directories/files) similarly to existing Hugging Face / HTTP sources.
Changes:
- Introduces
src/lib/sources/gitHubSource.tswith URL parsing, breadcrumb/sourceParts generation, directory listing via GitHub Contents API, and branch listing via GitHub Branches API. - Wires GitHub source detection into the app’s source resolution chain.
- Adds a Vitest suite covering
parseGitHubUrlandgetGitHubSource().sourceParts.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/lib/sources/gitHubSource.ts |
Implements GitHub URL parsing + Source behaviors (list files, resolve URL, versions). |
src/lib/sources/index.ts |
Exports getGitHubSource from the sources module. |
src/components/App/App.tsx |
Adds GitHub to the source detection chain. |
test/lib/sources/gitHubSource.test.ts |
Adds tests for parsing and breadcrumb/sourceParts generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds first-class GitHub URL support to the app’s “sources” system, enabling parsing GitHub repo/tree/blob/raw URLs, listing directory contents via the GitHub API, and integrating this new source type into the main source-resolution flow (per #327).
Changes:
- Introduce
gitHubSourcewith URL parsing, directory listing (GitHub Contents API), and branch listing. - Wire
getGitHubSourceinto the app’s source selection chain and export it from the sources index. - Add unit tests for GitHub URL parsing and breadcrumb/source-part generation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/lib/sources/gitHubSource.ts |
New GitHub source implementation (parse URLs, list files, list branches, build breadcrumbs). |
src/components/App/App.tsx |
Uses getGitHubSource() during source detection. |
src/lib/sources/index.ts |
Exports getGitHubSource from the sources module. |
test/lib/sources/gitHubSource.test.ts |
Adds coverage for GitHub URL parsing and getGitHubSource().sourceParts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub as a first-class data source option (URL parsing, breadcrumb generation, and directory listing via the GitHub API) and removes the prefix field from DirSource, updating UI/test code accordingly.
Changes:
- Introduces
getGitHubSource()+parseGitHubUrl()(including breadcrumb/sourceParts behavior) and adds unit tests for URL parsing/sourceParts. - Removes
DirSource.prefixand updates existing sources/components/tests to rely onsourceId/sourcePartsinstead. - Updates the Folder UI navigation to route using
file.sourceId(via routes config) rather than joining with a directory prefix.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/lib/sources/gitHubSource.test.ts | Adds tests for GitHub URL parsing and sourceParts generation. |
| src/lib/sources/types.ts | Removes prefix from DirSource interface. |
| src/lib/sources/index.ts | Exports getGitHubSource. |
| src/lib/sources/hyperparamSource.ts | Drops prefix from returned DirSource object. |
| src/lib/sources/huggingFaceSource.ts | Removes now-unused prefix logic from HF directory source. |
| src/lib/sources/httpSource.ts | Drops prefix from returned DirSource object. |
| src/lib/sources/gitHubSource.ts | Adds GitHub source implementation (parsing, listFiles via API, branches/versions). |
| src/components/Folder/Folder.tsx | Switches folder navigation logic from prefix-join to file.sourceId routing. |
| src/components/Folder/Folder.test.tsx | Updates tests to match DirSource interface change (no prefix). |
| src/components/App/App.tsx | Wires GitHub source into source detection chain. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
see #327