feat(graph): node library as a docked panel; shared dock chrome

The node library leaves the overlay and becomes a dock panel (PanelId::
NodeGraph), docked on the right the first time the graph opens and movable
like any other panel; closing it closes the graph. It follows the block
palette's layout: title bar, then a search box with New / Open / Save
beside it, then the categories, of which only Objects starts open. Entries
are clicked (placed at the canvas top-left) or dragged onto the canvas.

The title bar (title, auto-collapse pin, close, drag to re-dock), the
toolbar icon button and the panel frame were copied across Properties,
Block Palette, External References and Browser; they are now
dock::title_bar, dock::tool_button and dock::frame, used by all of them.
Block Palette's two tool buttons gain tooltips, and External References'
Auto / Close tooltips are now translated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-09-25 10:17:44 +03:00
1 parent 857f2f2e58
commit 3013c1b570
9 files changed
+245 -314

No files matched your search

+16 -1
View File
@@ -170,6 +170,21 @@ impl OpenCADStudio {
GraphMsg::Toggle => {
self.show_node_graph = !self.show_node_graph;
if self.show_node_graph {
// The node library docks on the right on first use; after
// that it stays wherever the user moved it.
let id = crate::ui::dock::PanelId::NodeGraph;
if self.dock.location(id).is_none() {
self.dock
.dock(id, crate::app::config::DockSide::Right, usize::MAX);
}
self.dock_expanded = Some(id);
return self.graph_run(i);
}
}
GraphMsg::PaletteRelease => {
if let Some(Drag::Palette(item)) = self.tabs[i].graph.drag.take() {
let pos = self.tabs[i].graph.drop_position(false);
self.tabs[i].graph.add_node(item, Vec::new(), pos);
return self.graph_run(i);
}
}
@@ -177,7 +192,7 @@ impl OpenCADStudio {
let sections = self.graph_all_sections(i);
match self.tabs[i].graph.drag.take() {
Some(Drag::Palette(item)) => {
let pos = self.tabs[i].graph.drop_position();
let pos = self.tabs[i].graph.drop_position(true);
self.tabs[i].graph.add_node(item, Vec::new(), pos);
return self.graph_run(i);
}