From d5559b4ea680741a40a247b43a4f621524528071 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Sun, 26 Apr 2026 11:38:11 -0400 Subject: [PATCH] Make ResourcesScreen template/resource selection mutually exclusive Selecting a resource now clears the active template selection (and vice versa), so the right-hand panel reflects what the user just clicked. The template's Read Resource button still only sets the resource URI, preserving the template-with-preview layout for the read flow. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../screens/ResourcesScreen/ResourcesScreen.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/clients/web/src/components/screens/ResourcesScreen/ResourcesScreen.tsx b/clients/web/src/components/screens/ResourcesScreen/ResourcesScreen.tsx index 0bbc0891..08860cff 100644 --- a/clients/web/src/components/screens/ResourcesScreen/ResourcesScreen.tsx +++ b/clients/web/src/components/screens/ResourcesScreen/ResourcesScreen.tsx @@ -104,6 +104,16 @@ export function ResourcesScreen({ ? { name: readState.uri, uri: readState.uri } : undefined); + function handleSelectResource(uri: string) { + setSelectedTemplateUri(undefined); + setSelectedResourceUri(uri); + } + + function handleSelectTemplate(uriTemplate: string) { + setSelectedResourceUri(undefined); + setSelectedTemplateUri(uriTemplate); + } + function handleReadResource(uri: string) { setSelectedResourceUri(uri); onReadResource(uri); @@ -164,8 +174,8 @@ export function ResourcesScreen({ selectedTemplateUri={selectedTemplateUri} listChanged={listChanged} onRefreshList={onRefreshList} - onSelectUri={setSelectedResourceUri} - onSelectTemplate={setSelectedTemplateUri} + onSelectUri={handleSelectResource} + onSelectTemplate={handleSelectTemplate} onUnsubscribeResource={onUnsubscribeResource} />