From a68933464bc991508b85e84e8deb53b162615580 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Wed, 1 Apr 2026 19:24:11 -0400 Subject: [PATCH] Add ListToggle and built-in search filtering to ResourceControls, move Export/Clear buttons to HistoryListPanel ResourceControls now manages its own search state internally and filters all three accordion sections (URIs, Templates, Subscriptions) by name and URI. Added ListToggle to expand/collapse all sections. Moved Export JSON and Clear All buttons from HistoryControls sidebar to the HistoryListPanel header for better proximity to the data they act on. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../HistoryControls.stories.tsx | 4 -- .../HistoryControls/HistoryControls.tsx | 18 +----- .../HistoryListPanel.stories.tsx | 2 + .../HistoryListPanel/HistoryListPanel.tsx | 35 ++++++++--- .../groups/LogControls/LogControls.tsx | 13 ++-- .../ResourceControls.stories.tsx | 3 - .../ResourceControls/ResourceControls.tsx | 60 +++++++++++++------ .../screens/HistoryScreen/HistoryScreen.tsx | 4 +- .../ResourcesScreen.stories.tsx | 2 - .../ResourcesScreen/ResourcesScreen.tsx | 6 -- .../ConnectedView/ConnectedView.stories.tsx | 2 - 11 files changed, 80 insertions(+), 69 deletions(-) diff --git a/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx b/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx index 14fa3df4..0e7910d8 100644 --- a/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx +++ b/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx @@ -15,8 +15,6 @@ export const Default: Story = { searchText: "", onSearchChange: fn(), onMethodFilterChange: fn(), - onClearAll: fn(), - onExport: fn(), }, }; @@ -26,7 +24,5 @@ export const WithFilters: Story = { methodFilter: "tools/call", onSearchChange: fn(), onMethodFilterChange: fn(), - onClearAll: fn(), - onExport: fn(), }, }; diff --git a/clients/web/src/components/groups/HistoryControls/HistoryControls.tsx b/clients/web/src/components/groups/HistoryControls/HistoryControls.tsx index 361a3215..dacb874b 100644 --- a/clients/web/src/components/groups/HistoryControls/HistoryControls.tsx +++ b/clients/web/src/components/groups/HistoryControls/HistoryControls.tsx @@ -1,4 +1,4 @@ -import { Button, Group, Select, Stack, TextInput, Title } from "@mantine/core"; +import { Select, Stack, TextInput, Title } from "@mantine/core"; const METHOD_OPTIONS = [ "tools/call", @@ -11,18 +11,11 @@ const METHOD_OPTIONS = [ "elicitation/create", ]; -const ToolbarButton = Button.withProps({ - variant: "light", - size: "sm", -}); - export interface HistoryControlsProps { searchText: string; methodFilter?: string; onSearchChange: (text: string) => void; onMethodFilterChange: (method: string) => void; - onClearAll: () => void; - onExport: () => void; } export function HistoryControls({ @@ -30,14 +23,10 @@ export function HistoryControls({ methodFilter, onSearchChange, onMethodFilterChange, - onClearAll, - onExport, }: HistoryControlsProps) { return ( History - - Search onMethodFilterChange(value ?? "")} clearable /> - - - Export JSON - Clear All - ); } diff --git a/clients/web/src/components/groups/HistoryListPanel/HistoryListPanel.stories.tsx b/clients/web/src/components/groups/HistoryListPanel/HistoryListPanel.stories.tsx index 3812150c..1acfcddb 100644 --- a/clients/web/src/components/groups/HistoryListPanel/HistoryListPanel.stories.tsx +++ b/clients/web/src/components/groups/HistoryListPanel/HistoryListPanel.stories.tsx @@ -8,6 +8,8 @@ const meta: Meta = { component: HistoryListPanel, args: { searchText: "", + onClearAll: fn(), + onExport: fn(), }, }; diff --git a/clients/web/src/components/groups/HistoryListPanel/HistoryListPanel.tsx b/clients/web/src/components/groups/HistoryListPanel/HistoryListPanel.tsx index e6a66def..a249572d 100644 --- a/clients/web/src/components/groups/HistoryListPanel/HistoryListPanel.tsx +++ b/clients/web/src/components/groups/HistoryListPanel/HistoryListPanel.tsx @@ -1,5 +1,13 @@ import { useMemo, useState } from "react"; -import { Group, Paper, ScrollArea, Stack, Text, Title } from "@mantine/core"; +import { + Button, + Group, + Paper, + ScrollArea, + Stack, + Text, + Title, +} from "@mantine/core"; import { HistoryEntry } from "../HistoryEntry/HistoryEntry"; import { ListToggle } from "../../elements/ListToggle/ListToggle"; import type { HistoryEntryProps } from "../HistoryEntry/HistoryEntry"; @@ -9,8 +17,15 @@ export interface HistoryRequestsPanelProps { pinnedEntries: HistoryEntryProps[]; searchText: string; methodFilter?: string; + onClearAll: () => void; + onExport: () => void; } +const ToolbarButton = Button.withProps({ + variant: "light", + size: "sm", +}); + const PanelContainer = Paper.withProps({ withBorder: true, p: "lg", @@ -56,6 +71,8 @@ export function HistoryListPanel({ pinnedEntries, searchText, methodFilter, + onClearAll, + onExport, }: HistoryRequestsPanelProps) { const [compact, setCompact] = useState(false); @@ -76,12 +93,16 @@ export function HistoryListPanel({ Requests - {hasResults && ( - setCompact((c) => !c)} - /> - )} + + Export JSON + Clear All + {hasResults && ( + setCompact((c) => !c)} + /> + )} + {!hasResults ? ( diff --git a/clients/web/src/components/groups/LogControls/LogControls.tsx b/clients/web/src/components/groups/LogControls/LogControls.tsx index c5cf88ef..a3655630 100644 --- a/clients/web/src/components/groups/LogControls/LogControls.tsx +++ b/clients/web/src/components/groups/LogControls/LogControls.tsx @@ -59,6 +59,12 @@ export function LogControls({ Logging + onFilterChange(e.currentTarget.value)} + /> + Active Level