-
Notifications
You must be signed in to change notification settings - Fork 0
Mirror: feat(slash-commands): type/source indicators (#5696) #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| "kilo-code": minor | ||
| --- | ||
|
|
||
| feat: Enhance slash command menu with type indicators, source badges, skill invocation, and argument hints | ||
|
|
||
| - Add type badges (command, mode, workflow, skill) with distinct colors to the "/" slash command dropdown | ||
| - Add source labels (project, global, organization) for non-built-in items | ||
| - Add skills to the "/" slash command menu, allowing discovery and invocation of installed skills | ||
| - Color-code slash command highlights in the text input to match their type | ||
| - Support Claude Code's `argument-hint` SKILL.md frontmatter field (from the Agent Skills specification), displayed as ghost text in the input after selecting a skill command to guide usage (e.g. `[-a] [-x] <task description>`) | ||
| - Parse and propagate `argument-hint` from skill frontmatter through the full data pipeline (SkillsManager → ExtensionStateContext → SlashCommand) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,7 +207,7 @@ export const fireworksModels = { | |
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsNativeTools: true, | ||
| defaultToolProtocol: "native", | ||
| defaultToolProtocol: "native", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4. fireworks.ts missing marker A change was made in an upstream-shared packages/ file without adding any kilocode_change marker. This can create avoidable conflicts when syncing with upstream. Agent Prompt
|
||
| inputPrice: 0.22, | ||
| outputPrice: 0.88, | ||
| displayName: "GLM-4.5 Air", | ||
|
|
@@ -243,7 +243,7 @@ export const fireworksModels = { | |
| supportsImages: false, | ||
| supportsPromptCache: true, | ||
| supportsNativeTools: true, | ||
| defaultToolProtocol: "native", | ||
| defaultToolProtocol: "native", | ||
| inputPrice: 0.05, | ||
| outputPrice: 0.2, | ||
| cacheReadsPrice: 0.04, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4124,10 +4124,14 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike { | |
| ) | ||
|
|
||
| // when parsing slash commands, we still want to allow the user to provide their desired context | ||
| const currentMode = await this.getTaskMode() | ||
| const skillsForMode = | ||
| this.providerRef.deref()?.getSkillsManager()?.getSkillsForMode(currentMode) ?? [] | ||
| const { processedText, needsRulesFileCheck: needsCheck } = await parseKiloSlashCommands( | ||
| parsedText.text, | ||
| localWorkflowToggles, | ||
| globalWorkflowToggles, | ||
| skillsForMode, | ||
|
Comment on lines
+4127
to
+4134
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. task.ts missing kilocode_change New logic to fetch skillsForMode and pass it into parseKiloSlashCommands was added in an upstream-shared src/ file without surrounding kilocode_change markers. This increases the risk of merge conflicts during upstream syncs. Agent Prompt
|
||
| ) | ||
|
Comment on lines
+4127
to
4135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5. Skills not passed to parser Skill support was added to parseKiloSlashCommands, but the main request-time pipeline still calls parseKiloSlashCommands without providing skills, so skills defaults to an empty array and /skill never matches. Users can see skills in the UI but the backend won’t inject SKILL.md content for slash-invocation. Agent Prompt
|
||
|
|
||
| if (needsCheck) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import React, { useCallback, useRef, useEffect } from "react" | ||
| import { SlashCommand, getMatchingSlashCommands } from "@/utils/slash-commands" | ||
| import { SlashCommand, SlashCommandSource, SlashCommandType, getMatchingSlashCommands } from "@/utils/slash-commands" | ||
| import { useExtensionState } from "@/context/ExtensionStateContext" // kilocode_change | ||
|
|
||
| interface SlashCommandMenuProps { | ||
|
|
@@ -11,6 +11,33 @@ interface SlashCommandMenuProps { | |
| customModes?: any[] | ||
| } | ||
|
|
||
| const typeBadgeColors: Record<string, { bg: string; text: string }> = { | ||
| command: { bg: "rgba(58, 150, 221, 0.15)", text: "rgba(58, 150, 221, 0.9)" }, | ||
| mode: { bg: "rgba(160, 100, 230, 0.15)", text: "rgba(160, 100, 230, 0.9)" }, | ||
| workflow: { bg: "rgba(80, 180, 100, 0.15)", text: "rgba(80, 180, 100, 0.9)" }, | ||
| skill: { bg: "rgba(220, 160, 50, 0.15)", text: "rgba(220, 160, 50, 0.9)" }, | ||
| } | ||
|
|
||
| const defaultBadgeColors = { bg: "rgba(128, 128, 128, 0.15)", text: "var(--vscode-descriptionForeground)" } | ||
|
|
||
| function getTypeBadgeColors(type?: SlashCommandType): { bg: string; text: string } { | ||
| return (type && typeBadgeColors[type]) || defaultBadgeColors | ||
| } | ||
|
|
||
| function getSourceLabel(source?: SlashCommandSource): string | null { | ||
| switch (source) { | ||
| case "project": | ||
| return "project" | ||
| case "global": | ||
| return "global" | ||
| case "organization": | ||
| return "org" | ||
| case "built-in": | ||
| default: | ||
| return null | ||
| } | ||
| } | ||
|
|
||
|
Comment on lines
+14
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. slashcommandmenu unmarked additions New helper/constants for slash command type/source badges were added in an upstream-shared webview-ui/ file without kilocode_change markers. This makes future upstream merges more conflict-prone. Agent Prompt
|
||
| const SlashCommandMenu: React.FC<SlashCommandMenuProps> = ({ | ||
| onSelect, | ||
| selectedIndex, | ||
|
|
@@ -19,7 +46,7 @@ const SlashCommandMenu: React.FC<SlashCommandMenuProps> = ({ | |
| query, | ||
| customModes, | ||
| }) => { | ||
| const { localWorkflows, globalWorkflows } = useExtensionState() // kilocode_change | ||
| const { localWorkflows, globalWorkflows, skills } = useExtensionState() // kilocode_change | ||
| const menuRef = useRef<HTMLDivElement>(null) | ||
|
|
||
| const handleClick = useCallback( | ||
|
|
@@ -47,7 +74,7 @@ const SlashCommandMenu: React.FC<SlashCommandMenuProps> = ({ | |
| }, [selectedIndex]) | ||
|
|
||
| // Filter commands based on query | ||
| const filteredCommands = getMatchingSlashCommands(query, customModes, localWorkflows, globalWorkflows) // kilocode_change | ||
| const filteredCommands = getMatchingSlashCommands(query, customModes, localWorkflows, globalWorkflows, skills) // kilocode_change | ||
|
|
||
| return ( | ||
| <div | ||
|
|
@@ -69,8 +96,27 @@ const SlashCommandMenu: React.FC<SlashCommandMenuProps> = ({ | |
| } hover:bg-[var(--vscode-list-hoverBackground)]`} | ||
| onClick={() => handleClick(command)} | ||
| onMouseEnter={() => setSelectedIndex(index)}> | ||
| <div className="font-bold whitespace-nowrap overflow-hidden text-ellipsis"> | ||
| /{command.name} | ||
| <div className="flex items-center justify-between gap-2"> | ||
| <div className="font-bold whitespace-nowrap overflow-hidden text-ellipsis"> | ||
| /{command.name} | ||
| </div> | ||
| <div className="flex items-center gap-1 shrink-0"> | ||
| {command.type && ( | ||
| <span | ||
| className="text-[0.7em] px-1.5 py-0.5 rounded-sm leading-none" | ||
| style={{ | ||
| backgroundColor: getTypeBadgeColors(command.type).bg, | ||
| color: getTypeBadgeColors(command.type).text, | ||
| }}> | ||
|
Comment on lines
+105
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. slashcommandmenu inline style prop New webview markup introduces an inline style={{ ... }} object for the type badge colors instead
of using Tailwind/CSS classes. This violates the repo requirement and can lead to inconsistent
styling patterns and theme compatibility issues.
Agent Prompt
|
||
| {command.type} | ||
| </span> | ||
| )} | ||
| {getSourceLabel(command.source) && ( | ||
| <span className="text-[0.65em] text-[var(--vscode-descriptionForeground)] opacity-70 leading-none"> | ||
| {getSourceLabel(command.source)} | ||
| </span> | ||
| )} | ||
| </div> | ||
| </div> | ||
| <div className="text-[0.85em] text-[var(--vscode-descriptionForeground)] whitespace-normal overflow-hidden text-ellipsis"> | ||
| {command.description} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6. Cli maps missing apertis
🐞 Bug✓ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools