Skip to content

Commit

Permalink
Clarifying app section & quickstart (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
hcourdent authored Oct 10, 2023
1 parent 1fca9b2 commit 32194bc
Show file tree
Hide file tree
Showing 43 changed files with 470 additions and 316 deletions.
75 changes: 50 additions & 25 deletions docs/apps/0_app_editor/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ The app editor is composed of 6 main sections:

1. [Toolbar](/docs/apps/app_editor#toolbar)
2. [Canvas](#canvas)
3. [Outputs](#outputs)

_Connecting components_:<br/>
3. [Outputs](#outputs)<br/>
4. [Runnables panel](#runnables-panel)

5. [Component Library and Settings](#component-library-and-settings)
6. [App Styling](#styling)

Expand All @@ -45,7 +48,7 @@ The topbar helps you in your app editing.
<div class="grid grid-cols-2 gap-2">
<DocCard
color="orange"
title="Toolbar guide"
title="Toolbar"
description="Discover all the features of the toolbar."
href="/docs/apps/toolbar"
/>
Expand All @@ -68,7 +71,7 @@ The canvas at the center of the editor is where you design and see the overall U
<div class="grid grid-cols-2 gap-2">
<DocCard
color="orange"
title="Canvas guide"
title="Canvas"
description="Move, resize, and nest components."
href="/docs/apps/canvas"
/>
Expand All @@ -80,7 +83,46 @@ The canvas at the center of the editor is where you design and see the overall U
/>
</div>

## Outputs
## Connecting Components

The strength of Windmill's app editor is the ability to connect everything together:
- components can be linked to each other
- components can be directly linked to scripts and trigger them
- background runnables can be that are run in the background on app refresh on when an input changes
- frontend scripts can be used to manipulate the client app state

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
color="orange"
title="Connecting Components"
description="The strength of Windmill's app editor is the ability to connect everything together."
href="/docs/apps/connecting_components"
/>
</div>

In Windmill's app editor:

- the [runnable editor](#runnables-panel) catalogs and configures all the scripts present in the application
- the [output panel](#outputs) lists the outputs of all the components and scripts in your application

### Runnables panel

On the bottom panel of the editor, you can see the list of runnables of the app. The runnables are the scripts or flows that are linked to components, or ran in the background. They are used to perform actions when a component is clicked, to fetch data, etc. They make all the interactions of the app.

![App Runnables panel](../../assets/apps/0_app_editor/app-runnable-panel.png)

#### Learn more

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
color="orange"
title="Runnable Editor"
description="Learn how to create and configure runnables."
href="/docs/apps/app-runnable-panel"
/>
</div>

### Outputs

On the left panel of the editor, you can see the list of outputs of the app. These outputs represent the states & results of the app and are categorized into four types:

Expand All @@ -96,7 +138,7 @@ You can perform the following actions with the outputs:
- Search for an output.
- Edit the output's ID.
- Select a component to view its outputs.
- [Connect an input to an output](../2_outputs.md#connecting-inputs).
- [Connect an input to an output](../2_connecting_components/index.mdx).

#### Learn more

Expand All @@ -115,23 +157,6 @@ You can perform the following actions with the outputs:
/>
</div>

## Runnables panel

On the bottom panel of the editor, you can see the list of runnables of the app. The runnables are the scripts or flows that are linked to components, or ran in the background. They are used to perform actions when a component is clicked, to fetch data, etc. They make all the interactions of the app.

![App Runnables panel](../../assets/apps/0_app_editor/app-runnable-panel.png)

#### Learn more

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
color="orange"
title="Runnable Guide"
description="Learn how to create and configure runnables."
href="/docs/apps/app-runnable-panel"
/>
</div>

## Component Library and Settings

Finally, on the right panel of the editor, you can insert a new component, configure a component or edit the component styles.
Expand All @@ -151,9 +176,9 @@ Finally, on the right panel of the editor, you can insert a new component, confi
/>
<DocCard
color="orange"
title="Runnable Triggers"
description="Learn how to trigger a runnable."
href="/docs/apps/app_configuration_settings/app_runnable_triggers"
title="Component Configuration"
description="Each component can be configured individually. This allows for adjusting its value, behavior (especially by linking a script to the component), and styling."
href="/docs/apps/app_configuration_settings/app_component_configuration"
/>
</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/apps/0_toolbar.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Toolbar Guide
# Toolbar

The app toolbar is located at the top of the app editor. It enables you to adjust app settings.

Expand Down
46 changes: 12 additions & 34 deletions docs/apps/1_canvas.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import DocCard from '@site/src/components/DocCard';

# Canvas Guide
# Canvas

The app canvas is the main area of the app editor. It displays the app components and allows you to configure them.
You can move and resize components and lock them to prevent them from being moved or resized by another component.

<video
className="border-2 rounded-xl object-cover w-full h-full dark:border-gray-800"
autoPlay
loop
controls
id="main-video"
src="/videos/dnd.mp4"
/>

<br/>

The apps are defined by two layouts: `Mobile` and `Desktop`. The layout can be toggled from the toolbar. Layouts are independent and can be configured separately.

## Header
Expand Down Expand Up @@ -136,39 +147,6 @@ Debug a tab by clicking on the arrow down button on the top-right corner of the
src="/videos/app-debug-tabs.mp4"
/>

## Copy-Pasting Components Across Apps

Windmill allows you to copy and paste components across different apps. This feature provides a way to create a library of predefined complex components, which can then be shared and reused across various applications.

### How it Works

The process of copying and pasting components is straightforward:

1. Open the application containing the component you wish to copy.
2. Select the component on the Canvas.
3. Use the standard copy shortcut (`Ctrl+C` on PC or `Cmd+C` on Mac).
4. Navigate to the other application where you wish to paste the component.
5. Click on the Canvas in the location where you wish to paste the component.
6. Use the standard paste shortcut (`Ctrl+V` on PC or `Cmd+V` on Mac).

The component, with all its predefined configurations and styles, will appear on the Canvas of the second application.

### Use Cases

#### Shared Component Repository (Modules)

Create a dedicated application to serve as a repository for shared components. This repository can then be used as a source for components, which can be copied and pasted into other applications.

Increase efficiency in application development by reusing complex components. Rather than creating and configuring components from scratch for each new application, you can simply copy and paste existing ones.

![Shared Components](../assets/apps/6_app_settings/shared_components.gif)

#### Style Consistency

Maintain consistency in style across multiple applications by creating styled components once and then copying and pasting them into various applications.

![Style Consistency](../assets/apps/6_app_settings/style_consistency.gif)

### Learn More

<div class="grid grid-cols-2 gap-6 mb-4">
Expand Down
117 changes: 117 additions & 0 deletions docs/apps/2_connecting_components/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import DocCard from '@site/src/components/DocCard';

# Connecting Components

The strength of Windmill's app editor is the ability to connect everything together:
- components [can be linked to each other](#connecting-inputs--outputs)
- components can be directly [linked to scripts](../3_app-runnable-panel.mdx) and trigger them
- [background runnables](../3_app-runnable-panel.mdx#background-runnables) can be that are run in the background on app refresh on when an input changes
- [frontend scripts](../3_app-runnable-panel.mdx#evals) can be used to manipulate the client app state

<video
className="border-2 rounded-xl object-cover w-full h-full"
controls
src="/videos/connecting_components.mp4"
id="main-video"
/>

<br/>

In Windmill's app editor:

- the [runnable editor](#runnable-editor) catalogs and configures all the scripts present in the application
- the [output panel](#outputs-panel) lists the outputs of all the components and scripts in your application
- the [component settings](#component-configuration) allows for managing the inputs of the components as well as linking them to scripts.

## Runnables & Outputs

In order to connect the components, it is best to be familiar with the concepts of [Runnable](#runnable-editor) and [Output](#outputs-panel).

### Runnable Editor

On the bottom of the app editor, you can find the Runnable Editor. It allows you to create, edit, or manage the scripts or flows linked to components (runnables) and background runnables.

![App Runnables panel](../../assets/apps/0_app_editor/app-runnable-panel.png)

The panel is structured as follows:

- **Runnable list**: A list of all the runnables. Click on a runnable to select it.
- **Runnable editor**: The editor of the selected runnable.

Each script can have [inputs from other components](../3_app-runnable-panel.mdx#configure-triggers). The script will return [outputs](#outputs-panel) that can be used in other components.

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
color="orange"
title="Runnable Editor"
description="Learn how to create and configure runnables."
href="/docs/apps/app-runnable-panel"
/>
</div>

### Outputs Panel

On the left panel of the editor, you can see the list of outputs of the app. These outputs represent the states & results of the app and are categorized into four types:

- **Context**: The context holds information such as the user email, username, workspace, query parameters, and more.
- **State**: The state holds the app's current state, which can be manipulated by the frontend scripts.
- **Component Outputs**: These outputs correspond to the outputs of the individual components.
- **Background Runnables**: These outputs represent the outputs of the background runnables.

![App Outputs](../../assets/apps/0_app_editor/app-outputs.png)

You can perform the following actions with the outputs:

- Search for an output.
- Edit the output's ID.
- Select a component to view its outputs.
- [Connect an input to an output](../2_connecting_components/index.mdx).

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
color="orange"
title="Outputs"
description="The outputs represent the states & results of the app"
href="/docs/apps/outputs"
/>
</div>

### Component Configuration

Each component can be configured individually. This allows for adjusting its value, behavior (especially by linking a script) to the component, and styling.

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
color="orange"
title="Component Configuration"
description="Learn how to configure a component."
href="/docs/apps/app_configuration_settings/app_component_configuration"
/>
</div>

## Connecting Inputs & Outputs

Inputs (from scripts or components) can be connected to any outputs. When connecting, you can click on the output to connect the input to it. The data source will change to [eval](../3_app-runnable-panel.mdx#evals).

Note that you can select nested outputs, objects and arrays.

<video
className="border-2 rounded-xl object-cover w-full h-full dark:border-gray-800"
controls
src="/videos/app-connections.mp4"
alt="Connecting inputs"
/>

<br/>

Here are the steps to connect an input to an output:

- Click on the component input you want to connect to an output.
- Click on the plug icon to open the connection menu, then:
- either click on the red plug directly next to the component, and pick the output
- or pick the component directly from the output menu on the left.
- The input is now connected to the output through an eval.

Alternatively, refer to the component directly through an [eval](../3_app-runnable-panel.mdx#evals), e.g. `a.result`.

![App outputs](../../assets/apps/2_app_outputs/connecting_eval.png "Connecting through eval")
30 changes: 18 additions & 12 deletions docs/apps/2_outputs.md → docs/apps/2_outputs.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import DocCard from '@site/src/components/DocCard';

# Outputs Guide

The outputs represent the states & results of the app.
Expand All @@ -8,14 +10,14 @@ All outputs can be found on the left-hand side of the app editor. There are thre
- Component outputs
- Background runnables outputs

![App demo outputs](../assets/apps/2_app_outputs/app-demo-outputs.png.webp)
![App demo outputs](../assets/apps/2_app_outputs/app-demo-outputs.png)

When a component or a background runnable is selected, the outputs of the component or the background runnable are displayed.
You can manually open an output by clicking on the header of the output. Once manually opened, the output will stay open until you close it.

You can search for an output by typing in the search bar. It searches in the output name and in the output object keys, recursively.

![App outputs](../assets/apps/2_app_outputs/app_outputs.png.webp)
![Search outputs](../assets/apps/2_app_outputs/search_output.png "Search outputs")

### App context

Expand All @@ -34,7 +36,7 @@ The app state is a client-side store that can be used to store data. The app sta

Each component has its own outputs. The outputs are displayed in a tree structure. The tree structure is collapsible and can be expanded by clicking on the `{...}` button. Next to the button, you can see the number of outputs.

![App outputs](../assets/apps/2_app_outputs/app-output-collapsed.png.webp)
![App outputs collapsed](../assets/apps/2_app_outputs/app-output-collapsed.png "App outputs collapsed")

For example, the [Table component](./4_app_configuration_settings/table.mdx) has the following outputs:

Expand All @@ -44,26 +46,30 @@ For example, the [Table component](./4_app_configuration_settings/table.mdx) has
- search: the search value of the table
- selectedRowIndex: the selected row index

![App outputs](../assets/apps/2_app_outputs/app_outputs.png.webp)
![App outputs](../assets/apps/2_app_outputs/app_outputs.png)

The outputs are used to quickly visualize the current state of the app.

### Containers

Some components are "containers" and can contain other components. They are 4 types of containers:

- Containers: Plain container that can contain other components
- Tabs: Tabs that can contain other components
- Horizontal split: Horizontal split that can contain other components
- Vertical split: Vertical split that can contain other components
Some components are "containers" and can contain other components.

The components contained in a container have their outputs displayed in the container outputs.

![App outputs](../assets/apps/2_app_outputs/app-output-container.png.webp)
![App outputs](../assets/apps/2_app_outputs/app-output-container.png)

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
title="Layout (Containers)"
description="Containers can group other components."
href="/docs/apps/app_configuration_settings/app_component_library#layout"
color="orange"
/>
</div>

### Background runnables outputs

A background runnable is a script or flow that runs in the background and can be used to perform actions that are not related to the UI.
A [background runnable](./3_app-runnable-panel.mdx#background-runnables) is a script or flow that runs in the background and can be used to perform actions that are not related to the UI.

### Connecting inputs

Expand Down
Loading

0 comments on commit 32194bc

Please sign in to comment.