feat(terminal): signal-driven node-console refresh (part of #215)#222
Merged
Conversation
Replace the ~2s value poll with event-driven refresh. The D-Bus signal
handlers (event-loop thread) set two atomic dirty flags on ActivityState:
- nodesDirty — on NodeInclusionStatus / NodeExclusionStatus COMPLETED and on
the RemoveFailedNode result phase (the list changed);
- valuesDirty — on the new NodeValueChanged signal (#213).
The UI loop (main thread) exchanges the flags each tick and re-fetches the
node list / the selected node's values accordingly — keeping all D-Bus calls
on the UI thread (the handlers only flip a flag, so no re-entrant sync call
into the async event loop). [r] still forces a manual refresh; value age keeps
ticking via the 100ms redraw without re-fetching.
There's no NodeListChanged D-Bus signal today, so the list refresh is driven
off the existing status signals (covers add / remove / remove-failed); a
dedicated signal could replace that later. Builds on both presets; 471/471
ctest unaffected; clang-format + clang-tidy clean.
Remaining #215: the DSK confirm modal (#187).
Co-Authored-By: Claude Opus 4.8 <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.
Makes the console feel real-time: the node list and the selected node's values update on signals, not on a
[r]press or a 2s poll.What
Two atomic dirty flags on
ActivityState, set by the D-Bus signal handlers (event-loop thread) and consumed by the UI loop (main thread):nodesDirty— set onNodeInclusionStatus/NodeExclusionStatusCOMPLETED and on theRemoveFailedNoderesult phase → re-fetchGetNodes.valuesDirty— set on the newNodeValueChangedsignal (Per-node value cache: last-known dynamic values + timestamps #213) → re-fetch the selected node'sGetNodeValues.The UI loop
exchange()es the flags each tick and refreshes accordingly. This keeps all D-Bus calls on the UI thread — the handlers only flip an atomic, so there's no re-entrant synchronous call into the async event loop (which would deadlock).[r]still forces a manual refresh; value age keeps ticking via the 100ms redraw without re-fetching.Why status-driven for the list
There's no
NodeListChangedD-Bus signal today (only the internal bus event), so the list refresh is driven off the existing status signals — which cover the real list changes (add / remove / remove-failed). A dedicatedNodeListChangedsignal could replace that later (noted in TODO).Notes
Builds on both presets; 471/471 ctest unaffected (TUI has no ctest harness); clang-format + clang-tidy clean.
Remaining #215
Just the DSK confirm modal (
DSKPendingConfirmation/ConfirmDSK, #187) — then the console redesign is complete.Part of #215.
🤖 Generated with Claude Code