mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 05:24:34 -07:00
feat(plan): use placeholder for choice question "Other" option (#18101)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -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.",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user