This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-9579-ba8558bc36facee2ed6d50185300f7afce31b330 in repository https://gitbox.apache.org/repos/asf/texera.git
commit 41e25f41076398617bc75cadb2be236a2e8a2a7c Author: Jiadong Bai <[email protected]> AuthorDate: Tue Nov 24 21:39:47 2026 +0000 fix(frontend): unfreeze the agent panel on first open (#9579) ### What changes were proposed in this PR? The "+ Agent" form in the AI Agents panel did not respond when the page loaded with the panel minimized. Clicking a model card did nothing, so no agent could be created. While minimized, the panel's body is hidden. ng-zorro 21 hides an inactive tab pane only when its fade-out transition ends, and no transition runs in a hidden element. Each listed agent's chat pane stayed, invisible, over the form and took its clicks. The agent tabs no longer animate, so an inactive pane is hidden at once. On "Iris species report", which already has the agent "Iris helper", the page loads with the panel minimized. Before, clicking the model card does nothing, and "Create Agent" stays grey: <img width="1080" height="800" alt="Before: clicking the model card does nothing, and Create Agent stays grey" src="https://github.com/user-attachments/assets/99963727-cfea-49cb-a9d2-9875ed5419e5" /> After, the card is selected, and "Create Agent" opens the new agent's chat: <img width="1080" height="800" alt="After: the model card is selected, and Create Agent opens the new agent's chat" src="https://github.com/user-attachments/assets/7be11880-2c18-437d-81c2-1a0db440cdbe" /> ### Any related issues, documentation, discussions? Part of #9575: this fixes the model card that does not respond, and #9604 fixes the chats that cannot be reopened. ### How was this PR tested? A new spec renders the panel with animations on, as the app runs, and fails without the fix; the existing specs run with animations off. Also run in headless Chromium against a local stack with a real model. On `main` every click over the form lands on the invisible pane; with this change an agent is created and answers. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Fable 5.2, Claude Opus 5.5) --- .../agent/agent-panel/agent-panel.component.html | 5 ++++- .../agent/agent-panel/agent-panel.component.spec.ts | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/workspace/component/agent/agent-panel/agent-panel.component.html b/frontend/src/app/workspace/component/agent/agent-panel/agent-panel.component.html index 671500a407..d2cf613084 100644 --- a/frontend/src/app/workspace/component/agent/agent-panel/agent-panel.component.html +++ b/frontend/src/app/workspace/component/agent/agent-panel/agent-panel.component.html @@ -72,10 +72,13 @@ AI Agents </h4> - <!-- Tabs --> + <!-- Tabs. Not animated: an animated pane is hidden only once its fade-out transition ends, + and none ends while this panel is docked ([hidden] above). The panes of the agents + loaded meanwhile would stay, invisible, over the registration tab and take its clicks. --> <nz-tabs [nzSelectedIndex]="selectedTabIndex" (nzSelectedIndexChange)="onTabSelectChange($event)" + [nzAnimated]="false" class="agent-tabs" nzType="card"> <ng-template nzTabBarExtraContent="end"> diff --git a/frontend/src/app/workspace/component/agent/agent-panel/agent-panel.component.spec.ts b/frontend/src/app/workspace/component/agent/agent-panel/agent-panel.component.spec.ts index 38d4660412..128ecba274 100644 --- a/frontend/src/app/workspace/component/agent/agent-panel/agent-panel.component.spec.ts +++ b/frontend/src/app/workspace/component/agent/agent-panel/agent-panel.component.spec.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Component, EventEmitter, Input, Output } from "@angular/core"; +import { ANIMATION_MODULE_TYPE, Component, EventEmitter, Input, Output } from "@angular/core"; import { ComponentFixture, TestBed } from "@angular/core/testing"; import { HttpClientTestingModule } from "@angular/common/http/testing"; import { NoopAnimationsModule } from "@angular/platform-browser/animations"; @@ -303,6 +303,22 @@ describe("AgentPanelComponent", () => { expect(component.width).toBe(0); expect(fixture.nativeElement.querySelector("#agent-docked-button")).toBeTruthy(); }); + + it("hides an agent's pane at once while docked, so it cannot stay over the registration tab", () => { + // These specs run with NoopAnimationsModule; the app does not. With pane animations on, + // ng-zorro hides an inactive pane only once its fade-out transition has ended, and none + // ends inside the docked panel's hidden body (nor in jsdom). The pane then stayed, + // invisible, over the registration tab and took every click. + TestBed.overrideProvider(ANIMATION_MODULE_TYPE, { useValue: "BrowserAnimations" }); + agentService.agentList = [makeAgent("a")]; + createComponent(); + expect((fixture.nativeElement.querySelector("#content") as HTMLElement).hidden).toBe(true); + + const panes = Array.from(fixture.nativeElement.querySelectorAll(".ant-tabs-tabpane")) as HTMLElement[]; + expect(panes.length).toBe(2); + expect(panes[0].classList.contains("ant-tabs-tabpane-active")).toBe(true); + expect(panes[1].classList.contains("ant-tabs-tabpane-hidden")).toBe(true); + }); }); describe("onAgentCreated", () => {
