@@ -119,21 +119,21 @@ export default function RepositoryFinder(props: RepositoryFinderProps) {
119
119
const filteredResults = filterRepos ( searchString , normalizedRepos ) ;
120
120
return filteredResults . map (
121
121
( repo ) =>
122
- ( {
123
- id : repo . url ,
124
- element : (
125
- < div className = "flex-col ml-1 mt-1 flex-grow" >
126
- < div className = "flex" >
127
- < div className = "text-gray-700 dark:text-gray-300 font-semibold" >
128
- { stripOffProtocol ( repo . url ) }
122
+ ( {
123
+ id : repo . url ,
124
+ element : (
125
+ < div className = "flex-col ml-1 mt-1 flex-grow" >
126
+ < div className = "flex" >
127
+ < div className = "text-gray-700 dark:text-gray-300 font-semibold" >
128
+ { stripOffProtocol ( repo . url ) }
129
+ </ div >
130
+ < div className = "ml-1 text-gray-400" > { } </ div >
129
131
</ div >
130
- < div className = "ml-1 text-gray-400" > { } </ div >
132
+ < div className = "flex text-xs text-gray-400" > { } </ div >
131
133
</ div >
132
- < div className = "flex text-xs text-gray-400" > { } </ div >
133
- </ div >
134
- ) ,
135
- isSelectable : true ,
136
- } as DropDown2Element ) ,
134
+ ) ,
135
+ isSelectable : true ,
136
+ } as DropDown2Element ) ,
137
137
) ;
138
138
}
139
139
@@ -157,20 +157,19 @@ export default function RepositoryFinder(props: RepositoryFinderProps) {
157
157
onSelectionChange = { handleSelectionChange }
158
158
disabled = { props . disabled }
159
159
// Only consider the isLoading prop if we're including projects in list
160
- loading = { isLoading && includeProjectsOnCreateWorkspace }
160
+ loading = { includeProjectsOnCreateWorkspace && ( isLoading || isSearching ) }
161
161
searchPlaceholder = "Paste repository URL or type to find suggestions"
162
162
onSearchChange = { setSearchString }
163
163
>
164
- { /* TODO: add a subtle indicator for the isSearching state */ }
165
164
< DropDown2SelectedElement
166
165
icon = { RepositorySVG }
167
166
htmlTitle = { displayContextUrl ( props . selectedContextURL ) || "Repository" }
168
167
title = {
169
168
< div className = "truncate w-80" >
170
169
{ displayContextUrl (
171
170
selectedSuggestion ?. projectName ||
172
- selectedSuggestion ?. repositoryName ||
173
- selectedSuggestion ?. url ,
171
+ selectedSuggestion ?. repositoryName ||
172
+ selectedSuggestion ?. url ,
174
173
) || "Select a repository" }
175
174
</ div >
176
175
}
@@ -180,7 +179,7 @@ export default function RepositoryFinder(props: RepositoryFinderProps) {
180
179
? displayContextUrl ( selectedSuggestion ?. url )
181
180
: undefined
182
181
}
183
- loading = { isLoading && includeProjectsOnCreateWorkspace }
182
+ loading = { includeProjectsOnCreateWorkspace && isLoading }
184
183
/>
185
184
</ DropDown2 >
186
185
) ;
@@ -260,7 +259,7 @@ function filterRepos(searchString: string, suggestedRepos: SuggestedRepository[]
260
259
// If the normalizedSearchString is a URL, and it's not present in the proposed results, "artificially" add it here.
261
260
new URL ( normalizedSearchString ) ;
262
261
results . push ( { url : normalizedSearchString } ) ;
263
- } catch { }
262
+ } catch { }
264
263
}
265
264
}
266
265
0 commit comments