mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-02 04:11:00 +02:00
Tighten search-box types, expand test prefix, drop stale CSS comment
- chooseFromApi is now generic over the response shape; each caller declares a typed *SearchResponse, removing four `any` annotations - e2e test prefix: rc- → repo-collab- for legibility in the test DB - web_src/css/modules/search.css: drop the stale leading comment Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ function buildResultHTML(result: SearchResult): string {
|
||||
// Awaits one user selection from an autocomplete attached to `container`. Resolves with
|
||||
// the chosen item; the caller writes it to whatever input/state it owns. Wrap in a loop
|
||||
// to keep the search box live across selections.
|
||||
export function chooseFromApi(container: HTMLElement, url: string, parse: (raw: any, query: string) => SearchResult[], {minCharacters = 2}: {minCharacters?: number} = {}): Promise<SearchResult> {
|
||||
export function chooseFromApi<T = unknown>(container: HTMLElement, url: string, parse: (raw: T, query: string) => SearchResult[], {minCharacters = 2}: {minCharacters?: number} = {}): Promise<SearchResult> {
|
||||
return new Promise((resolve) => {
|
||||
const input = container.querySelector<HTMLInputElement>('input.prompt') ?? container.querySelector<HTMLInputElement>('input')!;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user