Skip to content

Commit

Permalink
fix: improve repo picker filtering and selection behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
openhands-agent committed Dec 24, 2024
1 parent e2a82de commit d9fdd4a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions frontend/src/components/features/github/github-repo-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export function GitHubRepositorySelector({
aria-label="GitHub Repository"
placeholder="Select a GitHub project"
selectedKey={selectedKey}
items={finalRepositories}
inputProps={{
classNames: {
inputWrapper:
Expand All @@ -94,19 +95,21 @@ export function GitHubRepositorySelector({
</a>

Check failure on line 95 in frontend/src/components/features/github/github-repo-selector.tsx

View workflow job for this annotation

GitHub Actions / Lint frontend

Insert `··`
) : undefined,
}}
defaultItems={finalRepositories}
>
{finalRepositories.map((repo) => (
{(item) => (
<AutocompleteItem
data-testid="github-repo-item"
key={repo.id}
value={repo.id}
key={item.id}
value={item.id}
className="data-[selected=true]:bg-default-100"
>
{repo.full_name}
{repo.fromPublicRepoSearch && repo.stargazers_count !== undefined && (
<span className="ml-1 text-gray-400">({repo.stargazers_count}⭐)</span>
{item.full_name}
{item.fromPublicRepoSearch && item.stargazers_count !== undefined && (
<span className="ml-1 text-gray-400">({item.stargazers_count}⭐)</span>
)}
</AutocompleteItem>
))}
)}
</Autocomplete>
);
}

0 comments on commit d9fdd4a

Please sign in to comment.