Skip to content

Commit 44b5c1b

Browse files
authored
feat(dashboard): show source badge for skills in skills list (#10339)
Display the origin of each skill in the Local Skills list so users can tell independently installed skills apart from plugin-provided and sandbox-preset ones without reading the file path. - Add a source chip in the skill card title area: - plugin skills show "Plugin: {name}", preferring the plugin display name and falling back to the source label / plugin name - local-only, local + sandbox and sandbox-preset skills get their own labels - Reuse the existing skills.sourcePlugin/sourceBoth/sourceSandboxOnly/ sourceLocalOnly i18n keys that are already present in all four locales. - Narrow the existing "preset" chip condition to skill.preset so it no longer duplicates the sandbox-preset source label. - Keep the disabled and read-only behavior unchanged.
1 parent 1245979 commit 44b5c1b

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

‎dashboard/src/components/extension/SkillsSection.vue‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,15 @@
157157
<template #title-extra>
158158
<div class="d-flex align-center ga-1">
159159
<v-chip
160-
v-if="skill.preset || skill.source_type === 'sandbox_only'"
160+
v-if="skillSourceChip(skill)"
161+
size="x-small"
162+
variant="tonal"
163+
:color="skillSourceChip(skill).color"
164+
>
165+
{{ skillSourceChip(skill).text }}
166+
</v-chip>
167+
<v-chip
168+
v-if="skill.preset"
161169
size="x-small"
162170
variant="tonal"
163171
color="secondary"
@@ -1157,6 +1165,29 @@ export default {
11571165
isPluginProvidedSkill(skill) && skill?.plugin_active === false;
11581166
const isReadOnlySourceSkill = (skill) =>
11591167
isSandboxPresetSkill(skill) || isPluginProvidedSkill(skill);
1168+
// Resolve the origin chip for a skill. Plugin skills prefer the plugin's
1169+
// display name, then its internal source label / name.
1170+
const skillSourceChip = (skill) => {
1171+
if (!skill) return null;
1172+
if (isPluginProvidedSkill(skill)) {
1173+
const pluginName =
1174+
skill.plugin_display_name ||
1175+
skill.source_label ||
1176+
skill.plugin_name ||
1177+
"";
1178+
return {
1179+
text: tm("skills.sourcePlugin", { plugin: pluginName }),
1180+
color: "primary",
1181+
};
1182+
}
1183+
if (skill.source_type === "both") {
1184+
return { text: tm("skills.sourceBoth"), color: "secondary" };
1185+
}
1186+
if (skill.source_type === "sandbox_only") {
1187+
return { text: tm("skills.sourceSandboxOnly"), color: "secondary" };
1188+
}
1189+
return { text: tm("skills.sourceLocalOnly"), color: undefined };
1190+
};
11601191
const deletableSkills = computed(() =>
11611192
skills.value.filter((skill) => !isReadOnlySourceSkill(skill)),
11621193
);
@@ -2177,6 +2208,7 @@ export default {
21772208
isPluginProvidedSkill,
21782209
isInactivePluginSkill,
21792210
isReadOnlySourceSkill,
2211+
skillSourceChip,
21802212
};
21812213
},
21822214
};

0 commit comments

Comments
 (0)