Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): enhance GitHub repo picker with search and sorting #5783

Merged
merged 45 commits into from
Jan 3, 2025

Conversation

rbren
Copy link
Collaborator

@rbren rbren commented Dec 24, 2024

This PR enhances the GitHub repository picker with the following features:

  • Add GitHub API search for public repos when user enters a query
  • Show stargazer count for searched repos
  • Keep repos sorted by pushed_at (most recent first)
  • Place searched repo at the top of the picker

To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:66286b2-nikolaik   --name openhands-app-66286b2   docker.all-hands.dev/all-hands-ai/openhands:66286b2

@rbren rbren marked this pull request as draft December 24, 2024 13:26
@rbren rbren marked this pull request as ready for review December 24, 2024 14:13
Copy link
Contributor

@neubig neubig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and the behavior of the search functionality is somewhat unintuitive. For instance, I did:

Lightning-AI/lit and it gave me a result of Lightning-AI/lit-llama (which has about 6000 stars) and then I continued typing Lightning-AI/litgpt and got Lightning-AI/litgpt (which has 10,000 stars). It seems that maybe it should display more than one result when it searces public repos, and it should sort in descending order of stars, given that stars are displayed in the interface.

@neubig neubig self-requested a review December 26, 2024 00:39
@neubig neubig added the fix-me Attempt to fix this issue with OpenHands label Dec 26, 2024
@openhands-agent
Copy link
Contributor

OpenHands started fixing the pr! You can monitor the progress here.

@openhands-agent
Copy link
Contributor

OVERVIEW:
All issues appear to be successfully resolved. The changes implemented include:

  • Expanded search results (5 repos instead of 1)
  • Added popularity-based sorting (by stars)
  • Enhanced UI with multiple results and star counts
  • Preserved star count visibility for public repos

STATUS: ✅ FULLY RESOLVED
No remaining issues identified; changes successfully improve both functionality and user experience of the repository search feature.

@neubig neubig added lint-fix and removed fix-me Attempt to fix this issue with OpenHands labels Dec 26, 2024
@neubig neubig self-assigned this Dec 26, 2024
@openhands-agent
Copy link
Contributor

Overview:
✓ Issue fully resolved

  • Original problem: Personal repositories were shown regardless of search terms
  • Solution implemented: Added proper filtering of personal repos based on search query
  • Key fix: Filter condition checks if repo name matches search term
  • Expected behavior maintained for empty searches

No remaining issues identified - the implementation appears to completely address the reported problem.

@neubig neubig added lint-fix and removed fix-me Attempt to fix this issue with OpenHands labels Dec 30, 2024
@neubig
Copy link
Contributor

neubig commented Dec 30, 2024

@openhands-agent Frontend linting is failing. Please find pre-commit-config.yml and install pre-commit, and run it on all of the files modified in this PR to fix linting errors.

@openhands-agent
Copy link
Contributor

OpenHands started fixing the pr! You can monitor the progress here.

@openhands-agent
Copy link
Contributor

OVERVIEW:
✓ All issues appear to be successfully resolved. The frontend linting problems were comprehensively addressed through proper code formatting, line breaks, indentation fixes, and comma additions in github-repo-selector.tsx. The code now passes all ESLint and Prettier checks with no remaining issues.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to model-selector.tsx seem unrelated to the intended content of the PR. Please revert them back to be the same as the main branch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to model-selector.test.tsx seem unrelated to the intended content of the PR. Please revert them back to be the same as the main branch.

@neubig
Copy link
Contributor

neubig commented Dec 30, 2024

@openhands-agent the changes to model-selector.test.tsx and model-selector.tsx seem unrelated to the main content of this PR. Please revert these files to be the same as the main branch. Then check to make sure that frontend linting and testing works by following step-by-step the frontend linting and testing workflows specified in github actions.

@openhands-agent
Copy link
Contributor

OpenHands started fixing the pr! You can monitor the progress here.

@openhands-agent
Copy link
Contributor

OVERVIEW:
✅ All issues have been successfully resolved. Specifically:

  • Unrelated file changes were reverted
  • Frontend linting passes
  • Frontend tests pass (with expected skips)

No remaining issues to address.

@neubig
Copy link
Contributor

neubig commented Dec 30, 2024

I tested this and it now works as expected, turning this over to @amanape for a final review!

Screenshot 2024-12-30 at 1 27 37 PM

@neubig neubig requested a review from amanape December 30, 2024 04:47
@neubig neubig assigned amanape and unassigned neubig Dec 30, 2024
@amanape
Copy link
Member

amanape commented Dec 30, 2024

Tests are the things that look the most off, the rest is starting to look real good

@amanape amanape merged commit 3b26678 into main Jan 3, 2025
16 checks passed
@amanape amanape deleted the enhance-repo-picker branch January 3, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants