Adding logic to render external plugins with canvases in the canvas gallery (#2323)

* Adding logic to render external plugins with canvases in the canvas gallery

* Fix external canvas plugin URL encoding and keyword detection

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: db85480e-d839-4f69-8271-08f8cc845596

* Fail fast on external plugin errors and fix external install links

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: db85480e-d839-4f69-8271-08f8cc845596
This commit is contained in:
Aaron Powell
2026-07-17 09:29:01 +10:00
committed by GitHub
parent fb80ec4f21
commit f0da81e14a
3 changed files with 198 additions and 28 deletions
+19 -7
View File
@@ -48,6 +48,7 @@ export interface RenderableExtension {
installCommand?: string | null;
installUrl?: string | null;
sourceUrl?: string | null;
externalSource?: string | null;
external?: boolean;
author?: { name: string; url?: string } | null;
}
@@ -95,13 +96,20 @@ export function renderExtensionsHtml(items: RenderableExtension[]): string {
const sourceUrl = safeUrl(
item.sourceUrl || (item.path ? getGitHubUrl(item.path) : "")
);
const externalSource = (item.externalSource || "").trim();
const pluginId = item.pluginName || item.id;
const ghappInstallUrl =
!item.external && pluginId
? `ghapp://plugins/install?source=${encodeURIComponent(
`${pluginId}@awesome-copilot`
)}`
: "";
item.external
? externalSource
? `ghapp://plugins/marketplace/add?source=${encodeURIComponent(
externalSource
)}`
: ""
: pluginId
? `ghapp://plugins/install?source=${encodeURIComponent(
`${pluginId}@awesome-copilot`
)}`
: "";
const previewImageUrl = safeUrl(item.imageUrl);
const previewMediaHtml = previewImageUrl
@@ -152,14 +160,18 @@ export function renderExtensionsHtml(items: RenderableExtension[]): string {
</a>`
: ""
}
<button
${
!item.external
? `<button
class="btn btn-secondary btn-small copy-install-url-btn"
data-install-url="${escapeHtml(installUrl)}"
title="Copy fallback URL install target"
${installUrl ? "" : "disabled"}
>
Copy URL
</button>
</button>`
: ""
}
${
sourceUrl
? `<a href="${escapeHtml(