Skip to content

Making the charts and transitions tabs optional in the Devtools#629

Merged
henri-hulski merged 6 commits intonextfrom
dev_features
May 21, 2025
Merged

Making the charts and transitions tabs optional in the Devtools#629
henri-hulski merged 6 commits intonextfrom
dev_features

Conversation

@henri-hulski
Copy link
Copy Markdown
Member

This adds a features object to the InitMessage when 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.

@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented May 16, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@henri-hulski henri-hulski requested a review from Copilot May 16, 2025 10:06
Copy link
Copy Markdown

Copilot AI left a comment

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 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 },

Comment thread packages/overmind/src/utils.ts
@henri-hulski henri-hulski force-pushed the dev_features branch 2 times, most recently from 1410eb9 to d0295cc Compare May 16, 2025 10:30
@henri-hulski henri-hulski merged commit d999c18 into next May 21, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants