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-9393-8420565e66fd226bb9158fd41aed894d41da70a1 in repository https://gitbox.apache.org/repos/asf/texera.git
commit 0ccb3cddcf7281e9e8f826f7643b5a9ebdd0667a Author: Xinyuan Lin <[email protected]> AuthorDate: Tue Nov 10 18:19:15 2026 +0000 refactor(frontend): remove dead step-detail modal leftovers (#9393) ### What changes were proposed in this PR? Removes the unused parts of the agent panel's `ReActStepDetailModalComponent`. **+1/−97 lines.** There is no behaviour change. - **The `agentId` input.** `agent-chat` binds it, but neither the modal's class nor its template reads it, so the binding goes too. - **`getMessageRoleColor` and `getToolCallStrings`,** with the private `formatAsFunction` that only the latter calls. The template never calls them. Only their own spec cases did, and those three cases go with them. - **`react-step-detail-modal.component.scss` and its `styleUrls` entry.** The file holds only the license header and one comment, so it emits no styles. The helpers the template does call (`getTextFromMessage`, `getToolCallSummaries`, the tool-result and operator-access helpers) and their spec cases stay. ### History | | | | --- | --- | | **Introduced by** | #4495 (2026-04-28), "feat(agent-service): add `agent-service` that manages LLM agents", together with the modal | | **Usage removed by** | **never used**. Only spec cases (#5612) ever called the two helpers | They have been unused for the six months since they were added. ### Any related issues, documentation, discussions? Closes #9392. ### How was this PR tested? No new tests. The modal's remaining cases stay. From `frontend/`: - `npx ng test --watch=false --include='**/react-step-detail-modal.component.spec.ts' --include='**/agent-chat.component.spec.ts' --include='**/agent-panel.component.spec.ts'`: 3 files, 125 tests, all pass. The last two specs cover the modal's host (`agent-chat`) and the panel around it. - `npx tsc --noEmit -p src/tsconfig.app.json` and `-p src/tsconfig.spec.json`: clean. - `yarn format:ci`: clean. - `yarn build` (production, AOT): success. To re-check: ``` git grep -n -E "getMessageRoleColor|getToolCallStrings|formatAsFunction|react-step-detail-modal.component.scss" # no hits git grep -n agentId -- frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal # no hits ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- .../agent-chat/agent-chat.component.html | 3 +- .../react-step-detail-modal.component.scss | 20 ---------- .../react-step-detail-modal.component.spec.ts | 29 -------------- .../react-step-detail-modal.component.ts | 46 ---------------------- 4 files changed, 1 insertion(+), 97 deletions(-) diff --git a/frontend/src/app/workspace/component/agent/agent-panel/agent-chat/agent-chat.component.html b/frontend/src/app/workspace/component/agent/agent-panel/agent-chat/agent-chat.component.html index 75f67693c0..62de7296be 100644 --- a/frontend/src/app/workspace/component/agent/agent-panel/agent-chat/agent-chat.component.html +++ b/frontend/src/app/workspace/component/agent/agent-panel/agent-chat/agent-chat.component.html @@ -231,8 +231,7 @@ <!-- ReAct Step Detail Modal --> <texera-react-step-detail-modal [(visible)]="isDetailsModalVisible" - [step]="selectedResponse" - [agentId]="agentInfo.id"> + [step]="selectedResponse"> </texera-react-step-detail-modal> <!-- System Info Modal (with editing capabilities) --> diff --git a/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.scss b/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.scss deleted file mode 100644 index d4ea51daaa..0000000000 --- a/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.scss +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Styles for ReActStep detail modal diff --git a/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.spec.ts b/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.spec.ts index 45fbad4d6f..a4bed584aa 100644 --- a/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.spec.ts +++ b/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.spec.ts @@ -180,15 +180,6 @@ describe("ReActStepDetailModalComponent", () => { }); }); - describe("getMessageRoleColor", () => { - it("maps known roles and falls back to default", () => { - expect(component.getMessageRoleColor("user")).toBe("blue"); - expect(component.getMessageRoleColor("assistant")).toBe("orange"); - expect(component.getMessageRoleColor("tool")).toBe("green"); - expect(component.getMessageRoleColor("system")).toBe("default"); - }); - }); - describe("getTextFromMessage", () => { it("returns empty string when there is no content", () => { expect(component.getTextFromMessage(null)).toBe(""); @@ -231,26 +222,6 @@ describe("ReActStepDetailModalComponent", () => { }); }); - describe("getToolCallStrings (function-call formatting)", () => { - it("renders tool calls as toolName(key=value, ...)", () => { - const msg = { - content: [{ type: "tool-call", toolName: "filter", args: { col: "age", n: 5 } }], - }; - expect(component.getToolCallStrings(msg)).toEqual(['filter(col="age", n=5)']); - }); - - it("truncates long string and non-string argument values", () => { - const longString = "a".repeat(80); - const longArray = Array.from({ length: 40 }, (_, i) => i); - const msg = { - content: [{ type: "tool-call", toolName: "t", args: { s: longString, arr: longArray } }], - }; - const [rendered] = component.getToolCallStrings(msg); - expect(rendered).toContain(`s="${"a".repeat(60)}..."`); - expect(rendered).toContain(`arr=${JSON.stringify(longArray).substring(0, 60)}...`); - }); - }); - describe("getToolResultFullItems / getToolResultItems", () => { function toolMessage(): any { return { diff --git a/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.ts b/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.ts index b9a08a19f4..ce5d8afb1e 100644 --- a/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.ts +++ b/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.ts @@ -34,7 +34,6 @@ import { NzCollapseComponent, NzCollapsePanelComponent } from "ng-zorro-antd/col @Component({ selector: "texera-react-step-detail-modal", templateUrl: "./react-step-detail-modal.component.html", - styleUrls: ["./react-step-detail-modal.component.scss"], imports: [ NzModalComponent, NzModalContentDirective, @@ -54,7 +53,6 @@ import { NzCollapseComponent, NzCollapsePanelComponent } from "ng-zorro-antd/col export class ReActStepDetailModalComponent { @Input() visible: boolean = false; @Input() step: ReActStep | null = null; - @Input() agentId: string | null = null; @Output() visibleChange = new EventEmitter<boolean>(); public closeModal(): void { @@ -100,22 +98,6 @@ export class ReActStepDetailModalComponent { return !!step.operatorAccess && step.operatorAccess.size > 0; } - /** - * Get tag color for a message role. - */ - public getMessageRoleColor(role: string): string { - switch (role) { - case "user": - return "blue"; - case "assistant": - return "orange"; - case "tool": - return "green"; - default: - return "default"; - } - } - // ============================================================================ // Input Messages helpers // ============================================================================ @@ -153,34 +135,6 @@ export class ReActStepDetailModalComponent { }); } - /** - * Get tool calls from an assistant message, formatted as function-call strings. - */ - public getToolCallStrings(msg: any): string[] { - if (!msg?.content || !Array.isArray(msg.content)) return []; - return msg.content.filter((p: any) => p.type === "tool-call").map((p: any) => this.formatAsFunction(p)); - } - - /** - * Format a tool-call part as function-call notation: toolName(key=val, key=val) - */ - private formatAsFunction(part: any): string { - const args = part.args || part.input || {}; - const params = Object.entries(args) - .map(([k, v]) => { - let val: string; - if (typeof v === "string") { - val = v.length > 60 ? `"${v.substring(0, 60)}..."` : `"${v}"`; - } else { - const s = JSON.stringify(v); - val = s.length > 60 ? s.substring(0, 60) + "..." : s; - } - return `${k}=${val}`; - }) - .join(", "); - return `${part.toolName}(${params})`; - } - /** * Build a toolCallId → toolName map from all input messages. */
