Skip to content

[Docs] Reintroduce states flow chart - #4352

Merged
m-bert merged 9 commits into
mainfrom
@mbert/update-state-flow-chart
Jul 29, 2026
Merged

[Docs] Reintroduce states flow chart#4352
m-bert merged 9 commits into
mainfrom
@mbert/update-state-flow-chart

Conversation

@m-bert

@m-bert m-bert commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR reintroduces states flow example to our docs.

Comparison

Before

before.mov

After

Screen.Recording.2026-07-28.at.10.59.25.mov

Test plan

Read docs 🤓

Copilot AI review requested due to automatic review settings July 27, 2026 15:15
@m-bert m-bert added the Documentation Documentation change/enhancement label Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reintroduces an interactive “state flow” diagram into the documentation, using a new v3-hooks-based example for current docs while keeping a legacy flow chart example wired into the versioned v2.x docs.

Changes:

  • Added a new interactive “State flows” section to the “Handler State” docs page that embeds the updated flow diagram.
  • Replaced the v2.x “states & events” embedded example to use the legacy flow chart implementation.
  • Refactored/added example implementations and styling for both the new diagram and the legacy flow chart.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/docs-gesture-handler/versioned_docs/version-2.x/fundamentals/states-events.mdx Points the v2.x page at the legacy flow chart example.
packages/docs-gesture-handler/src/examples/GestureStateFlowExampleLegacy/index.tsx Adds the legacy interactive chart example entry point.
packages/docs-gesture-handler/src/examples/GestureStateFlowExampleLegacy/FlowChart.tsx Import/type cleanup for the legacy flow chart rendering.
packages/docs-gesture-handler/src/examples/GestureStateFlowExampleLegacy/ChartManager.ts Import/type cleanup for the legacy chart manager.
packages/docs-gesture-handler/src/examples/GestureStateFlowExampleLegacy/ChartItem.tsx Import/type cleanup for chart item rendering.
packages/docs-gesture-handler/src/examples/GestureStateFlowExampleLegacy/Arrow.tsx Adds SVG arrow rendering used by the legacy chart.
packages/docs-gesture-handler/src/examples/GestureStateFlowExample/styles.module.css Adds CSS-module styling for the new diagram (including font imports).
packages/docs-gesture-handler/src/examples/GestureStateFlowExample/index.tsx Reworks the main example to a v3-hooks-based interactive diagram for the docs site.
packages/docs-gesture-handler/docs/under-the-hood/state.mdx Embeds the new “State flows” interactive diagram into the docs page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@j-piasecki j-piasecki left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of the yellow "start" label for UNDETERMINED. I feel like it's going back to onBegin/onStart confusion. What about something like "Waiting for input"?

@m-bert

m-bert commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

I'm not a fan of the yellow "start" label for UNDETERMINED. I feel like it's going back to onBegin/onStart confusion. What about something like "Waiting for input"?

I've removed legend as it doesn't bring any value to this example.

@m-bert
m-bert requested a review from j-piasecki July 28, 2026 09:09

@j-piasecki j-piasecki left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the same comments about fonts and colors as in the other one.

Comment thread packages/docs-gesture-handler/src/examples/GestureStateFlowExample/index.tsx Outdated
@m-bert

m-bert commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

Also the same comments about fonts and colors as in the other one.

@j-piasecki as for the color, yes, it was predefined. Changed it in 7dfe41f.

As for the font, I asked what you think here. I think new one looks good and fits the example well. But if you think that we should use the one that we already have - I can change it.

@m-bert
m-bert requested a review from j-piasecki July 29, 2026 06:21
@m-bert
m-bert merged commit 3b997dc into main Jul 29, 2026
2 checks passed
@m-bert
m-bert deleted the @mbert/update-state-flow-chart branch July 29, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Documentation change/enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants