feat(plan): use placeholder for choice question "Other" option (#18101)

This commit is contained in:
Jerop Kipruto
2026-02-02 12:00:13 -05:00
committed by GitHub
parent 381669dce0
commit 9e7c10ad88
6 changed files with 108 additions and 3 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ export interface Question {
options?: QuestionOption[];
/** Allow multiple selections. Only applies when type='choice'. */
multiSelect?: boolean;
/** Placeholder hint text. Only applies when type='text'. */
/** Placeholder hint text. For type='text', shown in the input field. For type='choice', shown in the "Other" custom input. */
placeholder?: string;
}
+18
View File
@@ -177,6 +177,24 @@ describe('AskUserTool', () => {
expect(result).toBeNull();
});
it('should accept placeholder for choice type', () => {
const result = tool.validateToolParams({
questions: [
{
question: 'Which language?',
header: 'Language',
type: QuestionType.CHOICE,
options: [
{ label: 'TypeScript', description: 'Typed JavaScript' },
{ label: 'JavaScript', description: 'Dynamic language' },
],
placeholder: 'Type another language...',
},
],
});
expect(result).toBeNull();
});
it('should return error if option has empty label', () => {
const result = tool.validateToolParams({
questions: [
+1 -1
View File
@@ -90,7 +90,7 @@ export class AskUserTool extends BaseDeclarativeTool<
placeholder: {
type: 'string',
description:
"Only applies when type='text'. Hint text shown in the input field.",
"Hint text shown in the input field. For type='text', shown in the main input. For type='choice', shown in the 'Other' custom input.",
},
},
},