feat(block-editor): add authoring palette UI

Add a dockable Block Editor palette with selectable Parameters, Actions,
Parameter Sets and Constraints pages, reusing shared dock controls, icons
and ribbon-style hover bubbles.

Parameters, Actions, Parameter Sets and Block Properties Table are UI
catalogs only. Their entries remain disabled; this commit does not add
parameter placement, dynamic action behavior, parameter-set authoring or
block properties table functionality.

The Constraints page connects its geometric and dimensional entries to
existing ribbon commands. It reuses their implementations and adds no new
constraint behavior.

Keep the palette specific to BEDIT and retain its placement and selected
page across closing/reopening and Test Block. Opening, closing, switching
pages and clicking disabled entries preserve the document, undo history
and any running command.

Validation: 7 palette tests, 57 dock checks and 46 ribbon checks passed
(overlapping groups); rendered pages inspected and native debug build passed.
This commit is contained in:
Karim Jerbi committed 2026-10-15 12:45:16 +01:00
1 parent 423b28c6b1
commit 16d3fd80f8
16 files changed
+818 -47

No files matched your search

+10
View File
@@ -82,6 +82,16 @@ impl CadModule for BlockEditorModule {
// Parametric blocks are driven by the same constraints and
// parameters as the Parametric tab.
groups.extend(ParametricModule.ribbon_groups().iter().cloned());
if let Some(manage) = groups.iter_mut().find(|group| group.title == "Manage") {
manage.tools.insert(
0,
command(
"BAUTHORPALETTE",
"Authoring Palettes",
include_bytes!("../../../assets/icons/tool_palettes.svg"),
),
);
}
groups
})
}
+2 -6
View File
@@ -42,7 +42,7 @@ pub use perpendicular_command::{PerpendicularConstraintCommand, PerpendicularPic
pub use point_on_entity::{
center_point_tool, midpoint_tool, point_on_curve_tool, PointOnEntityConstraintCommand,
};
pub use smooth::SmoothConstraintCommand;
pub use smooth::{smooth_tool, SmoothConstraintCommand};
pub use symmetric_command::SymmetricConstraintCommand;
pub use tangent_command::TangentConstraintCommand;
pub use tools::{
@@ -89,11 +89,7 @@ impl CadModule for ParametricModule {
RibbonItem::LargeTool(tangent::tool()),
RibbonItem::LargeTool(colinear::tool()),
RibbonItem::LargeTool(perpendicular::tool()),
RibbonItem::LargeTool(command(
"GCSMOOTH",
"Smooth",
include_bytes!("../../../assets/icons/constrain/smooth.svg"),
)),
RibbonItem::LargeTool(smooth_tool()),
RibbonItem::LargeTool(concentric_tool::tool()),
RibbonItem::LargeTool(horizontal::tool()),
RibbonItem::LargeTool(symmetric::tool()),
+11
View File
@@ -5,6 +5,17 @@ use crate::command::{CadCommand, CmdResult};
use crate::scene::parametric_constraints::{ConstraintKind, ParametricRef};
use crate::t;
pub fn smooth_tool() -> crate::modules::ToolDef {
crate::modules::ToolDef {
id: "GCSMOOTH",
label: "Smooth",
icon: crate::modules::IconKind::Svg(include_bytes!(
"../../../assets/icons/constrain/smooth.svg"
)),
event: crate::modules::ModuleEvent::Command("GCSMOOTH".into()),
}
}
#[derive(Clone, Copy)]
struct SmoothTarget {
endpoint: ParametricRef,