Skip to content

Commit 1e0468c

Browse files
committed
chore: hide suggestions from chat input for message editing
Fixes eclipse-theia#15616
1 parent 88a650e commit 1e0468c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/ai-chat-ui/src/browser/ai-chat-ui-frontend-module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
8787
container.bind(AIChatTreeInputConfiguration).toConstantValue({
8888
showContext: true,
8989
showPinnedAgent: true,
90-
showChangeSet: false
90+
showChangeSet: false,
91+
showSuggestions: false,
9192
} satisfies AIChatInputConfiguration);
9293
container.bind(AIChatTreeInputWidget).toSelf().inSingletonScope();
9394
const widget = container.get(AIChatTreeInputWidget);

packages/ai-chat-ui/src/browser/chat-input-widget.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface AIChatInputConfiguration {
4242
showContext?: boolean;
4343
showPinnedAgent?: boolean;
4444
showChangeSet?: boolean;
45+
showSuggestions?: boolean;
4546
}
4647

4748
@injectable()
@@ -180,6 +181,7 @@ export class AIChatInputWidget extends ReactWidget {
180181
showContext={this.configuration?.showContext}
181182
showPinnedAgent={this.configuration?.showPinnedAgent}
182183
showChangeSet={this.configuration?.showChangeSet}
184+
showSuggestions={this.configuration?.showSuggestions}
183185
labelProvider={this.labelProvider}
184186
actionService={this.changeSetActionService}
185187
decoratorService={this.changeSetDecoratorService}
@@ -289,6 +291,7 @@ interface ChatInputProperties {
289291
showContext?: boolean;
290292
showPinnedAgent?: boolean;
291293
showChangeSet?: boolean;
294+
showSuggestions?: boolean;
292295
labelProvider: LabelProvider;
293296
actionService: ChangeSetActionService;
294297
decoratorService: ChangeSetDecoratorService;
@@ -593,7 +596,7 @@ const ChatInput: React.FunctionComponent<ChatInputProperties> = (props: ChatInpu
593596
const contextUI = buildContextUI(props.context, props.labelProvider, props.onDeleteContextElement, props.onOpenContextElement);
594597

595598
return <div className='theia-ChatInput' onDragOver={props.onDragOver} onDrop={props.onDrop} >
596-
{<ChatInputAgentSuggestions suggestions={props.suggestions} opener={props.openerService} />}
599+
{props.showSuggestions !== false && <ChatInputAgentSuggestions suggestions={props.suggestions} opener={props.openerService} />}
597600
{props.showChangeSet && changeSetUI?.elements &&
598601
<ChangeSetBox changeSet={changeSetUI} />
599602
}

0 commit comments

Comments
 (0)