fix(extensions): use runtime-aware detail copy

This commit is contained in:
777genius 2026-04-17 20:55:22 +03:00
parent 767dfde4cb
commit 4775d4bc45
4 changed files with 45 additions and 7 deletions

View file

@ -118,6 +118,8 @@ export const McpServerDetailDialog = ({
.map((entry) => entry.name)
.sort()
.join('\0') ?? '';
const statusSectionLabel =
cliStatus?.flavor === 'agent_teams_orchestrator' ? 'Runtime Status' : 'Claude Status';
const apiKeyLookupProjectPath = isProjectScopedMcpScope(scope)
? (projectPath ?? undefined)
: undefined;
@ -409,7 +411,7 @@ export const McpServerDetailDialog = ({
{isInstalledForScope && (
<div className="space-y-2 rounded-md border border-border bg-surface-raised px-4 py-3">
<div className="flex items-center justify-between gap-3">
<span className="text-sm font-medium text-text">Claude Status</span>
<span className="text-sm font-medium text-text">{statusSectionLabel}</span>
{diagnosticsLoading && !diagnostic ? (
<Badge
className="border-border bg-surface-raised text-text-muted"

View file

@ -192,7 +192,7 @@ export const SkillDetailDialog = ({
</div>
<div className="space-y-1">
<p className="text-xs font-medium uppercase tracking-wide text-text-muted">
How Claude uses it
How it is used
</p>
<p className="text-sm text-text">{formatInvocationLabel(item.invocationMode)}</p>
</div>

View file

@ -482,7 +482,7 @@ export const SkillEditorDialog = ({
</div>
<div className="space-y-2">
<Label htmlFor="skill-invocation">How Claude should use it</Label>
<Label htmlFor="skill-invocation">How it should be used</Label>
<Select
value={invocationMode}
onValueChange={(value) => {
@ -495,7 +495,7 @@ export const SkillEditorDialog = ({
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="auto">Claude can use it automatically</SelectItem>
<SelectItem value="auto">Can be used automatically</SelectItem>
<SelectItem value="manual-only">Only when you ask for it</SelectItem>
</SelectContent>
</Select>
@ -575,7 +575,7 @@ export const SkillEditorDialog = ({
<div className="grid gap-3">
<div className="space-y-2">
<Label htmlFor="skill-when-to-use">When Claude should reach for this</Label>
<Label htmlFor="skill-when-to-use">When to reach for this</Label>
<Textarea
id="skill-when-to-use"
value={whenToUse}
@ -591,7 +591,7 @@ export const SkillEditorDialog = ({
</div>
<div className="space-y-2">
<Label htmlFor="skill-steps">Main steps Claude should follow</Label>
<Label htmlFor="skill-steps">Main steps to follow</Label>
<Textarea
id="skill-steps"
value={steps}
@ -666,7 +666,7 @@ export const SkillEditorDialog = ({
<div>
<p className="font-medium text-text">References</p>
<p className="mt-1 text-xs text-text-muted">
Add supporting docs, links, or examples that Claude can look at.
Add supporting docs, links, or examples the runtime can look at.
</p>
</div>
</label>

View file

@ -425,6 +425,42 @@ describe('McpServerDetailDialog installed entry handling', () => {
});
});
it('uses a runtime-aware status label in multimodel mode', async () => {
storeState.cliStatus = { flavor: 'agent_teams_orchestrator' };
const host = document.createElement('div');
document.body.appendChild(host);
const root = createRoot(host);
const installedEntry: InstalledMcpEntry = {
name: 'context7-global',
scope: 'global',
};
await act(async () => {
root.render(
React.createElement(McpServerDetailDialog, {
server: makeServer(),
isInstalled: true,
installedEntry,
installedEntries: [installedEntry],
diagnostic: null,
diagnosticsLoading: false,
projectPath: null,
open: true,
onClose: vi.fn(),
})
);
await Promise.resolve();
});
expect(host.textContent).toContain('Runtime Status');
expect(host.textContent).not.toContain('Claude Status');
await act(async () => {
root.unmount();
await Promise.resolve();
});
});
it('preserves edited fields when multimodel scope metadata loads after open', async () => {
storeState.cliStatus = null;
const host = document.createElement('div');