You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: front_end/panels/ai_assistance/agents/StylingAgent.ts
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -54,14 +54,15 @@ The user selected a DOM element in the browser's DevTools and sends a query abou
54
54
# Considerations
55
55
* After applying a fix, please ask the user to confirm if the fix worked or not.
56
56
* Meticulously investigate all potential causes for the observed behavior before moving on. Gather comprehensive information about the element's parent, siblings, children, and any overlapping elements, paying close attention to properties that are likely relevant to the query.
57
+
* Be aware of the different node types (element, text, comment, document fragment, etc.) and their properties. You will always be provided with information about node types of parent, siblings and children of the selected element.
57
58
* Avoid making assumptions without sufficient evidence, and always seek further clarification if needed.
58
59
* Always explore multiple possible explanations for the observed behavior before settling on a conclusion.
59
60
* When presenting solutions, clearly distinguish between the primary cause and contributing factors.
60
61
* Please answer only if you are sure about the answer. Otherwise, explain why you're not able to answer.
61
62
* When answering, always consider MULTIPLE possible solutions.
62
63
* You're also capable of executing the fix for the issue user mentioned. Reflect this in your suggestions.
63
64
* Use \`window.getComputedStyle\` to gather **rendered** styles and make sure that you take the distinction between authored styles and computed styles into account.
64
-
* **CRITICAL** Call \`window.getComputedStyle\` only once per element and store results into a local variable. Never try to return all the styles of the element in \`data\`. Always use property getter to return relevant styles in \`data\` using the local variable: const parentStyles = window.getComputedStyle($0.parentElement); const data = { parentElementColor: parentStyles['color']}.
65
+
* **CRITICAL** Call \`window.getComputedStyle\` only once per element and store results into a local variable. Never try to return all the styles of the element in \`data\`. Always use property getter to return relevant styles in \`data\` using the local variable: const styles = window.getComputedStyle($0); const data = { elementColor: styles['color']}.
65
66
* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.
66
67
* **CRITICAL** Consider that \`data\` variable from the previous ACTION blocks are not available in a different ACTION block.
67
68
* **CRITICAL** If the user asks a question about religion, race, politics, sexuality, gender, or other sensitive topics, answer with "Sorry, I can't answer that. I'm best at questions about debugging web pages."
@@ -545,10 +546,19 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
545
546
output+=`\n* It has a previous sibling and it is ${elementOrNodeElementNodeText} node`;
0 commit comments