Session-Level Conversation History Management (#1113)

This commit is contained in:
tanzhenxin 2025-12-03 18:04:48 +08:00 committed by GitHub
parent a7abd8d09f
commit 0a75d85ac9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
114 changed files with 9257 additions and 4039 deletions

View file

@ -282,7 +282,7 @@ function useCommandSuggestions(
if (!signal.aborted) {
const finalSuggestions = potentialSuggestions.map((cmd) => ({
label: cmd.name,
label: formatSlashCommandLabel(cmd),
value: cmd.name,
description: cmd.description,
commandKind: cmd.kind,
@ -525,3 +525,14 @@ export function useSlashCompletion(props: UseSlashCompletionProps): {
completionEnd,
};
}
function formatSlashCommandLabel(command: SlashCommand): string {
const baseLabel = command.name;
const altNames = command.altNames?.filter(Boolean);
if (!altNames || altNames.length === 0) {
return baseLabel;
}
return `${baseLabel} (${altNames.join(', ')})`;
}