Skip to content

fix: apply live data bindings in nemo screenshot (#82) - #86

Merged
geoffjay merged 2 commits into
mainfrom
screenshot-fix-and-plugin-plan
Aug 1, 2026
Merged

fix: apply live data bindings in nemo screenshot (#82)#86
geoffjay merged 2 commits into
mainfrom
screenshot-fix-and-plugin-plan

Conversation

@geoffjay

@geoffjay geoffjay commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #82nemo screenshot rendered the initial layout but bound values (<binding>/bind-*) stayed at their placeholders in the captured PNG, even though they populate correctly in the running app.

Root cause is startup ordering, not a screenshot-specific rendering bug:

  • A data source's start() broadcasts its initial full value immediately.
  • A tokio broadcast channel drops messages sent while no receiver is attached.
  • The runtime subscribed its update loops after data_engine.start_all(), so each source's first value was lost and the repository was never seeded.
  • Interactive runs recover via a later event (e.g. a file-watcher change); a one-shot capture never does.

Changes

  • runtime.rs (root-cause fix): subscribe the update loops (start_data_update_loop) before data_engine.start_all(), so receivers are attached before sources broadcast. Benefits every one-shot / early-read path, not just screenshots.
  • commands/screenshot.rs (capture fix): pump the data→binding loop across the --settle-ms window in 50ms slices, then do a final refresh + one executor-yield before render_to_image() (which reads the last-drawn frame; refresh() only marks the window dirty).
  • KB: added a "Startup ordering is load-bearing" note to concepts/data-flow.md and a log.md entry.

This branch also carries an earlier doc-only commit adding the screenshot-as-a-plugin KB plan.

Verification

  • examples/data-binding screenshot now shows live timer/HTTP values instead of placeholders.
  • 233 nemo + 18 macro tests pass; no regressions from the runtime reorder.
  • cargo build -p nemo --features screenshot clean; pre-commit clippy/fmt hooks green.

🤖 Generated with Claude Code

geoffjay and others added 2 commits July 31, 2026 21:51
`nemo screenshot` rendered the initial layout but bound values
(`<binding>`/`bind-*`) stayed at their placeholders in the captured PNG,
even though they populate correctly in the running app.

Root cause is startup ordering. A data source's `start()` broadcasts its
initial `full` value immediately, and a tokio `broadcast` channel drops
messages sent while no receiver is attached. The runtime subscribed its
update loops *after* `data_engine.start_all()`, so each source's first
value was lost and the repository was never seeded. Interactive runs
recover via a later event (e.g. a file-watcher change); a one-shot
capture never does.

Fix (two parts):
- runtime.rs: subscribe the update loops (`start_data_update_loop`)
  before `data_engine.start_all()`, so receivers are attached before
  sources broadcast. This is the root-cause fix and benefits every
  one-shot / early-read path, not just screenshots.
- commands/screenshot.rs: pump the data->binding loop across the
  `--settle-ms` window in 50ms slices, then do a final refresh + one
  executor-yield before `render_to_image()` (which reads the last-drawn
  frame; `refresh()` only marks the window dirty).

Verified: examples/data-binding screenshot now shows live timer/HTTP
values; 233 nemo + 18 macro tests pass; --features screenshot builds
clean. Updated the data-flow KB doc and log.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.59%. Comparing base (d906c33) to head (f8d4a58).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #86   +/-   ##
=======================================
  Coverage   56.59%   56.59%           
=======================================
  Files          78       78           
  Lines        6866     6866           
=======================================
  Hits         3886     3886           
  Misses       2980     2980           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@geoffjay
geoffjay merged commit 82b766c into main Aug 1, 2026
7 checks passed
@geoffjay
geoffjay deleted the screenshot-fix-and-plugin-plan branch August 1, 2026 05:22
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.

nemo screenshot does not apply live data-source bindings (bound values render as placeholders)

1 participant