Skip to content

Fsm transition api - #216

Draft
jermeyyy wants to merge 5 commits into
respawn-llc:masterfrom
jermeyyy:fsm-transition-api
Draft

jermeyyy wants to merge 5 commits into
respawn-llc:masterfrom
jermeyyy:fsm-transition-api

Conversation

@jermeyyy

Copy link
Copy Markdown

#209

Add FSM transitions plugin with compose support

@coderabbitai

coderabbitai Bot commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ac0a242f-484b-4609-9228-b3a73cef3a5b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a robust Finite State Machine (FSM) API for FlowMVI, enabling developers to define state-dependent intent handlers with enhanced type safety and enforced transitions. The new plugin streamlines complex state logic by replacing traditional reduce {} blocks and integrates seamlessly with child store composition, offering both always-active and state-scoped child store management. This feature aims to improve code clarity, maintainability, and prevent invalid state changes in MVI architectures.

Highlights

  • FSM Transitions API: Introduced a new Finite State Machine (FSM) transitions API for FlowMVI, providing a type-safe and structured way to handle intents based on the current state.
  • Child Store Composition: Added support for composing child stores within the FSM DSL, allowing for both top-level (always active) and state-scoped (active only in specific parent states) compositions.
  • State Transition Enforcement: Implemented enforcement rules for state transitions, which throw an InvalidStateException in debug mode for external cross-type transitions and silently veto them in release mode.
  • Enhanced Handler Context: Provided a new TransitionScope for FSM handlers, offering a typed state property and convenience transitionTo methods, while retaining full PipelineContext access.
  • Comprehensive Documentation and Tests: Included detailed design and implementation plans for the FSM feature and sample screens, along with extensive unit tests for both transitions and compose functionalities.
  • Dependency Updates: Updated Kotlin to version 2.3.20 and kotlinx-atomicfu to 0.32.0 in the Gradle configuration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive Finite State Machine (FSM) and composition API, which is a significant and powerful addition to the library. The implementation is well-structured, extensively tested, and thoroughly documented. I've identified a critical type-safety issue in the new compose plugin that could lead to runtime exceptions, and I've proposed a refactoring across two files to resolve it. Additionally, I found a minor contradiction in one of the new agent definition files. Once these points are addressed, this will be an excellent feature enhancement.

Comment thread core/src/commonMain/kotlin/pro/respawn/flowmvi/plugins/ComposePlugin.kt Outdated
Comment thread core/src/commonMain/kotlin/pro/respawn/flowmvi/plugins/TransitionGraph.kt Outdated
Comment thread .github/agents/Simple-Developer.agent.md
coderabbitai[bot]
coderabbitai Bot previously approved these changes Mar 21, 2026
@Nek-12

Nek-12 commented May 23, 2026

Copy link
Copy Markdown
Member

do you have plans to un-draft this? otherwise i will close this for now.

This branch has not been deployed

No deployments
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