Skip to content

Commit b340107

Browse files
committed
perf: defer AI assist component until interaction with button
1 parent 9ea739e commit b340107

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

report-app/src/app/pages/report-viewer/report-viewer.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,17 @@ <h4>Repair System Prompt</h4>
173173
</expansion-panel>
174174

175175
@if (report.details.summary.aiSummary !== undefined) {
176-
<button class="fab" (click)="isAiAssistantVisible.set(true)">
176+
<button #aiAssistButton class="fab" (click)="isAiAssistantVisible.set(true)">
177177
<span class="material-symbols-outlined">smart_toy</span>
178178
</button>
179179

180-
<app-ai-assistant
181-
[class.hidden]="!isAiAssistantVisible()"
182-
[reportGroupId]="reportGroupId()"
183-
(close)="isAiAssistantVisible.set(false)"
184-
/>
180+
@defer (on interaction(aiAssistButton)) {
181+
<app-ai-assistant
182+
[class.hidden]="!isAiAssistantVisible()"
183+
[reportGroupId]="reportGroupId()"
184+
(close)="isAiAssistantVisible.set(false)"
185+
/>
186+
}
185187
}
186188

187189
@if (missingDeps().length > 0) {
@@ -346,6 +348,8 @@ <h5>
346348

347349

348350

351+
352+
349353
}}%)
350354
</span>
351355
</div>

0 commit comments

Comments
 (0)