fix: keep orphaned cloud plugins runnable (#14859)

* fix: keep orphaned cloud plugins runnable

* fix: tests
This commit is contained in:
Ian Chua
2026-07-31 14:15:22 +08:00
committed by GitHub
parent b51db32bb5
commit e01ac1f0a6
7 changed files with 111 additions and 25 deletions

View File

@@ -602,15 +602,17 @@ function SourceLabel(source) {
return "Mine";
case "subscribed":
return "Subscribed";
case "orphaned":
return "Orphaned";
default:
return "Local";
}
}
// Shared Local/Subscribed/Mine pill, used both after the row name and in the info panel.
// Shared source pill, used both after the row name and in the info panel.
function SourceBadge(source) {
const normalized = String(source || "").toLowerCase();
const variant = (normalized === "mine" || normalized === "subscribed") ? normalized : "local";
const variant = (normalized === "mine" || normalized === "subscribed" || normalized === "orphaned") ? normalized : "local";
const badge = document.createElement("span");
badge.className = `plugin-source-badge source-${variant}`;
badge.textContent = SourceLabel(source);
@@ -654,7 +656,7 @@ function LabelCell(plugin, isExpanded = false, capabilityCount = 0, nameRanges =
const labelCell = document.createElement("span");
labelCell.className = "label-cell";
const hasCloudLink = plugin.source === "mine" || plugin.source === "subscribed";
const hasCloudLink = plugin.source === "mine" || plugin.source === "subscribed" || plugin.source === "orphaned";
const pluginLabelText = plugin.label || plugin.name || plugin.plugin_id || "";
const canExpand = capabilityCount > 0;
@@ -705,7 +707,7 @@ function LabelCell(plugin, isExpanded = false, capabilityCount = 0, nameRanges =
function SourceCell(plugin) {
const cell = document.createElement("span");
const normalized = String(plugin.source || "").toLowerCase();
const variant = (normalized === "mine" || normalized === "subscribed") ? normalized : "local";
const variant = (normalized === "mine" || normalized === "subscribed" || normalized === "orphaned") ? normalized : "local";
cell.className = `source-cell source-${variant}`;
const sourceLabel = document.createElement("span");
@@ -1233,7 +1235,7 @@ function RenderDescription(plugin) {
return;
}
const isCloud = plugin && (plugin.source === "mine" || plugin.source === "subscribed");
const isCloud = plugin && (plugin.source === "mine" || plugin.source === "subscribed" || plugin.source === "orphaned");
if (isCloud && String(plugin?.sharing_token || "")) {
node.appendChild(document.createTextNode("View on OrcaCloud "));
const link = document.createElement("a");
@@ -1370,6 +1372,13 @@ function RenderDetailSummary(container, plugin) {
message.textContent = errorText || StatusDescription(plugin);
container.appendChild(message);
if (plugin.orphaned === true) {
const warning = document.createElement("div");
warning.className = "detail-description detail-warning-text";
warning.textContent = "Orphaned: This plugin is no longer subscribed or available in OrcaCloud. The local copy remains installed and can still be used.";
container.appendChild(warning);
}
const updateStatus = GetUpdateStatus(plugin);
if (updateStatus === "update_available") {
const note = document.createElement("div");

View File

@@ -251,6 +251,11 @@ body.pane-resizing {
font-weight: 600;
}
.source-cell.source-orphaned {
color: var(--plugin-status-warn);
font-weight: 600;
}
.source-cell.source-local {
color: var(--plugin-source-neutral-text);
}
@@ -648,6 +653,10 @@ body.pane-resizing {
color: var(--plugin-status-danger);
}
.detail-warning-text {
color: var(--plugin-status-warn);
}
.detail-status-chip {
display: inline-flex;
align-items: center;
@@ -915,6 +924,11 @@ body.pane-resizing {
color: var(--plugin-source-subscribed-text);
}
.plugin-source-badge.source-orphaned {
background: var(--plugin-status-warn-bg);
color: var(--plugin-status-warn);
}
.plugin-cloud-link {
color: var(--plugin-link-text);
cursor: pointer;