UI-1: drag-to-dock with drop zones, floating panels, maximize, workspaces save floating

- dock::drop_zone / zone_rect (AE-style center/left/right/top/bottom zones with highlight),
  DockNode::dock_panel (tab next to / split off an anchor), Layout {root, floating} with
  float / unfloat / dock; serde (old workspaces still load).
- Tab drag re-docks; Cmd/Ctrl-release or a drop outside every group floats it; floating
  groups are movable, resizable in-window windows that take tabs; panel menu Undock /
  Maximize (toggle, ` maximizes the panel under the pointer) / Close; window.dockPanel /
  floatPanel / maximizePanel / closePanel for agents; Save Workspace stores floating panels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-02 11:03:06 -04:00
co-authored by Claude Opus 5.5
parent 84f517e6c1
commit 53ce3cc23c
6 changed files with 640 additions and 71 deletions
+9 -3
View File
@@ -98,11 +98,17 @@ pub fn panel_menu_popup(app: &mut EffectcraftApp, ui: &mut egui::Ui) {
egui::Frame::popup(ui.style()).show(ui, |ui| {
ui.set_min_width(200.0);
if ui.button("Close Panel").clicked() {
app.ui.dock.close(panel);
app.close_panel(panel);
close = true;
}
if ui.button("Maximize Panel").clicked() {
app.ui.dock = crate::dock::DockNode::Tabs { panels: vec![panel], active: 0 };
let floating = app.ui.floating.iter().any(|f| f.panels.contains(&panel));
if !floating && ui.button("Undock Panel").clicked() {
let r = crate::dock_ui::default_float_rect(ui.ctx().content_rect());
app.edit_layout(|l| l.float(panel, r));
close = true;
}
if !floating && ui.button(if app.ui.maximized == Some(panel) { "Restore Panel Size" } else { "Maximize Panel" }).clicked() {
app.toggle_maximize(panel);
close = true;
}
ui.separator();