Skip to content

Commit

Permalink
Fix typos in AI Assistance panel
Browse files Browse the repository at this point in the history
Bug: none
Change-Id: Iab6d98100e40e7401751a603bbd4795ff6307f8e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6157256
Reviewed-by: Alex Rudenko <[email protected]>
Commit-Queue: Nikolay Vitkov <[email protected]>
Auto-Submit: Nikolay Vitkov <[email protected]>
Commit-Queue: Alex Rudenko <[email protected]>
  • Loading branch information
Lightning00Blade authored and Devtools-frontend LUCI CQ committed Jan 8, 2025
1 parent c689358 commit 2c14405
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion front_end/panels/ai_assistance/ExtensionScope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const functions = `async function setElementStyles(el, styles) {
// Remove inline styles with the same keys so that the edit applies.
for (const [key, value] of Object.entries(styles)) {
// if it's kebap case.
// if it's kebab case.
el.style.removeProperty(key);
// If it's camel case.
el.style[key] = '';
Expand Down
2 changes: 1 addition & 1 deletion front_end/panels/ai_assistance/agents/AiAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export abstract class ConversationContext<T> {

/**
* This method is called at the start of `AiAgent.run`.
* It will be overriden in subclasses to fetch data related to the context item.
* It will be overridden in subclasses to fetch data related to the context item.
*/
async refresh(): Promise<void> {
return;
Expand Down
8 changes: 4 additions & 4 deletions front_end/panels/ai_assistance/agents/NetworkAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,11 @@ export function formatRequestInitiatorChain(request: SDK.NetworkRequest.NetworkR
let lineStart = '- URL: ';
const initiators = Logs.NetworkLog.NetworkLog.instance().initiatorGraphForRequest(request).initiators;

for (const initator of Array.from(initiators).reverse()) {
initiatorChain = initiatorChain + lineStart + formatInitiatorUrl(initator.url(), allowedOrigin) + '\n';
for (const initiator of Array.from(initiators).reverse()) {
initiatorChain = initiatorChain + lineStart + formatInitiatorUrl(initiator.url(), allowedOrigin) + '\n';
lineStart = '\t' + lineStart;
if (initator === request) {
initiatorChain = formatRequestInitiated(initator, initiatorChain, lineStart, allowedOrigin);
if (initiator === request) {
initiatorChain = formatRequestInitiated(initiator, initiatorChain, lineStart, allowedOrigin);
break;
}
}
Expand Down
12 changes: 6 additions & 6 deletions front_end/panels/ai_assistance/agents/PatchAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
const preamble = `You are responsible for changing the source code on behalf of the user.
The user query defines what changes are to be made.
You have a number of functions to get information about source files in the project.
Use those functions to fullful the user query.
Use those functions to fulfill the user query.
## Step-by-step instructions
Expand Down Expand Up @@ -149,7 +149,7 @@ export class PatchAgent extends AiAgent<Workspace.Workspace.Project> {
properties: {
filepath: {
type: Host.AidaClient.ParametersTypes.STRING,
description: 'A file path that idenfities the file to get the content for',
description: 'A file path that identifies the file to get the content for',
nullable: false,
},
},
Expand Down Expand Up @@ -194,7 +194,7 @@ export class PatchAgent extends AiAgent<Workspace.Workspace.Project> {
properties: {
filepath: {
type: Host.AidaClient.ParametersTypes.STRING,
description: 'A file path that idenfities the file',
description: 'A file path that identifies the file',
nullable: false,
},
content: {
Expand All @@ -219,7 +219,7 @@ export class PatchAgent extends AiAgent<Workspace.Workspace.Project> {
};
}
const content = params.content;
// TODO: we unespace some characters to restore the original
// TODO: we unescape some characters to restore the original
// content but this should be fixed upstream.
uiSourceCode.setContent(
content.replaceAll('\\n', '\n').replaceAll('\\"', '"').replaceAll('\\\'', '\''),
Expand Down Expand Up @@ -277,14 +277,14 @@ export class PatchAgent extends AiAgent<Workspace.Workspace.Project> {
return [...this.#history];
}

override async * run(initalQuery: string, options: {
override async * run(initialQuery: string, options: {
signal?: AbortSignal, selected: ConversationContext<Workspace.Workspace.Project>|null,
}): AsyncGenerator<ResponseData, void, void> {
await options.selected?.refresh();

this.#project = options.selected ?? undefined;

let query: Host.AidaClient.Part = {text: initalQuery};
let query: Host.AidaClient.Part = {text: initialQuery};

// Request is built here to capture history up to this point.
let request = this.buildRequest(query);
Expand Down
2 changes: 1 addition & 1 deletion front_end/panels/ai_assistance/components/ChatView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ export class ChatView extends HTMLElement {
}

if (ev.key === 'Enter' && !ev.shiftKey) {
// Do not go to a new line whenver Shift + Enter is pressed.
// Do not go to a new line whenever Shift + Enter is pressed.
ev.preventDefault();
// Only submit the text when there isn't a request already in flight.
if (!this.#props.isLoading) {
Expand Down

0 comments on commit 2c14405

Please sign in to comment.