diff --git a/content/copilot/managing-copilot/configure-personal-settings/configuring-network-settings-for-github-copilot.md b/content/copilot/managing-copilot/configure-personal-settings/configuring-network-settings-for-github-copilot.md index d0513e4d317b..bb20b04f949c 100644 --- a/content/copilot/managing-copilot/configure-personal-settings/configuring-network-settings-for-github-copilot.md +++ b/content/copilot/managing-copilot/configure-personal-settings/configuring-network-settings-for-github-copilot.md @@ -68,8 +68,8 @@ This stores your credentials as plaintext in your editor's settings. Alternative {% data reusables.copilot.vscode-settings %} 1. In the left-side panel of the settings tab, click **Application** and then select **Proxy**. -1. In the text box under "Proxy", type the address of your proxy server, for example `http://localhost:3128`. -1. Optionally, to configure {% data variables.product.prodname_copilot_short %} to ignore certificate errors, under "Proxy Strict SSL", select or deselect the checkbox. +1. In the text box under "Proxy," type the address of your proxy server, for example `http://localhost:3128`. +1. Optionally, to configure {% data variables.product.prodname_copilot_short %} to ignore certificate errors, under "Proxy Strict SSL," select or deselect the checkbox. > [!WARNING] Ignoring certificate errors can cause security issues and is not recommended. diff --git a/content/copilot/using-github-copilot/ai-models/changing-the-ai-model-for-copilot-code-completion.md b/content/copilot/using-github-copilot/ai-models/changing-the-ai-model-for-copilot-code-completion.md index 39e1471cb13c..abdb8577c3d2 100644 --- a/content/copilot/using-github-copilot/ai-models/changing-the-ai-model-for-copilot-code-completion.md +++ b/content/copilot/using-github-copilot/ai-models/changing-the-ai-model-for-copilot-code-completion.md @@ -10,7 +10,7 @@ topics: ## Overview -By default, {% data variables.product.prodname_copilot_short %} code completion uses the GPT 3.5 Turbo large language model (LLM). As an alternative, you can choose to use a model based on GPT 4o-mini. This model has been trained on a wide range of high quality public {% data variables.product.github %} repositories, providing coverage of over 30 programming languages. Its knowledge base is more current than the default model and you may find that it generates completion suggestions more quickly. +By default, {% data variables.product.prodname_copilot_short %} code completion uses the GPT-4o {% data variables.product.prodname_copilot_short %}, a fine-tuned GPT-4o mini based large language model (LLM). This model has been trained on a wide range of high quality public {% data variables.product.github %} repositories, providing coverage of over 30 programming languages. Its knowledge base is more current than the default model and you may find that it generates completion suggestions more quickly.
View the list of programming languages and technologies included in the training data. @@ -53,7 +53,7 @@ By default, {% data variables.product.prodname_copilot_short %} code completion > [!NOTE] > * Multiple model support for {% data variables.product.prodname_copilot_short %} code completion is in {% data variables.release-phases.public_preview %} and is subject to change. -> * Currently the ability to switch AI model is available in the latest releases of {% data variables.product.prodname_vscode_shortname %} and JetBrains IDEs, with the latest version of the {% data variables.product.prodname_copilot %} extension. +> * You can switch AI models in {% data variables.product.prodname_vs %} 17.14 Preview 2 and later, and in the latest JetBrains IDEs, with the latest version of the {% data variables.product.prodname_copilot %} extension. ## Effects of switching the AI model @@ -75,32 +75,23 @@ If you have a {% data variables.product.prodname_copilot_free_short %} or {% dat {% data reusables.copilot.editor-preview-settings %} -{% vscode %} +{% visualstudio %} ## Changing the AI model for code completion -The following instructions are for {% data variables.product.prodname_vscode_shortname %}. If you are using a JetBrains IDE, click the appropriate tab at the start of this article. +The following instructions are for {% data variables.product.prodname_vs %}. If you are using a JetBrains IDE, click the appropriate tab at the start of this article. -1. Open the command palette by pressing Ctrl+Shift+P (Windows/Linux) / Command+Shift+P (Mac). -1. Type `change completions model` and select the "{% data variables.product.prodname_copilot %}: Change Completions Model" command. -1. In the dropdown menu, select the model you want to use. +1. Click the **{% octicon "copilot" aria-hidden="true" %}** icon in the top right corner. +1. Click **Settings**, then click **Options**. +1. Under **{% data variables.product.prodname_copilot_short %} Completions**, use the dropdown menu to select the model you want to use. -Alternatively, if Command Center is enabled, you can click {% octicon "chevron-down" aria-label="The downward-pointing arrowhead" %} beside the **{% octicon "copilot" aria-hidden="true" %}** icon at the top of the {% data variables.product.prodname_vscode_shortname %} window, then click **Configure Code Completions** in the dropdown menu. Then choose **Change Completions Model** in the dropdown menu and select the model you want to use. - -## Checking which model is being used - -1. Open the Settings editor by pressing Ctrl+, (Linux/Windows) / Command+, (Mac). -1. Type `copilot completion` and look for the "{% data variables.product.github %} > {% data variables.product.prodname_copilot_short %}: Selected Completion Model" section. - - The field in this section displays the currently selected model. If the field is empty, the default model is being used. - -{% endvscode %} +{% endvisualstudio %} {% jetbrains %} ## Changing the AI model for code completion -The following instructions are for JetBrains IDEs. If you are using {% data variables.product.prodname_vscode_shortname %}, click the appropriate tab at the start of this article. +The following instructions are for JetBrains IDEs. If you are using {% data variables.product.prodname_vs %}, click the appropriate tab at the start of this article. 1. Click the **{% octicon "copilot" aria-hidden="true" %}** icon in the status bar. 1. In the popup menu, click **Edit Model for Completion**. diff --git a/content/repositories/creating-and-managing-repositories/repository-limits.md b/content/repositories/creating-and-managing-repositories/repository-limits.md index e9a237205654..7c827ed6e7e8 100644 --- a/content/repositories/creating-and-managing-repositories/repository-limits.md +++ b/content/repositories/creating-and-managing-repositories/repository-limits.md @@ -42,6 +42,10 @@ Merging a pull request using the "Rebase and merge" option is limited to **100** {% endif %} -## Organization Limits +## Organization and account limits -If a repository owner exceeds **100,000** repositories, some UI experiences and API functionality may be degraded. For more information, see [AUTOTITLE](/repositories/creating-and-managing-repositories/about-repositories#about-repository-ownership). +Organizations and accounts may not exceed **100,000** repositories. When an account surpasses **50,000** repositories, a banner will appear, noting the approaching limit. Additionally, administrators will receive email notifications, and the audit log will update every additional 5,000 repositories created. See [AUTOTITLE](/repositories/creating-and-managing-repositories/about-repositories#about-repository-ownership). + +## Integrations and {% data variables.product.prodname_github_apps %} + +When building an integration on {% data variables.product.github %}, store user-generated data in their own {% data variables.product.github %} accounts rather than centralizing it in your account. This ensures users retain full control over their work and helps you avoid exceeding repository limits. diff --git a/content/repositories/creating-and-managing-repositories/transferring-a-repository.md b/content/repositories/creating-and-managing-repositories/transferring-a-repository.md index c56b75ea0e62..50264ee1060e 100644 --- a/content/repositories/creating-and-managing-repositories/transferring-a-repository.md +++ b/content/repositories/creating-and-managing-repositories/transferring-a-repository.md @@ -55,7 +55,9 @@ When you transfer a repository, its issues, pull requests, wiki, stars, and watc * If the transferred repository is a fork, then it remains associated with the upstream repository. * If the transferred repository has any forks, then those forks will remain associated with the repository after the transfer is complete. * If the transferred repository uses {% data variables.large_files.product_name_long %}, all {% data variables.large_files.product_name_short %} objects are automatically moved. This transfer occurs in the background, so if you have a large number of {% data variables.large_files.product_name_short %} objects or if the {% data variables.large_files.product_name_short %} objects themselves are large, it may take some time for the transfer to occur.{% ifversion fpt or ghec %} Before you transfer a repository that uses {% data variables.large_files.product_name_short %}, make sure the receiving account has enough data packs to store the {% data variables.large_files.product_name_short %} objects you'll be moving over. For more information on adding storage for personal accounts, see [AUTOTITLE](/billing/managing-billing-for-your-products/managing-billing-for-git-large-file-storage/upgrading-git-large-file-storage).{% endif %} -* When a repository is transferred between two personal accounts, issue assignments are left intact. When you transfer a repository from a personal account to an organization, issues assigned to members in the organization remain intact, and all other issue assignees are cleared. Only owners in the organization are allowed to create new issue assignments. When you transfer a repository from an organization to a personal account, only issues assigned to the repository's owner are kept, and all other issue assignees are removed. +* When a repository is transferred between two personal accounts, issue assignments are left intact. When you transfer a repository from a personal account to an organization, issues assigned to members in the organization remain intact, and all other issue assignees are cleared. Only owners in the organization are allowed to create new issue assignments. When you transfer a repository from an organization to a personal account, only issues assigned to the repository's owner are kept, and all other issue assignees are removed.{% ifversion issue-types %} +* When you transfer a repository from an organization to another organization, issue types on issues are left intact if the new organization has a matching issue type, and all other issue types are removed from issues. +* When you transfer a repository from an organization to a personal account, all issue types are removed from issues.{% endif %} * If the transferred repository contains a {% data variables.product.prodname_pages %} site, then links to the Git repository on the Web and through Git activity are redirected. However, we don't redirect {% data variables.product.prodname_pages %} associated with the repository. * All links to the previous repository location are automatically redirected to the new location. When you use `git clone`, `git fetch`, or `git push` on a transferred repository, these commands will redirect to the new repository location or URL. However, to avoid confusion, we strongly recommend updating any existing local clones to point to the new repository URL. You can do this by using `git remote` on the command line: diff --git a/content/search-github/searching-on-github/index.md b/content/search-github/searching-on-github/index.md index 227d90984864..0d5fdd4b360e 100644 --- a/content/search-github/searching-on-github/index.md +++ b/content/search-github/searching-on-github/index.md @@ -19,6 +19,7 @@ children: - /searching-issues-and-pull-requests - /searching-discussions - /searching-github-marketplace + - /searching-github-models - /searching-users - /searching-for-packages - /searching-wikis diff --git a/content/search-github/searching-on-github/searching-github-marketplace.md b/content/search-github/searching-on-github/searching-github-marketplace.md index 799509ff1e59..7b5a8c56df38 100644 --- a/content/search-github/searching-on-github/searching-github-marketplace.md +++ b/content/search-github/searching-on-github/searching-github-marketplace.md @@ -27,7 +27,7 @@ You can find apps and actions on {% data variables.product.prodname_marketplace ## Searching across {% data variables.product.prodname_dotcom %} -Anytime you search across all of {% data variables.product.prodname_dotcom %}, you can filter the results to see matching apps and actions from {% data variables.product.prodname_marketplace %}. +Anytime you search across all of {% data variables.product.prodname_dotcom %}, you can filter the results to see matching apps, actions, and models from {% data variables.product.prodname_marketplace %}. 1. Navigate to https://github.com/search. 1. Type any keywords and press **Enter**. @@ -36,6 +36,9 @@ Anytime you search across all of {% data variables.product.prodname_dotcom %}, y ## Further reading +{%- ifversion fpt %} +* [AUTOTITLE](/search-github/searching-on-github/searching-github-models) +{%- endif %} * [AUTOTITLE](/actions/learn-github-actions/finding-and-customizing-actions) * [AUTOTITLE](/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-personal-account) * [AUTOTITLE](/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-organizations) diff --git a/content/search-github/searching-on-github/searching-github-models.md b/content/search-github/searching-on-github/searching-github-models.md new file mode 100644 index 000000000000..27afad229e8c --- /dev/null +++ b/content/search-github/searching-on-github/searching-github-models.md @@ -0,0 +1,139 @@ +--- +title: Searching GitHub Models +intro: 'You can search for models that are available on {% data variables.product.prodname_github_models %}.' +versions: + fpt: '*' +topics: + - GitHub search +shortTitle: Search GitHub Models +--- + +## About searching {% data variables.product.prodname_github_models %} + +You can find models on {% data variables.product.prodname_github_models %} in two ways: + +* Search from {% data variables.product.prodname_marketplace %}. +* Search across all of {% data variables.product.prodname_dotcom %} and then filter the results to Marketplace. + +## Searching in {% data variables.product.prodname_marketplace %} + +{% data reusables.marketplace.visit-marketplace %} +1. Type any keywords and `type:models` and press **Enter**. + +## Searching across {% data variables.product.prodname_dotcom %} + +Anytime you search across all of {% data variables.product.prodname_dotcom %}, you can filter the results to see matching models from {% data variables.product.prodname_marketplace %}. + +1. Navigate to https://github.com/search. +1. Type any keywords and press **Enter**. +1. To see all available filters for your search, in the "Filter by" sidebar, click **More**. +1. To see results from {% data variables.product.prodname_github_models %}, click **Marketplace**. + +## Searching within a specific field + +The `in` qualifier used in conjunction with search text finds models that match the specified text in that field. Possible fields include `tags`, `license`, `name`, `description`, `transparency`, and `task`. + +|Qualifier|Example| +|---|---| +|in:FIELD | [**in:tags agents**](https://github.com/search?q=in:tags+agents&type=marketplace) matches models with the 'agents' tag. +|in:FIELD | [**in:license distribute**](https://github.com/search?q=in:license+distribute&type=marketplace) matches models who mention 'distribute' in their license. +|in:FIELD | [**in:transparency "responsible ai"**](https://github.com/search?q=in:transparency+%22responsible+ai%22&type=marketplace) matches models who mention 'responsible ai' in their transparency information. + +## Search by category + +The `category` qualifier finds models that are tagged with a specific term. + +|Qualifier|Example| +|---|---| +|category:CATEGORY | [**category:multilingual**](https://github.com/search?q=category:multilingual&type=marketplace) matches models in the multilingual category. +|category:CATEGORY | [**category:"large context"**](https://github.com/search?q=category:%22large+context%22+&type=marketplace) matches models in the large context category. + +## Search by input modality + +The `input-modality` qualifier finds models that support a particular medium for providing input. Possible modalities include `text`, `image`, and `audio`. + +|Qualifier|Example| +|---|---| +|input-modality:MODALITY | [**input-modality:text**](https://github.com/search?q=input-modality:text&type=marketplace) matches models that support text input. + +## Search by output modality + +The `output-modality` qualifier finds models that support a particular medium for providing output. Possible modalities include `text` and `embeddings`. + +|Qualifier|Example| +|---|---| +|output-modality:MODALITY | [**output-modality:embeddings**](https://github.com/search?q=output-modality:embeddings&type=marketplace) matches models that support embedding output. + +## Search by language + +The `language` qualifier finds models that support a specified human language. + +|Qualifier|Example| +|---|---| +|language:TWO_CHARACTER_CODE | [**language:es**](https://github.com/search?q=language:es&type=marketplace) matches models that support Spanish. +|language:NAME | [**language:arabic**](https://github.com/search?q=language:arabic&type=marketplace) matches models that support Arabic. + +## Search by task + +The `task` qualifier finds models that can be used to accomplish a specific task. + +|Qualifier|Example| +|---|---| +|task:TASK | [**task:embeddings**](https://github.com/search?q=task:embeddings&type=marketplace) matches models that support embedding. +|task:TASK | [**task:chat-completion**](https://github.com/search?q=task:chat-completion&type=marketplace) matches models that support interaction via chat. + +## Search by publisher + +The `publisher` qualifier finds models released by a particular publisher. + +|Qualifier|Example| +|---|---| +|publisher:PUBLISHER_NAME | [**publisher:"Mistral AI"**](https://github.com/search?q=publisher:%22Mistral+AI%22&type=marketplace) matches models by Mistral AI. + +## Search by input token limit + +The `input-tokens` qualifier finds models with an input token limit above or below a particular value, or within a range. + +|Qualifier|Example| +|---|---| +|input-tokens:VALUE | [**input-tokens:>10000**](https://github.com/search?q=input-tokens:%3E10000&type=marketplace) matches models with an input token limit greater than 10,000. +|input-tokens:VALUE | [**input-tokens:15000..20000**](https://github.com/search?q=input-tokens:15000..20000&type=marketplace) matches models with an input token limit between 15,000 and 20,000. + +## Search by output token limit + +The `output-tokens` qualifier finds models with an output token limit above or below a particular value, or within a range. + +|Qualifier|Example| +|---|---| +|output-tokens:VALUE | [**output-tokens:<8000**](https://github.com/search?q=output-tokens:%3C8000&type=marketplace) matches models with an output token limit less than 8,000. +|output-tokens:VALUE | [**output-tokens:15000..20000**](https://github.com/search?q=output-tokens:15000..20000&type=marketplace) matches models with an output token limit between 15,000 and 20,000. + +## Search by rate limit tier + +The `rate-limit-tier` qualifier finds models with a particular tier of rate limit. Possible tiers include `low`, `high`, and `custom`. + +|Qualifier|Example| +|---|---| +|rate-limit-tier:TIER | [**rate-limit-tier:low**](https://github.com/search?q=rate-limit-tier:low&type=marketplace) matches models with a low rate limit tier. + +## Search by license type + +The `license` qualifier finds models that use a particular license. + +|Qualifier|Example| +|---|---| +|license:LICENSE | [**license:mit**](https://github.com/search?q=license:mit&type=marketplace) matches models that use the MIT license. +|license:LICENSE | [**license:custom**](https://github.com/search?q=license:custom&type=marketplace) matches models that use a custom license. + +## Sorting results + +The `sort` qualifier is used to sort results. It can be used alone or combined with other qualifiers and search text. + +|Qualifier|Example| +|---|---| +|sort:FIELD | [**sort:created-desc publisher:meta**](https://github.com/search?q=sort:created-desc+publisher:meta&type=marketplace) matches models published by Meta, sorted with the most recently added first. +|sort:FIELD | [**sort:name-asc in:task chat-completion**](https://github.com/search?q=sort:name-asc+in:task+chat-completion&type=marketplace) matches models that allow chat completion, sorted alphabetically. + +## Further reading + +* [AUTOTITLE](/search-github/getting-started-with-searching-on-github/sorting-search-results) diff --git a/data/reusables/organizations/organization-plans.md b/data/reusables/organizations/organization-plans.md index bb3822d5605d..650a1832a7af 100644 --- a/data/reusables/organizations/organization-plans.md +++ b/data/reusables/organizations/organization-plans.md @@ -1,5 +1,7 @@ {% ifversion fpt or ghec %} -All organizations can own an unlimited number of public and private repositories. You can use organizations for free, with {% data variables.product.prodname_free_team %}, which includes limited features on private repositories. To get the full feature set on private repositories and additional features at the organization level, including SAML single sign-on and improved support coverage, you can upgrade to {% data variables.product.prodname_team %} or {% data variables.product.prodname_ghe_cloud %}. {% data reusables.gated-features.more-info %} +You can use organizations for free, with {% data variables.product.prodname_free_team %}, which includes limited features on private repositories. To get the full feature set on private repositories and additional features at the organization level, including SAML single sign-on and improved support coverage, you can upgrade to {% data variables.product.prodname_team %} or {% data variables.product.prodname_ghe_cloud %}. {% data reusables.gated-features.more-info %} + +Organizations are limited to owning 100,000 repositories, to create additional repositories you can create additional organizations. {% ifversion fpt %} {% data reusables.enterprise.link-to-ghec-trial %}{% endif %} diff --git a/data/ui.yml b/data/ui.yml index d1e0b5122a2f..37bc6892fe8e 100644 --- a/data/ui.yml +++ b/data/ui.yml @@ -42,6 +42,7 @@ search: clear_search_query: Clear view_all_search_results: View more results no_results_found: No results found + search_docs_with_query: Search docs for "{{query}}" ai: disclaimer: Copilot uses AI. Check for mistakes by reviewing the links in the response. references: References from these articles diff --git a/src/fixtures/fixtures/data/ui.yml b/src/fixtures/fixtures/data/ui.yml index d1e0b5122a2f..37bc6892fe8e 100644 --- a/src/fixtures/fixtures/data/ui.yml +++ b/src/fixtures/fixtures/data/ui.yml @@ -42,6 +42,7 @@ search: clear_search_query: Clear view_all_search_results: View more results no_results_found: No results found + search_docs_with_query: Search docs for "{{query}}" ai: disclaimer: Copilot uses AI. Check for mistakes by reviewing the links in the response. references: References from these articles diff --git a/src/search/components/helpers/execute-search-actions.ts b/src/search/components/helpers/execute-search-actions.ts index 70a60d558312..6d44e601efe9 100644 --- a/src/search/components/helpers/execute-search-actions.ts +++ b/src/search/components/helpers/execute-search-actions.ts @@ -98,7 +98,7 @@ export async function executeCombinedSearch( // Allow the caller to pass in an AbortSignal to cancel the request signal: abortSignal || undefined, }) - if (!response.ok) { + if (!response?.ok) { throw new Error( `Failed to fetch ai autocomplete search results.\nStatus ${response.status}\n${response.statusText}`, ) diff --git a/src/search/components/hooks/useAISearchAutocomplete.ts b/src/search/components/hooks/useAISearchAutocomplete.ts index 48f8a2cff2fe..49940db0d583 100644 --- a/src/search/components/hooks/useAISearchAutocomplete.ts +++ b/src/search/components/hooks/useAISearchAutocomplete.ts @@ -89,6 +89,17 @@ export function useCombinedSearchResults({ return } + // If there is an existing search error, don't return any results + if (searchError) { + setSearchOptions({ + aiAutocompleteOptions: [], + generalSearchResults: [], + totalGeneralSearchResults: 0, + }) + setSearchLoading(false) + return + } + // Create a new AbortController for the new request const controller = new AbortController() abortControllerRef.current = controller @@ -120,6 +131,11 @@ export function useCombinedSearchResults({ } console.error(error) setSearchError(true) + setSearchOptions({ + aiAutocompleteOptions: [], + generalSearchResults: [], + totalGeneralSearchResults: 0, + }) setSearchLoading(false) } }, diff --git a/src/search/components/input/SearchOverlay.tsx b/src/search/components/input/SearchOverlay.tsx index d158574459c8..abae8c47c34d 100644 --- a/src/search/components/input/SearchOverlay.tsx +++ b/src/search/components/input/SearchOverlay.tsx @@ -123,6 +123,10 @@ export function SearchOverlay({ useEffect(() => { let timer: ReturnType + if (autoCompleteSearchError) { + return setShowSpinner(false) + } + // If it's the initial fetch, show the spinner immediately if (!aiAutocompleteOptions.length && !generalSearchResults.length) { return setShowSpinner(true) @@ -137,7 +141,12 @@ export function SearchOverlay({ return () => { clearTimeout(timer) } - }, [searchLoading, aiAutocompleteOptions.length, generalSearchResults.length]) + }, [ + searchLoading, + aiAutocompleteOptions.length, + generalSearchResults.length, + autoCompleteSearchError, + ]) // Filter out any options that match the local query and replace them with a custom user query option that include isUserQuery: true const filteredAIOptions = aiAutocompleteOptions.filter( @@ -147,7 +156,14 @@ export function SearchOverlay({ // Create new arrays that prepend the user input const userInputOptions = urlSearchInputQuery.trim() !== '' - ? [{ term: urlSearchInputQuery, highlights: [], isUserQuery: true }] + ? [ + { + term: urlSearchInputQuery, + title: urlSearchInputQuery, + highlights: [], + isUserQuery: true, + }, + ] : [] // Combine options for key navigation @@ -165,6 +181,13 @@ export function SearchOverlay({ title: t('search.overlay.view_all_search_results'), isViewAllResults: true, } as any) + } else if (autoCompleteSearchError) { + if (urlSearchInputQuery.trim() !== '') { + generalOptionsWithViewStatus.push({ + ...(userInputOptions[0] || {}), + isSearchDocsOption: true, + } as unknown as GeneralSearchHit) + } } else if (urlSearchInputQuery.trim() !== '' && !searchLoading) { generalOptionsWithViewStatus.push({ title: t('search.overlay.no_results_found'), @@ -205,6 +228,7 @@ export function SearchOverlay({ aiSearchError, aiReferences, isAskAIState, + autoCompleteSearchError, ]) // Rather than use `initialFocusRef` to have our Primer component auto-focus our input @@ -432,7 +456,10 @@ export function SearchOverlay({ ) { const selectedItem = combinedOptions[selectedIndex] if (selectedItem.group === 'general') { - if ((selectedItem.option as GeneralSearchHitWithOptions).isViewAllResults) { + if ( + (selectedItem.option as GeneralSearchHitWithOptions).isViewAllResults || + (selectedItem.option as GeneralSearchHitWithOptions).isSearchDocsOption + ) { pressedOnContext = 'view-all' performGeneralSearch() } else { @@ -500,7 +527,11 @@ export function SearchOverlay({ className={styles.suggestionsList} ref={suggestionsListHeightRef} sx={{ - minHeight: `${previousSuggestionsListHeight}px`, + // When there is an error and nothing is typed in by the user, show an empty list with no height + minHeight: + autoCompleteSearchError && !generalOptionsWithViewStatus.length + ? '0' + : `${previousSuggestionsListHeight}px`, }} > {/* Always show the AI Search UI error message when it is needed */} @@ -533,27 +564,9 @@ export function SearchOverlay({ )} - {/* Only show the autocomplete search UI error message in Dev */} - {process.env.NODE_ENV === 'development' && autoCompleteSearchError && !aiSearchError && ( - - - - )} {renderSearchGroups( t, - autoCompleteSearchError ? [] : generalOptionsWithViewStatus, + generalOptionsWithViewStatus, aiSearchError ? [] : aiOptionsWithUserInput, generalSearchResultOnSelect, aiSearchOptionOnSelect, @@ -713,6 +726,7 @@ interface AutocompleteSearchHitWithUserQuery extends AutocompleteSearchHit { interface GeneralSearchHitWithOptions extends GeneralSearchHit { isViewAllResults?: boolean isNoResultsFound?: boolean + isSearchDocsOption?: boolean } // Render the autocomplete suggestions with AI suggestions first, headings, and a divider between the two @@ -824,6 +838,40 @@ function renderSearchGroups( ) // There should be no more items after the no results found item break + // This is a special case where there is an error loading search results and we want to be able to search the docs using the user's query + } else if (option.isSearchDocsOption) { + const isActive = selectedIndex === index + items.push( + performGeneralSearch()} + aria-label={t('search.overlay.search_docs_with_query').replace('{query}', option.title)} + ref={(element) => { + if (listElementsRef.current) { + listElementsRef.current[index] = element + } + }} + > + + + + {option.title} + + + + , + ) } else if (option.title) { const isActive = selectedIndex === index items.push( @@ -877,13 +925,15 @@ function renderSearchGroups( // Don't show the bottom divider if: // 1. We are in the AI could not answer state // 2. We are in the AI Search error state + // 3. There are no AI suggestions to show in suggestions state if ( !askAIState.aiCouldNotAnswer && !askAIState.aiSearchError && (!askAIState.isAskAIState || generalSearchOptions.filter( (option) => !option.isViewAllResults && !option.isNoResultsFound, - ).length) + ).length) && + aiOptionsWithUserInput.length ) { groups.push() }