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
5 changes: 5 additions & 0 deletions client/src/components/ListPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ const ListPane = <T extends object>({
<div className="flex items-center justify-between gap-4">
<h3 className="font-semibold dark:text-white flex-shrink-0">
{title}
{items.length > 0 && (
<span className="ml-2 text-xs font-medium text-muted-foreground">
({items.length})
</span>
)}
</h3>
<div className="flex items-center justify-end min-w-0 flex-1">
{!isSearchExpanded ? (
Expand Down
12 changes: 12 additions & 0 deletions client/src/components/__tests__/ListPane.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ describe("ListPane", () => {
expect(screen.getByText("Another Tool")).toBeInTheDocument();
});

it("should show item count when items are present", () => {
renderListPane();

expect(screen.getByText("(3)")).toBeInTheDocument();
});

it("should not show item count when no items", () => {
renderListPane({ items: [] });

expect(screen.queryByText("(0)")).not.toBeInTheDocument();
});

it("should render empty state when no items", () => {
renderListPane({ items: [] });

Expand Down