faster detail view

This commit is contained in:
pashpashpash 2025-02-17 15:03:10 -08:00
parent a4d1ae1af4
commit 31eb212bee

View file

@ -931,14 +931,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
}
case "openMcpMarketplaceServerDetails": {
if (message.mcpId) {
// close existing
const tabs = vscode.window.tabGroups.all
.flatMap((tg) => tg.tabs)
.filter((tab) => tab.label && tab.label.includes("README") && tab.label.includes("Preview"))
for (const tab of tabs) {
await vscode.window.tabGroups.close(tab)
}
const response = await fetch(`https://api.cline.bot/v1/mcp/marketplace/item?mcpId=${message.mcpId}`)
const details: McpDownloadResponse = await response.json()
@ -952,6 +944,14 @@ export class ClineProvider implements vscode.WebviewViewProvider {
`${DIFF_VIEW_URI_SCHEME}:${details.name} README?${Buffer.from(details.readmeContent).toString("base64")}`,
)
// close existing
const tabs = vscode.window.tabGroups.all
.flatMap((tg) => tg.tabs)
.filter((tab) => tab.label && tab.label.includes("README") && tab.label.includes("Preview"))
for (const tab of tabs) {
await vscode.window.tabGroups.close(tab)
}
// Show only the preview
await vscode.commands.executeCommand("markdown.showPreview", uri, {
sideBySide: true,