Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ interface ConfigModel {
openNewTab: string;
commandConfirmation: string;
pinContextHint: string;
contextSearchPlaceholder: string;
dragOverlayText: string;
};
// Options to show up on the overlay feedback form
Expand Down Expand Up @@ -217,6 +218,11 @@ Default tab title text if it is not set through store data for that tab.
<p align="center">
<img src="./img/texts/pinContextHint.png" alt="pinContextHint" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
</p>

## contextSearchPlaceholder
<p align="center">
<img src="./img/texts/contextSearchPlaceholder.png" alt="contextSearchPlaceholder" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
</p>
---

## dragOverlayText
Expand Down
Binary file added docs/img/texts/contextSearchPlaceholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/components/chat-item/chat-item-form-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,16 @@ export class ChatItemFormItemsWrapper {
});
return valueMap;
};

clearAndFocusFirstTextInput = (): void => {
const firstOptionId = Object.keys(this.options)[0];
if (firstOptionId != null) {
const firstOption = this.options[firstOptionId];
// Clear first text input
if ('clear' in firstOption && typeof firstOption.clear === 'function') {
firstOption.clear();
firstOption.focus();
}
}
};
}
4 changes: 2 additions & 2 deletions src/components/chat-item/chat-prompt-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ export class ChatPromptInput {
type: 'textinput',
icon: MynahIcons.SEARCH,
id: 'search',
placeholder: 'Search context',
placeholder: Config.getInstance().config.texts.contextSearchPlaceholder,
autoFocus: true,
},
],
Expand Down Expand Up @@ -717,7 +717,7 @@ export class ChatPromptInput {
} else {
this.quickPickItemsSelectorContainer.update({
list: detailedListItemsGroup
});
}, false, true);
}

const headerInfo: QuickActionCommandsHeader = MynahUITabsStore.getInstance().getTabDataStore(this.props.tabId).getValue('quickActionCommandsHeader');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class PromptTopBar {
}
if (this.titleButton == null) {
this.titleButton = new Button({
testId: testIds.prompt.topBarTitle,
onClick: () => {
this.props.onTopBarTitleClick?.();
},
Expand Down
6 changes: 5 additions & 1 deletion src/components/detailed-list/detailed-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,11 @@ export class DetailedListWrapper {
return this.allSelectableDetailedListElements[this.activeTargetElementIndex].getItem();
};

public readonly update = (detailedList: DetailedList, preserveScrollPosition?: boolean): void => {
public readonly update = (detailedList: DetailedList, preserveScrollPosition?: boolean, clearFilter?: boolean): void => {
if (this.filterForm != null && clearFilter === true) {
this.filterForm.clearAndFocusFirstTextInput();
}

if (detailedList.header != null) {
this.props.detailedList.header = detailedList.header;
this.headerContainer.update({
Expand Down
22 changes: 17 additions & 5 deletions src/components/form-items/text-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export abstract class TextInputAbstract {
render: ExtendedHTMLElement;
setValue = (value: string): void => {};
getValue = (): string => '';
clear = (): void => {};
focus = (): void => {};
setEnabled = (enabled: boolean): void => {};
checkValidation = (): void => {};
}
Expand Down Expand Up @@ -125,11 +127,7 @@ export class TextInputInternal extends TextInputAbstract {
]
});

if (this.props.autoFocus === true) {
setTimeout(() => {
this.inputElement.focus();
}, 250);
}
this.focus();
}

setValue = (value: string): void => {
Expand All @@ -140,6 +138,18 @@ export class TextInputInternal extends TextInputAbstract {
return this.inputElement.value;
};

focus = (): void => {
if (this.props.autoFocus === true) {
setTimeout(() => {
this.inputElement.focus();
}, 250);
}
};

clear = (): void => {
this.setValue('');
};

setEnabled = (enabled: boolean): void => {
if (enabled) {
this.inputElement.removeAttribute('disabled');
Expand All @@ -161,6 +171,8 @@ export class TextInput extends TextInputAbstract {

setValue = (value: string): void => {};
getValue = (): string => '';
clear = (): void => {};
focus = (): void => {};
setEnabled = (enabled: boolean): void => {};
checkValidation = (): void => {};
}
1 change: 1 addition & 0 deletions src/helper/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const configDefaults: ConfigFullModel = {
openNewTab: 'New tab',
commandConfirmation: 'Press enter to continue',
pinContextHint: 'Pin context with \u2325 Enter',
contextSearchPlaceholder: 'Search context',
dragOverlayText: 'Add image to context',
},
};
Expand Down
1 change: 1 addition & 0 deletions src/helper/test-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default {
progress: 'prompt-input-progress-wrapper',
label: 'prompt-input-label',
topBar: 'prompt-input-top-bar',
topBarTitle: 'prompt-input-top-bar-title',
topBarButton: 'prompt-input-top-bar-button',
topBarContextPill: 'prompt-input-top-bar-context-pill',
topBarContextTooltip: 'prompt-input-top-bar-context-tooltip',
Expand Down
1 change: 1 addition & 0 deletions src/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ export interface ConfigTexts {
openNewTab: string;
commandConfirmation: string;
pinContextHint: string;
contextSearchPlaceholder: string;
dragOverlayText: string;
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions ui-tests/__test__/flows/prompt-top-bar/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { renderPromptTopBar } from './render-prompt-top-bar';
import { promptTopBarTooltip } from './prompt-top-bar-tooltip';
import { promptTopBarButtonOverlay } from './prompt-top-bar-button-overlay';
import { promptTopBarTitle } from './prompt-top-bar-title';

export {
renderPromptTopBar,
promptTopBarTooltip,
promptTopBarButtonOverlay,
promptTopBarTitle,
};
Loading