Making the charts and transitions tabs optional in the Devtools#629
Merged
henri-hulski merged 6 commits intonextfrom May 21, 2025
Merged
Making the charts and transitions tabs optional in the Devtools#629henri-hulski merged 6 commits intonextfrom
henri-hulski merged 6 commits intonextfrom
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
There was a problem hiding this comment.
Pull Request Overview
This PR implements an optional feature flag mechanism for the DevTools to conditionally display the transitions and charts tabs based on whether the app uses state machines or state charts. Key changes include:
- Adding functions to detect state machines and state charts in the Overmind state tree.
- Extending the Overmind initialization and flush messages with a "features" object.
- Updating the DevTools client code (types, operators, UI components, and documentation) to support the new feature flags.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/overmind/src/utils.ts | Added detection utilities for state machines and state charts along with helper functions for traversing the state tree |
| packages/overmind/src/Overmind.ts | Included a "features" object in the initialization and flush messages to indicate supported features |
| packages/overmind-devtools-client/src/overmind/utils.ts | Updated default app creation to include feature flags |
| packages/overmind-devtools-client/src/overmind/types.ts | Extended App and InitMessage types to include optional feature flags |
| packages/overmind-devtools-client/src/overmind/operators.ts | Incorporated handling of feature flags during state updates with backward compatibility defaults |
| packages/overmind-devtools-client/src/components/Tabs/index.tsx | Modified tab rendering to conditionally show transitions and charts tabs based on feature flags |
| packages/overmind-devtools-client/index.html | Improved robustness with optional chaining for electron environment checks |
| packages/overmind-devtools-client/README.md | Updated documentation to indicate that transitions and charts tabs are optional |
Comments suppressed due to low confidence (1)
packages/overmind-devtools-client/src/overmind/utils.ts:80
- Review the default values for 'features' in createApp for consistency with the Overmind init message and operators; consider adding a comment to clarify why transitions default to true here while later logic defaults to false.
features: { transitions: true, charts: true },
1410eb9 to
d0295cc
Compare
977f2de to
e29ff57
Compare
e29ff57 to
47e3793
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
featuresobject to theInitMessagewhen initializing the devtools, which allows to tell the devtools which features the app supports.So for Overmind charts / transitions tabs are only shown, when the app uses
overmind-statechart/ state machines.