Repository navigation
fix(ui): let one dialog flow run at a time - #250
Merged
Merged
Conversation
The conflict dialog opened whenever a comparison found a difference, whatever was on screen. Behind the unsaved-changes prompt, a file picker or the style window it stacked a second modal, and in the gap between a prompt and its picker it could open first, so the picker then opened over it. A reconnect take replaced the recipe behind an open picker. A link drop left a dialog for a stale conflict on screen, and a close request during the dialog closed the window with it, which read as "closed without a choice" and turned sync off. AppFlows counts every operator command that can open a dialog, from its start to a finally, native pickers and the gaps between chained dialogs included. A native picker is not an app window, so only a per-command count sees it. A conflict or reconnect take during a flow waits; the write pause holds and the link slot shows the conflict. When the count reaches zero, Core compares again on the thread pool against the current screen recipe, so the dialog never acts on a recipe read before the wait. A link drop closes the dialog with its own result and keeps sync on. A close request is ignored while a dialog, picker or busy look is in front, and kept until the flow ends otherwise; a dialog the flow opens later drops it. The exit flow uses the same scopes instead of its own guard flag, and a closed window shuts the counter down, so nothing compares again after exit. A save is a flow, so the take hold that kept a take from landing during a save is gone. The conflict handling moves from MainWindowViewModel to PlcConflictFlow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
The app could show several dialogs at once and act behind them. A conflict found while the Open picker, a prompt or the style window was open popped its dialog on top, and the command behind it could replace or write the recipe meanwhile. A reconnect take could replace the screen recipe while a dialog was open. A link drop left the conflict dialog open with an outdated PLC recipe. A close request during a dialog either stacked an exit prompt or was refused with nothing visible in front.
What changed
AppFlows, one UI-thread counter, tracks operator commands that can open a dialog: New, Open, Save, Save As, the style window, the conflict dialog with its take, and the exit flow. Each command opens a scope at its start and ends it infinally, so native pickers and the gaps between chained dialogs count, and an exception cannot leave it open. It replaces_exitChoiceInProgress.AppFlowscovers it. Conflict handling moves fromMainWindowViewModel(now 293 lines) intoPlcConflictFlow.dialogs-and-interactions.mdanddocs/readme.mddescribe the rule.This is Task 6 of
docs/plans/20261130-recipe-replace-save-exit-safety.md.Verification
AppendStep_PerSurfaceTailAllocation, which also failed once before this change and does not touch dialogs.🤖 Generated with Claude Code