fix(ui): preserve Studio layer controls across scene updates - #282
Merged
Conversation
Keep effect widgets mounted while authoritative scene values refresh so edits retain scroll position and focus. Reconcile snapshots beneath pending writes, restore rejected values, and cache schemas across layer replacements without retaining retired mutation targets. Coalesce scene invalidations and avoid unrelated face and primary-effect reloads. Cover control edits, remote updates, replacement revisions, failed writes, and advanced-panel scrolling with browser regressions. Co-Authored-By: Nova (Codex) <noreply@openai.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThe PR adds generation-aware scene refresh tracking, optimistic control reconciliation, and reactive layer-panel rendering. It preserves layer controls across value updates, refreshes effect metadata when sources change, and adds unit and Playwright coverage for control-edit behavior. ChangesStudio control consistency
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant LayerPanel
participant LayerRow
participant ControlPatchSession
participant SceneAPI
participant WebSocket
LayerPanel->>LayerRow: provide reactive layer and revision
LayerRow->>ControlPatchSession: submit control mutation
ControlPatchSession->>SceneAPI: patch layer controls
SceneAPI->>WebSocket: emit scene control events
WebSocket->>LayerPanel: update scene values and generations
LayerPanel->>LayerRow: reconcile values without remounting
✨ Finishing Touches📝 Generate docstrings
Comment |
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.
What this changes
Studio keeps effect controls mounted when their values change, preserving scroll position and keyboard focus. Layer replacements reuse cached effect schemas and retain the expanded Transform & Color section, so opacity and advanced settings no longer collapse the inspector while loading.
Why
A single control edit refreshed unrelated face and primary-effect data, then rebuilt the layer controls. In the live Neon Clock inspector, changing Glow moved the scroll position from 650px to 424px and triggered eight requests. The corrected control path keeps the same focused input at 650px and sends two requests: the patch and one authoritative scene read.
Rows follow stable layer/source identity and read current values and revisions reactively. Pending and in-flight edits take precedence over server snapshots; failed writes explicitly restore canonical values. Event epochs preserve invalidations across batched notifications while avoiding duplicate refreshes. Replacements still retire the old write authority.
Verification
just verifypasses locally, including allocation contracts.just deny: not applicable; dependencies and licenses unchanged.just ui-buildpass.Also passed: workspace type-check, strict UI library Clippy, and independent adversarial review. The extra all-target UI Clippy check hits an existing Tauri test-module ordering warning, reproduced on untouched main and tracked separately.
Notes for reviewers
Preview frame rates and debounce intervals are unchanged. The measured improvement is fewer requests and preserved editor state; this PR does not claim to resolve the browser's overall CPU usage. A separate disclosure-preference edge after reordering is tracked for follow-up.
Summary by CodeRabbit
New Features
Bug Fixes