Skip to content

feat(terminal): signal-driven node-console refresh (part of #215)#222

Merged
Assar63 merged 1 commit into
masterfrom
feat/terminal-auto-refresh
Jun 18, 2026
Merged

feat(terminal): signal-driven node-console refresh (part of #215)#222
Assar63 merged 1 commit into
masterfrom
feat/terminal-auto-refresh

Conversation

@Assar63

@Assar63 Assar63 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

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):

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 NodeListChanged D-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 dedicated NodeListChanged signal 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

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>
@Assar63 Assar63 merged commit 36fcdc6 into master Jun 18, 2026
3 checks passed
@Assar63 Assar63 deleted the feat/terminal-auto-refresh branch June 18, 2026 04:38
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.

1 participant