diff --git a/app/client/src/components/designSystems/appsmith/SignPostingBanner.tsx b/app/client/src/components/designSystems/appsmith/SignPostingBanner.tsx index ad85380950..3bb836c4ba 100644 --- a/app/client/src/components/designSystems/appsmith/SignPostingBanner.tsx +++ b/app/client/src/components/designSystems/appsmith/SignPostingBanner.tsx @@ -19,7 +19,7 @@ function SignPostingBanner(props: SignPostingBannerProps) {
- {props.isAIEnabled ? ( - <> - Use /ai to generate JS expressions - - ) : props.promptMessage ? ( + {props.promptMessage ? ( props.promptMessage ) : ( <> diff --git a/app/client/src/components/editorComponents/CodeEditor/index.tsx b/app/client/src/components/editorComponents/CodeEditor/index.tsx index 016d0f4783..8d67870a34 100644 --- a/app/client/src/components/editorComponents/CodeEditor/index.tsx +++ b/app/client/src/components/editorComponents/CodeEditor/index.tsx @@ -160,6 +160,7 @@ import type { MultiplexingModeConfig } from "components/editorComponents/CodeEdi import { MULTIPLEXING_MODE_CONFIGS } from "components/editorComponents/CodeEditor/modes"; import { getDeleteLineShortcut } from "./utils/deleteLine"; import { CodeEditorSignPosting } from "@appsmith/components/editorComponents/CodeEditorSignPosting"; +import { getFocusablePropertyPaneField } from "selectors/propertyPaneSelectors"; type ReduxStateProps = ReturnType; type ReduxDispatchProps = ReturnType; @@ -541,10 +542,24 @@ class CodeEditor extends Component { //Refresh editor when the container height is increased. this.debounceEditorRefresh(); } + + const entityInformation = this.getEntityInformation(); + const isWidgetType = entityInformation.entityType === ENTITY_TYPE.WIDGET; + + const hasFocusedValueChanged = + getEditorIdentifier(this.props) !== this.props.focusedProperty; + + if (hasFocusedValueChanged && isWidgetType) { + if (this.state.showAIWindow) { + this.setState({ showAIWindow: false }); + } + } + if (identifierHasChanged) { if (this.state.showAIWindow) { this.setState({ showAIWindow: false }); } + if (shouldFocusOnPropertyControl()) { setTimeout(() => { if (this.props.editorIsFocused) { @@ -553,6 +568,7 @@ class CodeEditor extends Component { }, 200); } } + this.editor.operation(() => { if (prevProps.lintErrors !== this.props.lintErrors) { this.lintCode(this.editor); @@ -1664,6 +1680,7 @@ const mapStateToProps = (state: AppState, props: EditorProps) => ({ featureFlags: selectFeatureFlags(state), datasourceTableKeys: getAllDatasourceTableKeys(state, props.dataTreePath), installedLibraries: selectInstalledLibraries(state), + focusedProperty: getFocusablePropertyPaneField(state), }); const mapDispatchToProps = (dispatch: any) => ({