{ if (wsProvider?.shouldConnect) { disableCollaboration() } else { setCollaborationMode() } }} customUi={{ ...customUi?.editorBar, aiGen: false }} collabLive={wsProvider?.shouldConnect} {collabMode} {validCode} iconOnly={width < EDITOR_BAR_WIDTH_THRESHOLD} on:collabPopup={() => (showCollabPopup = true)} {editor} {lang} on:createScriptFromInlineScript {websocketAlive} collabUsers={peers} kind={asKind(kind)} {template} {diffEditor} {args} {noHistory} {saveToWorkspace} >
{#if !noSyncFromGithub && customUi?.editorBar?.useVsCode != false}
Use VScode
{/if}
{#if aiPanelSize === 0} {#if customUi?.editorBar?.aiGen != false && SUPPORTED_CHAT_SCRIPT_LANGUAGES.includes(lang ?? '')}
{ toggleAiPanel() }} >
Enable Windmill AI in the
workspace settings
{/if} {#if testPanelSize === 0}
{ toggleTestPanel() }} btnClasses="bg-marine-400 hover:bg-marine-200 !text-primary-inverse hover:!text-primary-inverse hover:dark:!text-primary-inverse dark:bg-marine-50 dark:hover:bg-marine-50/70" color="marine" /> {/if} {/if}
{#key lang}
{ inferSchema(e.detail) }} on:saveDraft on:toggleAiPanel={toggleAiPanel} on:toggleTestPanel={toggleTestPanel} cmdEnterAction={async () => { await inferSchema(code) runTest() }} formatAction={async () => { await inferSchema(code) try { localStorage.setItem(path ?? 'last_save', code) } catch (e) { console.error('Could not save last_save to local storage', e) } dispatch('format') }} class="flex flex-1 h-full !overflow-visible" lang={scriptLangToEditorLang(lang)} scriptLang={lang} automaticLayout={true} {fixedOverflowWidgets} {args} />
{/key}
{#if lang && $copilotInfo.enabled}
{ editor?.reviewAndApplyCode(e.detail.code) }} >
{ toggleAiPanel() }} />
{#if testPanelSize === 0}
{ toggleTestPanel() }} btnClasses="bg-marine-400 hover:bg-marine-200 !text-primary-inverse hover:!text-primary-inverse hover:dark:!text-primary-inverse dark:bg-marine-50 dark:hover:bg-marine-50/70" color="marine" /> {/if}
{/if}
{#if showTabs}
Main
{#if hasPreprocessor}
Preprocessor
{/if}
{/if}
{ toggleTestPanel() }} />
{#if testIsLoading}
Cancel
{:else if customUi?.previewPanel?.disableTriggerButton !== true}
{ runTest() }} btnClasses="w-full rounded-r-none" size="xs" startIcon={{ icon: Play, classes: 'animate-none' }} shortCut={{ Icon: CornerDownLeft, hide: testIsLoading }} > {#if testIsLoading} Running {:else} Test {/if}
{:else}
{ runTest() }} btnClasses="w-full" size="xs" startIcon={{ icon: Play, classes: 'animate-none' }} shortCut={{ Icon: CornerDownLeft, hide: testIsLoading }} > {#if testIsLoading} Running {:else} Test {/if}
{/if}
{#key argsRender}
{/key}
{ aiChat?.fix() }} fixChatMode {lang} previewJob={testJob} {pastPreviews} previewIsLoading={testIsLoading} {editor} {diffEditor} {args} {showCaptures} customUi={customUi?.previewPanel} > {#if scriptProgress}
{/if}