fix(chat): omit skills group from shortcut picker

Skills already have a dedicated picker; keep the quick-command popover to slash commands only.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jubaoliang
2026-09-21 07:40:51 +08:00
committed by jubaoliang
co-authored by Cursor
parent ae62ec3088
commit e446463bb9
2 changed files with 15 additions and 1 deletions
@@ -66,6 +66,15 @@ describe("useSlashMentionInput skills", () => {
expect(skillItem?.label).toBe("Web Search");
expect(skillItem?.spec.usage).toBe("✦ Web Search <task>");
expect(skillItem?.spec.category).toBe("skills");
// Shortcut popover keeps slash commands only; skills use the skill picker.
expect(
result.current.slashPickerGroups.map((group) => group.category),
).toEqual(["core"]);
expect(
result.current.slashPickerGroups.flatMap((group) =>
group.items.map((item) => item.command),
),
).toEqual(["/stop"]);
});
});
@@ -239,7 +239,12 @@ export function useSlashMentionInput({
);
const slashPickerGroups = useMemo(
() => groupSlashByCategory(slashMenuItems, locale),
() =>
groupSlashByCategory(
// Skills have a dedicated picker; omit that group from shortcuts.
slashMenuItems.filter((item) => item.spec.category !== "skills"),
locale,
),
[slashMenuItems, locale],
);