Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
flex-direction: column;
background: #fafafa;
padding: 8px 12px;

&.compact {
padding: 6px 8px;
}
}

// Visualization rendering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
[style.width.px]="width"
[style.height.px]="height"
(nzResize)="onResize($event)"
(cdkDragStarted)="handleDragStart()"
[cdkDragFreeDragPosition]="dragPosition">
<!-- Minimize Button -->
<ul
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ describe("AgentPanelComponent", () => {
fixture.detectChanges();

expect(component.width).toBe(0);
expect(component.isDocked).toBe(true);
expect(fixture.nativeElement.querySelector("#agent-docked-button")).toBeTruthy();
});
});
Expand Down Expand Up @@ -581,13 +580,6 @@ describe("AgentPanelComponent", () => {
expect(component.width).toBe(700);
expect(component.height).toBe(560);
});

it("handleDragStart undocks the panel", () => {
createComponent();
component.isDocked = true;
component.handleDragStart();
expect(component.isDocked).toBe(false);
});
});

describe("panel settings persistence", () => {
Expand Down Expand Up @@ -640,7 +632,6 @@ describe("AgentPanelComponent", () => {

expect(style.cssText).toBe("transform: translate3d(15px, 15px, 0px);");
expect(component.returnPosition).toEqual({ x: -15, y: -15 });
expect(component.isDocked).toBe(false); // drag position (0,0) differs from (-15,-15)
});

it("counts as docked when the saved transform nets out to the origin", () => {
Expand All @@ -652,7 +643,6 @@ describe("AgentPanelComponent", () => {

expect(component.returnPosition.x === 0).toBe(true);
expect(component.returnPosition.y === 0).toBe(true);
expect(component.isDocked).toBe(true);
});

it("persists dimensions, docked flag and container style, and deactivates the agent on destroy", () => {
Expand Down Expand Up @@ -819,10 +809,6 @@ describe("AgentPanelComponent", () => {
expect(drag.freeDragPosition).toEqual({ x: 11, y: 22 });
// The whole box is draggable but only the <h4> title is a handle.
expect(fixture.debugElement.query(By.directive(CdkDragHandle)).nativeElement.id).toBe("title");

expect(component.isDocked).toBe(true);
drag.started.emit({ source: drag } as CdkDragStart);
expect(component.isDocked).toBe(false);
});

it("force-renders every tab body: the registration form and one chat per agent", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export class AgentPanelComponent implements OnInit, OnDestroy, OnChanges {
id = -1;
dragPosition = { x: 0, y: 0 };
returnPosition = { x: 0, y: 0 };
isDocked = true;

// Tab management
selectedTabIndex: number = 0; // 0 = registration tab, 1+ = agent tabs
Expand Down Expand Up @@ -183,7 +182,6 @@ export class AgentPanelComponent implements OnInit, OnDestroy, OnChanges {
} else {
// Close panel (dock it)
this.width = 0;
this.isDocked = true;
}
}

Expand Down Expand Up @@ -338,13 +336,6 @@ export class AgentPanelComponent implements OnInit, OnDestroy, OnChanges {
});
}

/**
* Handle drag start
*/
handleDragStart(): void {
this.isDocked = false;
}

/**
* Load panel settings from localStorage
*/
Expand Down Expand Up @@ -376,7 +367,6 @@ export class AgentPanelComponent implements OnInit, OnDestroy, OnChanges {
const translates = container.style.transform;
const [xOffset, yOffset] = calculateTotalTranslate3d(translates);
this.returnPosition = { x: -xOffset, y: -yOffset };
this.isDocked = this.dragPosition.x === this.returnPosition.x && this.dragPosition.y === this.returnPosition.y;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@ describe("AgentRegistrationComponent", () => {

expect(component.modelTypes).toEqual([MODEL]);
expect(component.isLoadingModels).toBe(false);
expect(component.hasLoadingError).toBe(false);
});

it("flags an error and notifies when no models are returned", () => {
fetchModelTypes.mockReturnValue(of([]));
fixture.detectChanges();

expect(component.isLoadingModels).toBe(false);
expect(component.hasLoadingError).toBe(true);
expect(notifyError).toHaveBeenCalledWith(expect.stringContaining("No models available"));
});

Expand All @@ -97,7 +95,6 @@ describe("AgentRegistrationComponent", () => {
fixture.detectChanges();

expect(component.isLoadingModels).toBe(false);
expect(component.hasLoadingError).toBe(true);
expect(notifyError).toHaveBeenCalledWith("Failed to fetch models: boom");
});

Expand All @@ -108,7 +105,6 @@ describe("AgentRegistrationComponent", () => {
fetchModelTypes.mockReturnValue(throwError(() => "backend unreachable"));
fixture.detectChanges();

expect(component.hasLoadingError).toBe(true);
expect(notifyError).toHaveBeenCalledWith("Failed to fetch models: backend unreachable");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export class AgentRegistrationComponent implements OnInit, OnDestroy {
public selectedModelType: string | null = null;
public customAgentName: string = "Texera Agent";
public isLoadingModels: boolean = false;
public hasLoadingError: boolean = false;
public computingUnitConnected: boolean = false;
public isCreating: boolean = false;

Expand All @@ -77,7 +76,6 @@ export class AgentRegistrationComponent implements OnInit, OnDestroy {

ngOnInit(): void {
this.isLoadingModels = true;
this.hasLoadingError = false;

this.computingUnitStatusService
.getStatus()
Expand All @@ -94,13 +92,11 @@ export class AgentRegistrationComponent implements OnInit, OnDestroy {
this.modelTypes = models;
this.isLoadingModels = false;
if (models.length === 0) {
this.hasLoadingError = true;
this.notificationService.error("No models available. Please check the LiteLLM configuration.");
}
},
error: (error: unknown) => {
this.isLoadingModels = false;
this.hasLoadingError = true;
const errorMessage = error instanceof Error ? error.message : String(error);
this.notificationService.error(`Failed to fetch models: ${errorMessage}`);
},
Expand Down
Loading