Skip to content

Commit d1afcc4

Browse files
author
eugene yevhen andruszczenko
committed
fix: removed need to restor @ context since it works as is
1 parent 927aff6 commit d1afcc4

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/components/chat-item/chat-prompt-input.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,10 @@ export class ChatPromptInput {
313313

314314
private readonly handleInputFocus = (): void => {
315315
const inputValue = this.promptTextInput.getTextInputValue();
316-
if (inputValue.startsWith('/') || inputValue.startsWith('@')) {
317-
this.quickPickType = inputValue.startsWith('@') ? 'context' : 'quick-action';
318-
const quickPickItems =
319-
this.quickPickType === 'context'
320-
? MynahUITabsStore.getInstance().getTabDataStore(this.props.tabId).getValue('contextCommands') as QuickActionCommandGroup[]
321-
: MynahUITabsStore.getInstance().getTabDataStore(this.props.tabId).getValue('quickActionCommands') as QuickActionCommandGroup[];
316+
if (inputValue.startsWith('/')) {
317+
const quickPickItems = MynahUITabsStore.getInstance().getTabDataStore(this.props.tabId).getValue('quickActionCommands') as QuickActionCommandGroup[];
322318
this.quickPickItemGroups = [ ...quickPickItems ];
323-
this.quickPickTriggerIndex = inputValue.startsWith('@') ? inputValue.indexOf('@') : 1;
319+
this.quickPickTriggerIndex = 1;
324320
this.textAfter = inputValue.substring(this.quickPickTriggerIndex);
325321
this.promptTextInput.setContextReplacement(this.quickPickItemGroups.length > 0);
326322
const restorePreviousFilteredQuickPickItemGroups: QuickActionCommandGroup[] = [];

src/components/chat-item/prompt-input/prompt-text-input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class PromptTextInput {
7373
},
7474
focus: () => {
7575
this.render.addClass('input-has-focus');
76-
if (this.props.onFocus !== undefined) {
76+
if (typeof this.props.onFocus !== 'undefined') {
7777
this.props.onFocus();
7878
}
7979
},

0 commit comments

Comments
 (0)