diff --git a/extensions/cli/.gitignore b/extensions/cli/.gitignore index f3e65527464..67557ca37f5 100644 --- a/extensions/cli/.gitignore +++ b/extensions/cli/.gitignore @@ -13,4 +13,5 @@ config.yaml .continue-debug/ *.expect -!demo.expect \ No newline at end of file +!demo.expect +*.cast \ No newline at end of file diff --git a/extensions/cli/src/ui/SlashCommandUI.tsx b/extensions/cli/src/ui/SlashCommandUI.tsx index b3d5765e33f..66107c0482b 100644 --- a/extensions/cli/src/ui/SlashCommandUI.tsx +++ b/extensions/cli/src/ui/SlashCommandUI.tsx @@ -4,6 +4,18 @@ import React, { useMemo } from "react"; import { getAllSlashCommands } from "../commands/commands.js"; +const MAX_DESCRIPTION_LENGTH = 80; + +const truncateDescription = (description: string): string => { + if (description.length <= MAX_DESCRIPTION_LENGTH) { + return description; + } + return ( + Array.from(description).slice(0, MAX_DESCRIPTION_LENGTH).join("").trim() + + "…" + ); +}; + interface SlashCommandUIProps { assistant?: AssistantConfig; filter: string; @@ -74,7 +86,7 @@ const SlashCommandUI: React.FC = ({ {paddedCommandName} {" "} - {command.description} + {truncateDescription(command.description)}