Skip to content

Commit f897748

Browse files
committed
Merge branch 'main' into davidkpiano/persisting-restoring-state
2 parents 8094841 + 51734e5 commit f897748

33 files changed

+1482
-302
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.wordWrap": "on"
3+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: Make the dream work! An overview of Stately Studio’s teams feature
3+
description: Getting the most out of Stately Studio’s teams feature
4+
tags: [stately studio, xstate, teams, machine versions, machine locking]
5+
authors: [gavin]
6+
slug: using-teams-in-stately-studio
7+
image: /blog/2023-09-15-stately-teams-overview.png
8+
date: 2023-09-19
9+
---
10+
11+
Our team knew early on that users needed the ability to share machines in the Studio and build on each other’s work.
12+
We also needed the Studio to be an effective tool for teams to work together and share context.
13+
But how do we do that safely, making sure the right eyes were on the right machines?
14+
And how do we protect against accidental mishaps that have plagued devs since the dawn of the computer?
15+
Being a distributed dev team ourselves, we’ve shared these same pain points and decided to build a solution directly in the Studio.
16+
Enter [Stately teams](https://stately.ai/docs/teams), our way to provide privacy and safety while allowing effortless collaboration.
17+
18+
<!--truncate-->
19+
20+
## Why would I need a team?
21+
22+
Great question, and we’re glad you asked!
23+
While we have the [Discover](https://stately.ai/registry/discover) page, which showcases over 20 thousand(!) community-created machines, we know that statecharts can contain critical details about core algorithms or processes that give businesses a competitive edge.
24+
Many users expressed interest in keeping these types of machines private, and we listened.
25+
26+
### Sharing machine visualizations with teammates
27+
28+
Developing software is collaborative by nature. To get any product launched, bug fixed, or feature shipped, teams need to work together under the same shared context.
29+
As projects grow in scope and complexity, it gets easier for team members to lose track of the bigger picture.
30+
Team members may get lost in the weeds of their own work while the rest of the project changes around them, or they may not have the full context of the project and make decisions that don’t align with the team’s goals.
31+
This is where the Studio’s teams feature comes in.
32+
Visualizing app logic as statecharts allows teams to see the entire project at a glance, and the ability to share these visualizations empowers each member to make well-informed decisions, regardless of discipline.
33+
Every teammate may not be a dev, but we’re confident that every teammate can benefit from a well-thought-out flowchart!
34+
35+
## Teams 101
36+
37+
Teams is an exclusive feature for [**Pro** and **Enterprise** users](https://stately.ai/pricing) that allows them to collaborate on different projects without needing to make them publicly visible. Team owners can assign roles that map closely with their team members’ intended set of responsibilities.
38+
39+
![The Stately Studio Next team members tab. Under Owners/Admin, Kevin is labeled as Owner. David is an admin. Laura, Farzad and Gavin are listed under Editors. Anders, cirephe, and Mateusz are listed under Viewers.](./teamVNext.png)
40+
41+
### Access control
42+
There are many times when a dev team needs to share their work context with others without granting them full rights to the projects.
43+
For example, Lenny in accounting probably shouldn't have access to the company repo, but he could benefit from visually understanding the steps involved in processes and workflows.
44+
Having different teams with different roles lets us keep parties informed without added risk.
45+
Don't trust your PM's trigger finger? Make them a [viewer](https://stately.ai/docs/teams#viewer-role); we promise not to tell.
46+
Taking a vacation before new members can be onboarded?
47+
Make another teammate an [admin](https://stately.ai/docs/teams#admin-role).
48+
[Check out all our roles and permissions in our docs](https://stately.ai/docs/teams#team-roles).
49+
50+
### Sharing conveniently and safely
51+
52+
There are ways to share machine visualizations in the Studio without teams, but they’re not ideal for many users.
53+
Users can make their projects and machines public, but that is a no-go for most businesses.
54+
Alternatively, Pro users could keep their projects private and only share with people they trust by exporting and re-importing. However, that invites potentially different sources of truth, adds potential confusion, and lacks a truly shared context.
55+
Inviting users to collaborate on the same private team allows them to share without the exporting and copy/paste gymnastics.
56+
57+
### A source of what, now?
58+
59+
Simply put, a “source of truth” is a single place where all the information about a project is stored.
60+
In our case, we wanted to make sure that teams have a single place to view and collaborate on machine visualizations, and that place is a team project in the Studio.
61+
This prevents confusion and allows for a shared context between all team members. With a proper source of truth configured, we can avoid situations like this:
62+
63+
![Four files with the filenames: onboardMachine.json, onboardMachine-final.json, onboardMachine-final-final.json, onboardMachine-actual-final-for-real-this-time.json.](/blog/2023-09-15-file-confusion.png)
64+
65+
### But what about source control? Shouldn’t that be the source of truth?
66+
67+
Ideally, yes, the team’s repository is the single source of truth for all application logic, but not every team member is a developer, nor should they all have access to source code.
68+
That said, we know teams need to ensure their machines in the Studio are always in lockstep with the rest of their source, so we added the ability to [import machines directly from GitHub](https://stately.ai/docs/import-from-github).
69+
We’re also working on a fully-fledged GitHub Sync feature, allowing users to save machines as commits back to their source repos! [Check out Anders’ demo previewing GitHub Sync in our recent office hours live stream](https://www.youtube.com/watch?v=WelBycMg2eA&t=1293s).
70+
### Superpower Pro features
71+
72+
Having teams allows other features to shine. For example, we all know the value of collaboration, but more users naturally add more potential for mistakes to happen, even with proper roles assigned. To protect against mistakes, we’ve added the ability to [lock machines](https://stately.ai/docs/lock-machines), preventing teammates from accidentally overwriting or deleting machines.
73+
74+
![A machine with locked status in Stately. Hovering over the status shows the information that the machine was Locked by cirephe on September 8, 2023 at 07:48PM.](./lockedScreenshot.png)
75+
76+
Team members often need to manage and track variants of the same machine, so we added the ability to create [machine versions](https://stately.ai/docs/versions). Members can edit and save specific checkpoints of their machines and can even see the last person to and save a specific version. Team roles come into play here again by allowing only owners and admins to actually delete versions.
77+
78+
![Machine versions panel in Stately. The current version is named Gavin’s ultimate joke machine. The previous version is a generated flow for a “A flow showing someone how to be funny.”](./versionScreenshot.png)
79+
80+
## FAQs
81+
82+
### Who can join my team?
83+
84+
Anyone with an email address can be invited to a team!
85+
If they are not already members, they will have to [sign up for a Stately account](https://stately.ai/registry/login?).
86+
87+
### How many users can be on a team?
88+
89+
A team can have as many members as there are seats in your Pro or Enterprise plan, except for viewers.
90+
Viewers are free to add.
91+
92+
### Does inviting a user take up a seat on the team?
93+
94+
The seat is only taken once a user accepts the invite and claims the seat.
95+
If the invite was not accepted, the seat remains free.
96+
97+
### Can I swap member roles and reclaim seats?
98+
Yes, but only owners and admins have the ability to reassign roles.
99+
Any role except the owner may choose to leave the team, however.
100+
The owner can instead delete the team.
101+
102+
Yes, but only owners and admins can reassign roles.
103+
Any role except the owner may choose to leave the team, however.
104+
The owner can instead delete the team.
105+
106+
For more detailed information, visit our [Stately teams page in the docs](https://stately.ai/docs/teams#teams-members-and-pro-plan-seats)!
32.4 KB
Loading
285 KB
Loading
514 KB
Loading

docs/actions-and-actors/entry-and-exit-actions.mdx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ Use the <kbd>Backspace</kbd> key to delete the action.
9393

9494
## Add a built-in action
9595

96-
You can add built-in XState actions which will be formatted in your [exported code](export-as-code.mdx). The options are:
96+
You can add built-in XState actions which will be formatted in your [exported code](/docs/export-as-code.mdx). The options are:
9797

98-
- [assign](#assign-action): assigns data to the state context.
99-
- [raise](#raise-action): _raises_ an event that is received by the same machine.
100-
- [log](#log-action): an easy way to log messages to the console.
101-
- [sendTo](#send-to-action): sends an event to a specific actor.
102-
- [stop](#stop-action): stops a child actor.
98+
- [assign](/docs/xstate/actions/context#assign-action): assigns data to the state context.
99+
- [raise](/docs/xstate/actions/built-in-actions#raise-action): _raises_ an event that is received by the same machine.
100+
- [log](/docs/xstate/actions/built-in-actions#log-action): an easy way to log messages to the console.
101+
- [sendTo](/docs/xstate/actions/built-in-actions#sending-events-to-actors): sends an event to a specific actor.
102+
- [stop](/docs/xstate/actors/spawn#stopping-spawned-actors): stops a child actor.
103103

104-
To add a built-in action, first add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-to-a-state), or [exit action](#add-an-exit-action-to-a-state).
104+
To add a built-in action, first add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-or-exit-action-to-a-state), or [exit action](#add-an-entry-action-or-exit-action-to-a-state).
105105

106106
### On the canvas
107107

@@ -114,15 +114,15 @@ To add a built-in action, first add a [transition action](#add-a-transition-acti
114114

115115
1. Open the state, or event <Info size={18} /> **Details** panel from the right tool menu.
116116
1. Hover, focus, or select the action block to reveal the <Edit size={18} /> edit icon button.
117-
2. Use the <Edit size={18} /> edit icon button to open the **Action** panel.
118-
3. Choose your desired action from the dropdown menu at the top of the **Action** panel.
119-
4. Fill out the required corresponding action input fields.
117+
1. Use the <Edit size={18} /> edit icon button to open the **Action** panel.
118+
1. Choose your desired action from the dropdown menu at the top of the **Action** panel.
119+
1. Fill out the required corresponding action input fields.
120120

121121
## Add a custom action
122122

123-
You can also add custom actions with a custom action type and parameters which will be formatted as [XState action objects](#action-objects) in your [exported code](export-as-code.mdx).
123+
You can also add custom actions with a custom action type and parameters which will be formatted as [XState action objects](/docs/xstate/actions) in your [exported code](/docs/export-as-code).
124124

125-
First, add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-to-a-state), or [exit action](#add-an-exit-action-to-a-state).
125+
First, add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-or-exit-action-to-a-state), or [exit action](#add-an-entry-action-or-exit-action-to-a-state).
126126

127127
### On the canvas
128128

@@ -131,16 +131,16 @@ First, add a [transition action](#add-a-transition-action), [entry action](#add-
131131
3. Custom action is selected by default. Add your custom action type in the **Action type** text input.
132132
4. Add your custom **Action parameters** using the **Parameter key** and **Parameter value** text input pairs.
133133

134-
[Read about action objects below for more on action types and and parameters](#action-objects).
134+
[Read about action objects below for more on action types and and parameters](/docs/xstate/actions).
135135

136136
### Using the details panel
137137

138138
1. Open the state, or event <Info size={18} /> **Details** panel from the right tool menu.
139139
1. Hover, focus, or select the action block to reveal the <Edit size={18} /> edit icon button.
140-
2. Use the <Edit size={18} /> edit icon button to open the **Action** panel.
141-
3. Custom action is selected by default. Add your custom action type in the **Action type** text input.
142-
4. Add your custom **Action parameters** using the **Parameter key** and **Parameter value** text input pairs.
143-
:::xstate
140+
1. Use the <Edit size={18} /> edit icon button to open the **Action** panel.
141+
1. Custom action is selected by default. Add your custom action type in the **Action type** text input.
142+
1. Add your custom **Action parameters** using the **Parameter key** and **Parameter value** text input pairs.
143+
:::xstate
144144

145145
## Looking for how to use entry and exit actions in XState?
146146

docs/studio.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ Here you can find all the documentation for the Stately Studio and [XState](/xst
99

1010
<ul className="content-boxes">
1111
<li>
12-
<a className="link-box" href="states/intro">
12+
<a className="link-box" href="docs/states/intro">
1313
🏁 <strong>Get started</strong> Jump straight into learning how to use the
1414
editor, starting with states.
1515
</a>
1616
</li>
1717
<li>
18-
<a className="link-box" href="#stately-studio-editor">
18+
<a className="link-box" href="#stately-studios-editor">
1919
⬇️ <strong>Editor overview</strong> Keep reading to find out more about
2020
Stately Studio’s editor.
2121
</a>
2222
</li>
2323
<li>
24-
<a className="link-box" href="state-machines-and-statecharts">
24+
<a className="link-box" href="docs/state-machines-and-statecharts">
2525
🧠 <strong>Learn state machines and statecharts</strong> With our no-code
2626
introduction.
2727
</a>
2828
</li>
2929
<li>
30-
<a className="link-box" href="/docs/xstate">
30+
<a className="link-box" href="docs/xstate">
3131
💻 <strong>Learn XState</strong> Get started with our JavaScript and
3232
TypeScript library for state machines and statecharts.
3333
</a>
@@ -69,6 +69,7 @@ Stately Studio’s editor supports everything you need to visually build state m
6969
You can access quick start tutorials from the blue <HelpCircle size={12} /> Help button in the editor.
7070

7171
When you first visit the Editor, you’ll be shown two short videos (7m36s) as a quick start guide. You can access these videos again anytime from:
72+
7273
- Editor menu > Help > <GraduationCap size={12} /> **Learn Stately**.
7374
- The <HelpCircle size={12} /> Help button > <GraduationCap size={12} /> **Learn Stately**.
7475

docs/tools/visualizer.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Are you looking for the _Stately Studio_ visual _Editor_? Check out the [Stately
1717

1818
:::tip
1919

20-
Stately still supports the Stately Visualizer, but you will find many more advanced features, including the visual [Studio Editor](studio.mdx/#studio-editor), teams, and shared projects.
20+
Stately still supports the Stately Visualizer, but you will find many more advanced features, including the visual [Studio Editor](/studio.mdx#stately-studios-editor), teams, and shared projects.
2121

2222
:::
2323

docs/tools/xstate-vscode-extension.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You can also [download the VS Code extension from the VS Code marketplace](https
3535

3636
## TypeScript typegen
3737

38-
You can automatically generate intelligent typings for XState with our VS Code extension and [command line interface](/tools/developer-tools.mdx#xstate-cli-command-line-interface). [Read more about how to use typegen, and our recommended best practices, on the Typegen page](../xstate/typescript/typegen).
38+
You can automatically generate intelligent typings for XState with our VS Code extension and [command line interface](/tools/developer-tools.mdx#xstate-cli-command-line-interface). [Read more about how to use typegen, and our recommended best practices, on the Typegen page](/docs/xstate/typescript/typegen).
3939

4040
## `xsm` snippet
4141

docusaurus.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const config = {
1212
baseUrl: '/',
1313
baseUrlIssueBanner: false,
1414
onBrokenLinks: 'throw',
15-
onBrokenMarkdownLinks: 'warn',
15+
onBrokenMarkdownLinks: 'throw',
1616
favicon: 'icon.svg',
1717
staticDirectories: ['static'],
1818

@@ -90,7 +90,7 @@ const config = {
9090
blogSidebarCount: 0,
9191
postsPerPage: 10,
9292
editUrl: ({ locale, blogDirPath, blogPath, permalink }) =>
93-
`https://github.com/statelyai/docs/edit/main/${blogDirPath}/${blogPath}`
93+
`https://github.com/statelyai/docs/edit/main/${blogDirPath}/${blogPath}`,
9494
},
9595
theme: {
9696
customCss: require.resolve('./src/css/custom.css'),

0 commit comments

Comments
 (0)