commit c56c1bde649fdf2dcad428e5eeae25b9d87eb505 parent d71f8bdc0e4b8bf948c353ecf60dc52052057cfb Author: Elissa Cha <echa@mozilla.com> Date: Thu, 9 Oct 2025 21:08:05 +0000 Bug 1993099 - Add Hide / Show functionality to tool call logs r=Mardak,firefox-ai-ml-reviewers Differential Revision: https://phabricator.services.mozilla.com/D268046 Diffstat:
| M | browser/components/genai/content/smart-assist.mjs | | | 35 | ++++++++++++++++++++--------------- |
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/browser/components/genai/content/smart-assist.mjs b/browser/components/genai/content/smart-assist.mjs @@ -179,6 +179,10 @@ export class SmartAssist extends MozLitElement { } render() { + const iconSrc = this.showLog + ? "chrome://global/skin/icons/arrow-down.svg" + : "chrome://global/skin/icons/arrow-up.svg"; + return html` <link rel="stylesheet" @@ -220,30 +224,31 @@ export class SmartAssist extends MozLitElement { <span class="log-title">Log</span> <moz-button type="ghost" - iconSrc="chrome://global/skin/icons/arrow-down.svg" + iconSrc=${iconSrc} @click=${() => { this.showLog = !this.showLog; }} > </moz-button> </div> - <div class="log-entries"> - ${this.logState.map( - data => - html`<div class="log-entry"> - <div><b>Message</b> : ${data.content}</div> - <div><b>Date</b> : ${data.date}</div> - <div> - <b>Tool Response</b> : - ${JSON.stringify(data.result)} - </div> - </div>` - )} - </div> + ${this.showLog + ? html` <div class="log-entries"> + ${this.logState.map( + data => + html`<div class="log-entry"> + <div><b>Message</b> : ${data.content}</div> + <div><b>Date</b> : ${data.date}</div> + <div> + <b>Tool Response</b> : + ${JSON.stringify(data.result)} + </div> + </div>` + )} + </div>` + : html``} </div>` : html`` } - </div> <!-- User Input -->