UI.9: share docking transactions and preserve viewer lifecycle
Preserve legacy selection repair, modifier routing, viewer lifecycle and workspace persistence through the shared docking integration. Qualify the complete workspace gate by refreshing the 18 stale Audio Spectrum hashes for the existing linear renderer, with an independent synthetic-tone regression.
This commit is contained in:
@@ -507,6 +507,21 @@ pub fn base64(data: &[u8]) -> String {
|
||||
|
||||
pub fn inspect(app: &EffectcraftApp, ctx: &egui::Context) -> Value {
|
||||
let size = ctx.content_rect().size();
|
||||
let keyboard_focus = ctx.memory(|m| m.focused()).map(|id| {
|
||||
let response = ctx.read_response(id);
|
||||
let rect = response.as_ref().map(|r| [r.rect.min.x, r.rect.min.y, r.rect.width(), r.rect.height()]);
|
||||
// The registry names screen elements independently of egui's internal ids. Report
|
||||
// exact rectangle matches rather than guessing which enclosing panel owns focus.
|
||||
let candidates: Vec<&str> = app
|
||||
.auto
|
||||
.previous
|
||||
.iter()
|
||||
.filter(|e| rect.is_some_and(|r| e.rect.iter().zip(r).all(|(a, b)| (*a - b).abs() < 0.01)))
|
||||
.map(|e| e.id.as_str())
|
||||
.collect();
|
||||
let automation_id = app.auto.elements.iter().chain(app.auto.previous.iter()).find(|e| e.response_id == Some(id)).map(|e| e.id.as_str());
|
||||
json!({"id": format!("{:016x}", id.value()), "rect": rect, "automationId": automation_id, "registryCandidates": candidates})
|
||||
});
|
||||
json!({
|
||||
"window": [size.x, size.y],
|
||||
"pixelsPerPoint": ctx.pixels_per_point(),
|
||||
@@ -518,6 +533,9 @@ pub fn inspect(app: &EffectcraftApp, ctx: &egui::Context) -> Value {
|
||||
"selectedLayers": app.session.state.selected_layers.iter().map(|c| c.0).collect::<Vec<_>>(),
|
||||
"selectedKeys": app.session.state.selected_keys.len(),
|
||||
"elements": app.auto.previous.len(),
|
||||
"keyboardFocus": keyboard_focus,
|
||||
"windowFocused": ctx.input(|i| i.focused),
|
||||
"workspaceStorageError": app.workspace_store.error,
|
||||
"dialog": app.dialog.map(|d| format!("{d:?}")),
|
||||
"renderMs": app.frames.last_ms.lock().map(|v| *v).unwrap_or(0.0),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user