Skip to content

Pause state machine execution#149

Merged
NejcS merged 1 commit intomainfrom
feat/pause_state_machine
Apr 9, 2026
Merged

Pause state machine execution#149
NejcS merged 1 commit intomainfrom
feat/pause_state_machine

Conversation

@NejcS
Copy link
Copy Markdown
Contributor

@NejcS NejcS commented Apr 7, 2026

https://github.com/Codeplain-ai/next-microsoft/issues/22

This introduces two new FR progresses: "paused" and "pausing". This allows the user to pause the state machine (and code rendering) so that they can put their machine to sleep and continue at a later time.

To achieve this I added another threading event (similar to the stop_event) which is set in the TUI. The state machine checks for it before every action. If event is set it sleeps until unset. There is also a new event for the event bus which just signals from the state machine to the TUI to update the progress from "pausing" to "paused.

Examples when entering paused state (user should wait before closing laptop lid):
Screenshot 2026-04-08 at 14 56 33

Example of paused state (user can close laptop lid):
Screenshot 2026-04-08 at 14 56 42

@NejcS NejcS self-assigned this Apr 7, 2026
Comment thread tui/plain2code_tui.py
Copy link
Copy Markdown
Contributor

@pedjaradenkovic pedjaradenkovic left a comment

Choose a reason for hiding this comment

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

Left a couple of small notes.

Please check them before merging. And please update the PR description with newest screenshots.

Comment thread tui/plain2code_tui.py
Comment thread plain2code.py
@NejcS NejcS marked this pull request as ready for review April 8, 2026 12:57
@NejcS NejcS requested a review from zanjonke April 8, 2026 13:07
Copy link
Copy Markdown
Contributor

@pedjaradenkovic pedjaradenkovic left a comment

Choose a reason for hiding this comment

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

Great work!

add PAUSED state to state machine

add paused state to progress items in TUI

Revert "add PAUSED state to state machine"

This reverts commit ddcef52.

add a threading event for pausing the state machine

formatting fix

remove dead code

introduce progress entering pause alongside paused

remove unused code

override textual's command palette to use the key binding

design update for the pausing and paused statuses

design and wording update

remove dead code

remove eventbus dispatch wrapping

stop progress timer when paused

remove unused import
@NejcS NejcS force-pushed the feat/pause_state_machine branch from 6cccee7 to d4b2ca4 Compare April 9, 2026 08:02
@NejcS NejcS merged commit fe9cc2f into main Apr 9, 2026
10 checks passed
@NejcS NejcS deleted the feat/pause_state_machine branch April 9, 2026 08:03
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