Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion extensions/cli/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ config.yaml
.continue-debug/

*.expect
!demo.expect
!demo.expect
*.cast
11 changes: 10 additions & 1 deletion extensions/cli/src/ui/SlashCommandUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ 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 description.slice(0, MAX_DESCRIPTION_LENGTH).trim() + "…";
};

interface SlashCommandUIProps {
assistant?: AssistantConfig;
filter: string;
Expand Down Expand Up @@ -74,7 +83,7 @@ const SlashCommandUI: React.FC<SlashCommandUIProps> = ({
{paddedCommandName}
<Text color={isSelected ? "blue" : "gray"}>
{" "}
{command.description}
{truncateDescription(command.description)}
</Text>
</Text>
</Box>
Expand Down
Loading