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) <noreply@anthropic.com>
This commit is contained in:
parent
bb8241c2aa
commit
d5559b4ea6
1 changed files with 12 additions and 2 deletions
|
|
@ -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}
|
||||
/>
|
||||
</SidebarCard>
|
||||
|
|
|
|||
Loading…
Reference in a new issue