diff --git a/browser/resources/brave_education/brave_education_app.ts b/browser/resources/brave_education/brave_education_app.ts index 78b14f3543d..c0e7f7b3afa 100644 --- a/browser/resources/brave_education/brave_education_app.ts +++ b/browser/resources/brave_education/brave_education_app.ts @@ -74,7 +74,7 @@ export class BraveEducationAppElement extends CrLitElement { BraveEducationProxyImpl.getInstance() .handler.getServerUrl() - .then(({ url }: { url: Url }) => this.handleUrlResult_(url.url)) + .then(({ url }: { url: Url }) => this.handleUrlResult_(url)) } override disconnectedCallback() { diff --git a/browser/resources/brave_new_tab_page_refresh/components/search/search_results.tsx b/browser/resources/brave_new_tab_page_refresh/components/search/search_results.tsx index e151ca234f2..7feb3112867 100644 --- a/browser/resources/brave_new_tab_page_refresh/components/search/search_results.tsx +++ b/browser/resources/brave_new_tab_page_refresh/components/search/search_results.tsx @@ -27,7 +27,7 @@ function MatchImage(props: { match: AutocompleteMatch }) { ) } if (!imageUrl) { - if (!iconUrl.url) { + if (!iconUrl) { return ( ) } diff --git a/browser/resources/brave_new_tab_page_refresh/stories/mock_search_store.ts b/browser/resources/brave_new_tab_page_refresh/stories/mock_search_store.ts index ccee1f6344d..308b1621f52 100644 --- a/browser/resources/brave_new_tab_page_refresh/stories/mock_search_store.ts +++ b/browser/resources/brave_new_tab_page_refresh/stories/mock_search_store.ts @@ -87,25 +87,25 @@ export function createSearchStore() { allowedToBeDefaultMatch: false, contents: 'contents 1', description: 'description 1', - iconUrl: { url: '' }, + iconUrl: '', imageUrl: '', - destinationUrl: { url: '' }, + destinationUrl: '', }, { allowedToBeDefaultMatch: true, contents: 'contents 2', description: 'Ask Leo', - iconUrl: { url: '' }, + iconUrl: '', imageUrl: '', - destinationUrl: { url: '' }, + destinationUrl: '', }, { allowedToBeDefaultMatch: true, contents: query, description: engine, - iconUrl: { url: '' }, + iconUrl: '', imageUrl: '', - destinationUrl: { url: '' }, + destinationUrl: '', }, ], }) diff --git a/browser/resources/settings/brave_leo_assistant_page/model_config_ui.ts b/browser/resources/settings/brave_leo_assistant_page/model_config_ui.ts index 15ba84dabaa..5bf89e55ea4 100644 --- a/browser/resources/settings/brave_leo_assistant_page/model_config_ui.ts +++ b/browser/resources/settings/brave_leo_assistant_page/model_config_ui.ts @@ -154,7 +154,7 @@ export class ModelConfigUI extends ModelConfigUIBase { // Determined at runtime based on contextSize longConversationWarningCharacterLimit: -1, modelSystemPrompt: this.modelSystemPrompt, - endpoint: mojomUrl, + endpoint: mojomUrl.toString(), apiKey: this.apiKey } }, @@ -164,9 +164,9 @@ export class ModelConfigUI extends ModelConfigUIBase { supportsTools: false, isSuggestedModel: false, isNearModel: false, - } + }; - this.fire('save', { modelConfig }) + this.fire('save', {modelConfig}) } handleCloseClick_() { @@ -243,16 +243,16 @@ export class ModelConfigUI extends ModelConfigUIBase { private onModelItemChange_(newValue: mojom.Model | null) { if (newValue?.options.customModelOptions) { - this.label = newValue.displayName + this.label = newValue.displayName; this.modelRequestName = - newValue.options.customModelOptions.modelRequestName + newValue.options.customModelOptions.modelRequestName; this.contextSize = - newValue.options.customModelOptions.contextSize - this.endpointUrl = newValue.options.customModelOptions.endpoint.url - this.apiKey = newValue.options.customModelOptions.apiKey + newValue.options.customModelOptions.contextSize; + this.endpointUrl = newValue.options.customModelOptions.endpoint; + this.apiKey = newValue.options.customModelOptions.apiKey; this.modelSystemPrompt = - newValue.options.customModelOptions.modelSystemPrompt - this.hasVisionSupport = newValue.visionSupport + newValue.options.customModelOptions.modelSystemPrompt; + this.hasVisionSupport = newValue.visionSupport; } this.constructTokenEstimateString_() } diff --git a/browser/resources/settings/brave_leo_assistant_page/model_list_section.ts b/browser/resources/settings/brave_leo_assistant_page/model_list_section.ts index d653091ca4c..89dda782fc3 100644 --- a/browser/resources/settings/brave_leo_assistant_page/model_list_section.ts +++ b/browser/resources/settings/brave_leo_assistant_page/model_list_section.ts @@ -171,7 +171,7 @@ class ModelListSection extends ModelListSectionBase { // 2. Ollama sync preference is enabled // 3. Ollama is actually connected const isOllamaEndpoint = - model.options.customModelOptions?.endpoint.url === OLLAMA_ENDPOINT + model.options.customModelOptions?.endpoint === OLLAMA_ENDPOINT return !!(isOllamaEndpoint && ollamaSyncEnabled && isOllamaConnected) } } diff --git a/chromium_src/components/webui/chrome_urls/resources/app.html.ts.lit_mangler.ts b/chromium_src/components/webui/chrome_urls/resources/app.html.ts.lit_mangler.ts index 35bf03488d1..904b6458c96 100644 --- a/chromium_src/components/webui/chrome_urls/resources/app.html.ts.lit_mangler.ts +++ b/chromium_src/components/webui/chrome_urls/resources/app.html.ts.lit_mangler.ts @@ -35,11 +35,11 @@ mangleAll((element) => { if (!anchor) { throw new Error('[chrome_urls override] Missing anchor element') } - if (anchor.textContent !== '\${info.url.url}') { + if (anchor.textContent !== '\${info.url}') { throw new Error('[chrome_urls override] Unexpected anchor textContent') } - anchor.textContent = '\${info.url.url.replace(/chrome:/, "brave:")}' -}, x => x.text.includes('href="${info.url.url}"')) + anchor.textContent = '\${info.url.replace(/chrome:/, "brave:")}' +}, x => x.text.includes('href="${info.url}"')) // Rewrite inactive chrome URLs to use brave: scheme (these also appear under // the "List of Brave URLs" header) and rewrite internal debugging page URLs to @@ -50,11 +50,11 @@ mangleAll((element) => { if (!listItem) { throw new Error('[chrome_urls override] Missing list item element') } - if (listItem.textContent !== '\${info.url.url}') { + if (listItem.textContent !== '\${info.url}') { throw new Error('[chrome_urls override] Unexpected list item textContent') } - listItem.textContent = '\${info.url.url.replace(/chrome:/, "brave:")}' -}, x => x.text.includes('
  • ${info.url.url}
  • ')) + listItem.textContent = '\${info.url.replace(/chrome:/, "brave:")}' +}, x => x.text.includes('
  • ${info.url}
  • ')) // Rewrite command URLs to use brave: scheme (these appear under the // "Command URLs for Debug" header) @@ -63,8 +63,8 @@ mangle((element) => { if (!listItem) { throw new Error('[chrome_urls override] Missing list item element') } - if (listItem.textContent !== '\${url.url}') { + if (listItem.textContent !== '\${url}') { throw new Error('[chrome_urls override] Unexpected list item textContent') } - listItem.textContent = '\${url.url.replace(/chrome:/, "brave:")}' -}, x => x.text.includes('
  • ${url.url}
  • ')) + listItem.textContent = '\${url.replace(/chrome:/, "brave:")}' +}, x => x.text.includes('
  • ${url}
  • ')) diff --git a/components/brave_new_tab_ui/components/search/SearchResult.tsx b/components/brave_new_tab_ui/components/search/SearchResult.tsx index e323de1c849..12370feb277 100644 --- a/components/brave_new_tab_ui/components/search/SearchResult.tsx +++ b/components/brave_new_tab_ui/components/search/SearchResult.tsx @@ -109,7 +109,7 @@ function Image({ match, isAskLeo }: { match: AutocompleteMatch, isAskLeo: boolea // url machinery. const isGeneric = !match.imageUrl return isGeneric - ? + ? : match.imageUrl.startsWith('chrome') ? : @@ -120,7 +120,7 @@ export default function SearchResult({ match, selected, onClick }: Props) { const description = match.swapContentsAndDescription ? match.contents : match.description const isAskLeo = description === getLocale('searchAskLeo') - const result = { + const result = { e.preventDefault() onClick(e) }}> diff --git a/components/brave_new_tab_ui/components/search/SearchResults.tsx b/components/brave_new_tab_ui/components/search/SearchResults.tsx index f963437a8a7..41221a3eb58 100644 --- a/components/brave_new_tab_ui/components/search/SearchResults.tsx +++ b/components/brave_new_tab_ui/components/search/SearchResults.tsx @@ -37,7 +37,7 @@ const Container = styled.div` // autocomplete result. const openMatch = (match: AutocompleteMatch, line: number, event: React.MouseEvent | KeyboardEvent, searchEngine?: SearchEngineInfo) => { if (line === -1) { - handleOpenURLClick(match.destinationUrl.url, event) + handleOpenURLClick(match.destinationUrl, event) return } @@ -64,9 +64,7 @@ const useUrlWhatYouTyped = (query: string) => React.useMemo(() => { validateScheme(url.toString()) return { - destinationUrl: { - url: url.toString() - }, + destinationUrl: url.toString(), contents: url.toString(), description: '', imageUrl: `chrome://favicon/size/64@1x/${q.toString()}`, diff --git a/test/BUILD.gn b/test/BUILD.gn index 9a97fae0d45..3c75dceb98a 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -1295,7 +1295,6 @@ test("brave_browser_tests") { "//brave/components/vector_icons", "//chrome:packed_resources", "//chrome/browser/apps/app_service", - "//chrome/browser/apps/app_service:constants", "//chrome/browser/themes", "//chrome/browser/ui/webui/side_panel/bookmarks:mojo_bindings", "//components/autofill/content/browser", diff --git a/tools/chromium_src/lit_mangler/__snapshots__/mangle.test.ts.snap b/tools/chromium_src/lit_mangler/__snapshots__/mangle.test.ts.snap index 3c1fe682854..7877a0f253d 100644 --- a/tools/chromium_src/lit_mangler/__snapshots__/mangle.test.ts.snap +++ b/tools/chromium_src/lit_mangler/__snapshots__/mangle.test.ts.snap @@ -653,10 +653,10 @@ exports[`mangled files should have up to date snapshots ./chromium_src/component - html\`
  • chrome://chrome-urls
  • \` : + html\`
  • brave://chrome-urls
  • \` : html\`\${info.enabled ? -- html\`
  • \${info.url.url}
  • \` : -- html\`
  • \${info.url.url}
  • \` -+ html\`
  • \${info.url.url.replace(/chrome:/, \\"brave:\\")}
  • \` : -+ html\`
  • \${info.url.url.replace(/chrome:/, \\"brave:\\")}
  • \` +- html\`
  • \${info.url}
  • \` : +- html\`
  • \${info.url}
  • \` ++ html\`
  • \${info.url.replace(/chrome:/, \\"brave:\\")}
  • \` : ++ html\`
  • \${info.url.replace(/chrome:/, \\"brave:\\")}
  • \` }\` }\`)} @@ -666,10 +666,10 @@ exports[`mangled files should have up to date snapshots ./chromium_src/component \` : ''} \${this.commandUrls_.length ? html\` @@ -679,8 +679,8 @@ exports[`mangled files should have up to date snapshots ./chromium_src/component address bar if you need them.

      -- \${this.commandUrls_.map(url => html\`
    • \${url.url}
    • \`)} -+ \${this.commandUrls_.map(url => html\`
    • \${url.url.replace(/chrome:/, \\"brave:\\")}
    • \`)} +- \${this.commandUrls_.map(url => html\`
    • \${url}
    • \`)} ++ \${this.commandUrls_.map(url => html\`
    • \${url.replace(/chrome:/, \\"brave:\\")}
    • \`)}
    \` : ''}\`; } "