From 46f7e95dc3d43fc9810edc38af409fd471eb2153 Mon Sep 17 00:00:00 2001 From: Hand Sonic <8078023+HandSonic@users.noreply.github.com> Date: Thu, 1 Oct 2026 22:31:14 +0800 Subject: [PATCH] feat(ai): add select-all controls to skill picker --- .../src/components/editor/AiAssistant.vue | 25 +++- .../__tests__/AiAssistant.mount.spec.ts | 112 ++++++++++++++++++ apps/desktop/src/i18n/locales/az.ts | 2 + apps/desktop/src/i18n/locales/en.ts | 2 + apps/desktop/src/i18n/locales/es.ts | 2 + apps/desktop/src/i18n/locales/it.ts | 2 + apps/desktop/src/i18n/locales/ja.ts | 2 + apps/desktop/src/i18n/locales/ko.ts | 2 + apps/desktop/src/i18n/locales/pt-BR.ts | 2 + apps/desktop/src/i18n/locales/ru.ts | 2 + apps/desktop/src/i18n/locales/tr.ts | 2 + apps/desktop/src/i18n/locales/zh-CN.ts | 2 + apps/desktop/src/i18n/locales/zh-TW.ts | 2 + docs/screenshots/issue-10793-select-all.png | Bin 0 -> 12742 bytes 14 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 docs/screenshots/issue-10793-select-all.png diff --git a/apps/desktop/src/components/editor/AiAssistant.vue b/apps/desktop/src/components/editor/AiAssistant.vue index 3d37d463a7..a280ab27c6 100644 --- a/apps/desktop/src/components/editor/AiAssistant.vue +++ b/apps/desktop/src/components/editor/AiAssistant.vue @@ -643,6 +643,8 @@ const skillFailures = ref([]); // vanished from discovery must keep a removable chip (prd.md:37) instead of // silently becoming an id the user can no longer drop. const selectedSkillChips = computed(() => buildSelectedSkillChips(selectedSkillIds.value, (id) => userSkillStore.metaFor(id))); +const selectableSkillIds = computed(() => userSkillStore.groupedSkills.flatMap((group) => group.skills.map((skill) => skill.id))); +const canSelectAllSkills = computed(() => !userSkillStore.isLoading && !userSkillStore.lastError && selectableSkillIds.value.some((id) => !selectedSkillIds.value.includes(id))); // Selector retry-on-open mirrors the template selector above. watch(showSkillSelector, (open) => { if (open) void userSkillStore.refresh(skillRootSettings()); @@ -666,6 +668,17 @@ function toggleSkillSelected(id: string) { selectedSkillIds.value = selectedSkillIds.value.includes(id) ? selectedSkillIds.value.filter((skillId) => skillId !== id) : [...selectedSkillIds.value, id]; } +function selectAllSkills() { + if (!canSelectAllSkills.value) return; + selectedSkillIds.value = [...new Set([...selectedSkillIds.value, ...selectableSkillIds.value])]; + skillFailures.value = []; +} + +function deselectAllSkills() { + selectedSkillIds.value = []; + skillFailures.value = []; +} + function removeSelectedSkill(id: string) { selectedSkillIds.value = removeSkillIds(selectedSkillIds.value, [id]); skillFailures.value = []; @@ -6380,7 +6393,7 @@ async function openExternalUrl(url: string) { {{ t(group.source === "custom" ? "ai.skillsGroupCustom" : "ai.skillsGroupDefault") }}
+
+ + +