From ec1ced7abd34263e6c523d8e0ce1c8081c151873 Mon Sep 17 00:00:00 2001 From: go165 <196723798+go165@users.noreply.github.com> Date: Sun, 14 Jun 2026 14:23:16 +0800 Subject: [PATCH] feat(client): show loaded tool count --- client/src/components/ToolsTab.tsx | 2 +- client/src/components/__tests__/ToolsTab.test.tsx | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 15b85fd67..fdf5cc64f 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -300,7 +300,7 @@ const ToolsTab = ({ )} - title="Tools" + title={tools.length > 0 ? `Tools (${tools.length})` : "Tools"} buttonText={nextCursor ? "List More Tools" : "List Tools"} isButtonDisabled={!nextCursor && tools.length > 0} /> diff --git a/client/src/components/__tests__/ToolsTab.test.tsx b/client/src/components/__tests__/ToolsTab.test.tsx index 5678914d6..468207854 100644 --- a/client/src/components/__tests__/ToolsTab.test.tsx +++ b/client/src/components/__tests__/ToolsTab.test.tsx @@ -84,6 +84,20 @@ describe("ToolsTab", () => { ); }; + it("should show the loaded tool count in the tools list title", () => { + renderToolsTab(); + + expect( + screen.getByRole("heading", { name: "Tools (4)" }), + ).toBeInTheDocument(); + }); + + it("should omit the tool count before tools are loaded", () => { + renderToolsTab({ tools: [] }); + + expect(screen.getByRole("heading", { name: "Tools" })).toBeInTheDocument(); + }); + it("should reset input values when switching tools", async () => { const { rerender } = renderToolsTab({ selectedTool: mockTools[0],