Files
windmill/frontend/src/lib/components/tutorials/app/BackgroundRunnablesTutorial.svelte
T
Ruben FiszelandClaude Opus 4.8 5685981c99 fix(tutorials): repair broken frontend tutorials after UI redesigns (#10255)
* fix(tutorials): repair broken frontend tutorials after UI redesigns

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(tutorials): wait for New menu anchor and drop vestigial async

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 11:49:08 +02:00

92 lines
2.6 KiB
Svelte

<script lang="ts">
import { updateProgress } from '$lib/tutorialUtils'
import { type DriveStep } from 'driver.js'
import Tutorial from '../Tutorial.svelte'
import { clickButtonBySelector } from '../utils'
interface Props {
name: string;
index: number;
}
let { name, index }: Props = $props();
let tutorial: Tutorial | undefined = $state(undefined)
export function runTutorial(skipStepsCount: number | undefined = undefined) {
tutorial?.runTutorial({ skipStepsCount })
}
</script>
<Tutorial
bind:this={tutorial}
{index}
{name}
on:error
on:skipAll
getSteps={(driver, options) => {
const steps: DriveStep[] = [
{
element: '#app-editor-runnable-panel',
popover: {
title: 'Runnable panel',
description:
'This is the runnable panel. Here you can add runnables to your app. Runnables are scripts that can be executed in the background. You can add as many runnables as you want.'
}
},
{
element: '#create-background-runnable',
popover: {
title: 'Create a runnable',
description:
'Click here to create a runnable. Runnables are scripts that can be executed in the background. You can add as many runnables as you want.',
onNextClick: () => {
clickButtonBySelector('#create-background-runnable')
setTimeout(() => driver.moveNext())
}
}
},
{
element: '#app-editor-empty-runnable',
popover: {
title: 'Empty runnable panel',
description:
'This is the empty runnable panel. Here you can add runnables to your app. Runnables are scripts that can be executed in the background. You can add as many runnables as you want. You can also select a script or a flow from your workspace or the Hub.'
}
},
{
element: '#app-editor-backend-runnables',
popover: {
title: 'Backend runnables',
description:
'Backend runnables are scripts that are executed on the server. They can be used to perform tasks that are not possible to be performed on the client. For example, you can use backend runnables to send emails, perform database operations, etc.'
}
},
{
element: '#app-editor-frontend-runnables',
popover: {
title: 'Frontend runnables',
description:
'Frontend scripts are executed in the browser and can manipulate the app context directly. You can also interact with components using component controls.',
onNextClick: () => {
setTimeout(() => {
driver.moveNext()
updateProgress(index)
})
}
}
}
]
// Remove steps if we want to skip them (excpet the first one)
if (options?.skipStepsCount) {
steps.splice(1, options.skipStepsCount)
}
return steps
}}
/>