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 }
|
? { name: readState.uri, uri: readState.uri }
|
||||||
: undefined);
|
: undefined);
|
||||||
|
|
||||||
|
function handleSelectResource(uri: string) {
|
||||||
|
setSelectedTemplateUri(undefined);
|
||||||
|
setSelectedResourceUri(uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleSelectTemplate(uriTemplate: string) {
|
||||||
|
setSelectedResourceUri(undefined);
|
||||||
|
setSelectedTemplateUri(uriTemplate);
|
||||||
|
}
|
||||||
|
|
||||||
function handleReadResource(uri: string) {
|
function handleReadResource(uri: string) {
|
||||||
setSelectedResourceUri(uri);
|
setSelectedResourceUri(uri);
|
||||||
onReadResource(uri);
|
onReadResource(uri);
|
||||||
|
|
@ -164,8 +174,8 @@ export function ResourcesScreen({
|
||||||
selectedTemplateUri={selectedTemplateUri}
|
selectedTemplateUri={selectedTemplateUri}
|
||||||
listChanged={listChanged}
|
listChanged={listChanged}
|
||||||
onRefreshList={onRefreshList}
|
onRefreshList={onRefreshList}
|
||||||
onSelectUri={setSelectedResourceUri}
|
onSelectUri={handleSelectResource}
|
||||||
onSelectTemplate={setSelectedTemplateUri}
|
onSelectTemplate={handleSelectTemplate}
|
||||||
onUnsubscribeResource={onUnsubscribeResource}
|
onUnsubscribeResource={onUnsubscribeResource}
|
||||||
/>
|
/>
|
||||||
</SidebarCard>
|
</SidebarCard>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue