Repository navigation
feat(ui): show sync waits in the link slot - #248
Merged
Merged
Conversation
With sync on and the link up, the link slot showed the green "PLC: connected" in three states where the PLC did not follow the screen. The write pause held while the reconnect comparison ran. A conflict dialog was open or waiting. Or nothing was written, because the recipe had warnings or a write waited for the PLC run to end (plan rows D2, A1, A14). The toggle in Enabling also kept "connecting" after the link was up, so a comparison inside the enable never showed. PlcSyncCoordinator now puts the write pause and a not-written cause (Warnings, RunActive) into PlcSessionSnapshot, builds every snapshot from the state after the change, and emits one whenever either value changes. Warnings follows the latest notified recipe, not the status: a write that started before an invalid edit still ends Synced. A normal write in its debounce or in flight has no cause, and neither has a recipe whose warnings were just fixed, so the slot does not flash grey after an edit. PlcComparisonState owns a conflict-open flag, true while a conflict offer is current, and PlcLifecycleManager exposes it. PlcLinkViewModel starts from the current snapshot and resolves both in the order of the UI design: Disconnecting, SyncOff, Connecting (link not up yet), NoLink, Conflict (red dot), Comparing (hollow grey dot), SyncError, NotWritten (filled grey dot), Connected. The tooltip adds what the write waits for, or the cause of NotWritten. The SyncError latch is unchanged. 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 status bar link slot showed green "ПЛК: подключено" while the PLC did not hold the screen recipe: during a write pause after a reconnect, while a conflict dialog was open or waiting, while the recipe had warnings so it was not written, and while a write was parked until a run ended. A failed or blocked state looked like a healthy link.
What changed
docs/plans/20261130-recipe-replace-save-exit-safety-ui.md, section 1):PlcSessionSnapshot.IsWritePausedandNotWrittenCausefromPlcSyncCoordinator,IsConflictOpenfromPlcComparisonState. The warnings cause follows the latest notified recipe, so a write that finishes after the recipe gained warnings does not turn the slot green. Each snapshot is built from the final state of its transition.docs/readme.mdlists the new states.This is Task 4 of
docs/plans/20261130-recipe-replace-save-exit-safety.md.Verification
dotnet format --verify-no-changesclean.🤖 Generated with Claude Code