Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/app/components/side-panel/side-panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,22 @@ export class SidePanelComponent implements AfterViewInit, OnInit {
return this.selectedEvent() as Event | undefined;
});

ngAfterViewInit() {}
ngAfterViewInit() {
// The eval tab container doesn't exist until appName is set and the template renders.
// Watch for when appName becomes available to initialize the eval tab.
if (this.appName()) {
setTimeout(() => this.initEvalTab(), 500);
}

// Watch for appName changes to init when it becomes available
runInInjectionContext(this.environmentInjector, () => {
effect(() => {
if (this.appName()) {
setTimeout(() => this.initEvalTab(), 100);
}
}, { allowSignalWrites: true });
});
}

/**
* Dynamically create the eval tab. We must do this programmatically until
Expand All @@ -276,9 +291,10 @@ export class SidePanelComponent implements AfterViewInit, OnInit {
this.isEvalEnabledObs.pipe(first()).subscribe((isEvalEnabled) => {
if (isEvalEnabled) {
const container = this.evalTabContainer();
if (!container) return;
container.clear();

if (!container) {
return;
}

const evalTabComponent = container.createComponent(
this.evalTabComponentClass ?? EvalTabComponent, {
environmentInjector: this.environmentInjector,
Expand Down