Skip to content

fix(studio): flip per-slot binding presentation on bindings[…] edit acks#113

Merged
Yona-Appletree merged 1 commit into
mainfrom
claude/happy-perlman-a05e52
Jul 16, 2026
Merged

fix(studio): flip per-slot binding presentation on bindings[…] edit acks#113
Yona-Appletree merged 1 commit into
mainfrom
claude/happy-perlman-a05e52

Conversation

@Yona-Appletree

Copy link
Copy Markdown
Member

Summary

  • After authoring a binding via the slot detail popover, the per-slot binding presentation (authored vs default origin, Unbind affordance) lagged the passive project-read cadence — up to tens of seconds stale, worst when binding a slot to the same channel as its declared default (graph unchanged, only the origin flips). The engine/doc were correct immediately; only the Studio presentation lagged.
  • Root cause: binding facts were derived from the synced slot tree only (during apply_tree_entry), while acked bindings[…] edits live in the overlay mirror until the next passive read.
  • Fix: fact derivation now reads through the pending-edit mirror. A new BindingFactOverrides (in slot_binding_fact.rs) folds the overlay mirror's bindings[…] entries — shadowed by the local edit buffer, Failed entries skipped — into the synced authored facts. ProjectController::refresh_binding_presentation re-derives the whole tree's presentation (authored facts + graph-default overlay) after every applied project view and after every acked mutation that touched a bindings[…] path (or cleared the overlay/artifact wholesale, which can drop such entries). Unbind is symmetric: the acked entry removal drops the authored fact and the declared default refills immediately.
  • Known residual (separate seam): rowless binding-derived rows (e.g. fixture.input, no backing slot row) build authored-vs-default from the binding-graph snapshot, which still refreshes passively.

Validation

  • New controller test acked_bind_gesture_reads_authored_before_any_refresh: declared-default wiring on time, popover gesture to the same channel, scripted acks, no refresh → origin flips to authored, Unbind offered.
  • New controller test acked_unbind_restores_default_presentation_before_any_refresh: one acked RemoveValue on the entry → default-origin presentation returns instantly.
  • New end-to-end test bind_and_unbind_gestures_present_authored_state_from_acks_alone: drives the exact popover action sequence through the studio actor against the real in-process LpServer, asserting authored/unbound presentation from the acks alone (no RefreshProject in between).
  • cargo test -p lpa-studio-core (455 passed), cargo test -p lpa-studio-web (117 passed), just check green.

Contribution Terms

By opening this pull request, I confirm that I have the right to submit these
changes and agree to the contribution terms in CONTRIBUTING.md.

🤖 Generated with Claude Code

… acks

After the popover's bind/unbind gesture, the acked edits landed in the
overlay mirror immediately, but per-slot binding presentation (authored
vs default origin, the Unbind affordance) was only derived from the
synced slot tree during apply_tree_entry — so it lagged the passive
project-read cadence by up to tens of seconds. Binding a slot to the
same channel as its declared default was the worst case: the graph
looks unchanged and only the origin flips, so nothing on screen moved.

Fact derivation now reads through the pending-edit mirror: a new
BindingFactOverrides folds the overlay mirror's bindings[...] entries
(shadowed by the local edit buffer; Failed entries skipped) into the
synced authored facts, and ProjectController re-derives the whole
tree's binding presentation after every applied project view and after
every acked mutation that touched a bindings path (or cleared the
overlay/artifact wholesale).

Covered by two controller tests (bind-to-declared-default and unbind,
scripted acks, no refresh in between) and one end-to-end test driving
the exact popover action sequence against the real in-process server.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Yona-Appletree
Yona-Appletree merged commit 0c1432b into main Jul 16, 2026
3 checks passed
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