feat: detect framework on directory browse#13
Conversation
There was a problem hiding this comment.
1 issue found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/server/framework-tree-detector.ts">
<violation number="1" location="src/server/framework-tree-detector.ts:13">
P2: Folders with an ordinary `requirements.txt` can initially show a Python badge, then lose it when opened because precise detection returns no match unless the file contains Django/Flask or configured commands mention Python. This contradicts the coarse layer's no-false-positive rule; omit content-gated manifest names (the same issue affects several entries here) or make precise detection accept the same presence signal.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| const FAMILY_SLUG_BY_FILE_NAME: Record<string, string> = { | ||
| "go.mod": "golang", | ||
| "Cargo.toml": "rust", | ||
| "requirements.txt": "python", |
There was a problem hiding this comment.
P2: Folders with an ordinary requirements.txt can initially show a Python badge, then lose it when opened because precise detection returns no match unless the file contains Django/Flask or configured commands mention Python. This contradicts the coarse layer's no-false-positive rule; omit content-gated manifest names (the same issue affects several entries here) or make precise detection accept the same presence signal.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/server/framework-tree-detector.ts, line 13:
<comment>Folders with an ordinary `requirements.txt` can initially show a Python badge, then lose it when opened because precise detection returns no match unless the file contains Django/Flask or configured commands mention Python. This contradicts the coarse layer's no-false-positive rule; omit content-gated manifest names (the same issue affects several entries here) or make precise detection accept the same presence signal.</comment>
<file context>
@@ -0,0 +1,62 @@
+const FAMILY_SLUG_BY_FILE_NAME: Record<string, string> = {
+ "go.mod": "golang",
+ "Cargo.toml": "rust",
+ "requirements.txt": "python",
+ "pyproject.toml": "python",
+ "main.py": "python",
</file context>
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
@ubadineke can we add a video to illustrate this feature better? |
|
Also, look into the comments raised by the PR review bot. |
https://x.com/ubadinekethedev/status/2076081755207959008?s=20 this is a video highlighting the feature to be added. |
Awesome, Great work. I will look into it and keep you posted too. |
Adds framework auto-detection to the directory picker when browsing a GitHub repo — folders show a badge (Next.js, Go, Rust, etc.) as you expand them, resolved cheaply: a free hint from the repo's file tree on load, upgraded to a precise read only when you open a folder, and the root directory resolves immediately since it's just one read. Keeps GitHub API usage bounded even on large repos.
Also found and fixed two pre-existing bugs while building this:
Summary by cubic
Add framework auto-detection to the GitHub directory picker. Folders show badges as you browse with one tree fetch, then upgrade to precise detection when you open or select a folder; the root badge is resolved precisely up front.
New Features
rootFrameworkwith the initial listing; rows includeframework. UI shows aFrameworkMarkon folder rows and on the root.exactPathOnlyto avoid workspace bleed; file-rule detector accepts known filenames to skip speculative reads.Bug Fixes
package.jsonframework.[workspace]), Gradle builds, and Python (viarequirements.txt/pyproject.tomlpresence) are recognized...segments in exact-path package.json reads and GitHub file access.Written for commit 734ab60. Summary will update on new commits.