Skip to content

Commit b78be3d

Browse files
committed
add ai-help globally
1 parent c19f23a commit b78be3d

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

client/packages/lowcoder/src/comps/comps/preLoadComp/tabPanes.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ export function JavaScriptTabPane(props: { comp: ConstructorToComp<typeof Script
2525
codeType: "Function",
2626
language: "javascript",
2727
placeholder: codePlaceholder,
28+
enableAIHelp: true,
29+
aiHelp: {
30+
targetKind: "javascript",
31+
label: "App JavaScript",
32+
fieldName: "preloadJavaScript",
33+
targetId: "preload.script",
34+
fieldDescription:
35+
"Application-level JavaScript loaded for the current app. Help generate, explain, or improve global methods and variables that can be used by app logic.",
36+
},
2837
})}
2938
</>
3039
);
@@ -45,7 +54,16 @@ export function CSSTabPane(props: { comp: CSSComp, isGlobal?: boolean }) {
4554
placeholder: codePlaceholder,
4655
styleName: "window",
4756
language: "css",
57+
enableAIHelp: true,
58+
aiHelp: {
59+
label: props.isGlobal ? "App Global CSS" : "App CSS",
60+
fieldName: props.isGlobal ? "preloadGlobalCSS" : "preloadCSS",
61+
targetId: props.isGlobal ? "preload.globalCSS" : "preload.css",
62+
fieldDescription: props.isGlobal
63+
? "Global CSS rules for the current app. Help generate, explain, or improve CSS that applies globally."
64+
: "Application-level CSS rules for the current app. Help generate, explain, or improve CSS for app styling.",
65+
},
4866
})}
4967
</>
5068
);
51-
}
69+
}

docs/build-applications/app-editor/ai-help.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ AI Help is shown inside supported Lowcoder code editors and structured input edi
5252
- JavaScript queries
5353
- transformers
5454
- temporary state values
55+
- app-level Scripts and Styles, including JavaScript, CSS, and Global CSS
5556
- SQL query editors
5657
- HTTP and Server-Sent Events request bodies
5758
- GraphQL query editors

0 commit comments

Comments
 (0)