mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-29 16:15:51 +00:00
fix(frontend): forking UI issues (#7215)
* fix(frontend): forking UI issues * fix dark mode
This commit is contained in:
@@ -123,6 +123,8 @@
|
||||
enablePreprocessorSnippet = false
|
||||
}: Props = $props()
|
||||
|
||||
let initialArgs = structuredClone($state.snapshot(args))
|
||||
|
||||
$effect.pre(() => {
|
||||
if (schema == undefined) {
|
||||
schema = emptySchema()
|
||||
@@ -269,7 +271,18 @@
|
||||
})
|
||||
}
|
||||
|
||||
export async function inferSchema(code: string, nlang?: SupportedLanguage, resetArgs = false) {
|
||||
export async function inferSchema(
|
||||
code: string,
|
||||
{
|
||||
nlang,
|
||||
resetArgs = false,
|
||||
applyInitialArgs = false
|
||||
}: {
|
||||
nlang?: SupportedLanguage
|
||||
resetArgs?: boolean
|
||||
applyInitialArgs?: boolean
|
||||
} = {}
|
||||
) {
|
||||
let nschema = schema ?? emptySchema()
|
||||
|
||||
try {
|
||||
@@ -297,6 +310,10 @@
|
||||
if (resetArgs) {
|
||||
args = {}
|
||||
}
|
||||
if (applyInitialArgs) {
|
||||
// we reapply initial args as the schema form might have cleared them between mount and the schema inference
|
||||
args = initialArgs
|
||||
}
|
||||
schema = nschema
|
||||
} catch (e) {
|
||||
validCode = false
|
||||
@@ -338,7 +355,7 @@
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
inferSchema(code)
|
||||
inferSchema(code, { applyInitialArgs: true })
|
||||
loadPastTests()
|
||||
aiChatManager.saveAndClear()
|
||||
aiChatManager.changeMode(AIMode.SCRIPT)
|
||||
|
||||
Reference in New Issue
Block a user