Command ids are SolveCraft's own: 173 ids that were another product's internal command ids become dotted, lower-case ids (<area>.<thing>[.<variant>]: solid.extrude, sketch.rectangle.two_point, sheet.flange, joint.drive, ...), in the registry, toolbar, dialogs, shortcuts, palette, control channel, MCP, examples, scenarios and docs
The old ids live only in crates/engine/src/legacy_ids.rs (the legacy migration table): find_command maps them, so old scripts, recipes and control calls keep working, and saved shortcuts, recent and pinned commands are migrated on load (designs store no command ids). Parity maps the observed catalog ids to ours through xtask/data/fusion-ids.tsv. The agent rule now reads: our own dotted id, never another product's. Cargo.toml's repository points at github.com/bherbruck/solvecraft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
740360d7c3
commit
d10312b7fd
158 files changed
+3611
-3205
No files matched your search
@@ -8,9 +8,9 @@ use crate::dialogs::{apply_commands, for_feature as edit_dialog};
|
||||
/// A 100 x 60 base flange on XY (2.5 mm steel).
|
||||
fn plate() -> SolveApp {
|
||||
let mut s = Session::default();
|
||||
s.execute("SketchCreate", &json!({"plane": "XY", "name": "Base"})).unwrap();
|
||||
s.execute("ShapeRectangleTwoPoint", &json!({"p0": [0, 0], "p1": [100, 60]})).unwrap();
|
||||
s.execute("SketchStop", &json!({})).unwrap();
|
||||
s.execute("sketch.create", &json!({"plane": "XY", "name": "Base"})).unwrap();
|
||||
s.execute("sketch.rectangle.two_point", &json!({"p0": [0, 0], "p1": [100, 60]})).unwrap();
|
||||
s.execute("sketch.finish", &json!({})).unwrap();
|
||||
SolveApp::new(s, Services::default())
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ fn flange_follows_the_picks() {
|
||||
let mut app = plate();
|
||||
let sk = app.session.doc.features[0].id;
|
||||
app.session.selection = vec![Sel::Profile { sketch: sk, index: 0 }];
|
||||
app.start("FusionSheetMetalFlangeCommand");
|
||||
app.start("sheet.flange");
|
||||
let d = app.dialog.clone().unwrap();
|
||||
let c = apply_commands(&app, &d).unwrap();
|
||||
assert_eq!(c[0].1["type"], "base");
|
||||
@@ -41,7 +41,7 @@ fn flange_follows_the_picks() {
|
||||
.collect();
|
||||
assert_eq!(edges.len(), 4);
|
||||
app.session.selection = edges;
|
||||
app.start("FusionSheetMetalFlangeCommand");
|
||||
app.start("sheet.flange");
|
||||
let mut d = app.dialog.clone().unwrap();
|
||||
if let Kind::Sheet(Sm::Flange { height, position, .. }) = &mut d.kind {
|
||||
*height = "20 mm".into();
|
||||
@@ -63,27 +63,27 @@ fn flange_follows_the_picks() {
|
||||
assert_eq!(c[0].0, "timeline.redefine");
|
||||
assert_eq!(c[0].1["params"]["height"], "20 mm");
|
||||
// Flat pattern: four bends; Unfold previews.
|
||||
let flat = app.session.execute("FusionSheetMetalFlatPatternCmd", &json!({})).unwrap();
|
||||
let flat = app.session.execute("sheet.flat_pattern", &json!({})).unwrap();
|
||||
assert_eq!(flat["bends"].as_array().map(Vec::len), Some(4), "{flat}");
|
||||
app.dialog = None;
|
||||
app.start("FusionSheetmetalUnfoldCommand");
|
||||
assert_eq!(apply_commands(&app, app.dialog.as_ref().unwrap()).unwrap()[0].0, "FusionSheetmetalUnfoldCommand");
|
||||
app.start("sheet.unfold");
|
||||
assert_eq!(apply_commands(&app, app.dialog.as_ref().unwrap()).unwrap()[0].0, "sheet.unfold");
|
||||
}
|
||||
|
||||
/// Hem takes edges and an optional gap; rules make and pick a rule with its expressions.
|
||||
#[test]
|
||||
fn hem_and_rules() {
|
||||
let mut app = plate();
|
||||
app.run("FusionSheetMetalFlangeCommand", json!({"sketch": "Base"})).unwrap();
|
||||
app.run("sheet.flange", json!({"sketch": "Base"})).unwrap();
|
||||
app.session.selection = edge_sel(&app.session, Vec3::new(50.0, 0.0, 2.5)).into_iter().collect();
|
||||
app.start("FusionSheetMetalHemFlangeCommand");
|
||||
app.start("sheet.hem");
|
||||
let d = app.dialog.clone().unwrap();
|
||||
let c = apply_commands(&app, &d).unwrap();
|
||||
assert_eq!(c[0].1["length"], "5 mm");
|
||||
assert!(c[0].1.get("gap").is_none(), "the rule's gap");
|
||||
run_all(&mut app, c);
|
||||
app.dialog = None;
|
||||
app.start("FusionSheetMetalRulesCommand");
|
||||
app.start("sheet.manage_rules");
|
||||
let mut d = app.dialog.clone().unwrap();
|
||||
if let Kind::Sheet(Sm::Rules { pick, name, values, loaded, .. }) = &mut d.kind {
|
||||
*pick = 1;
|
||||
|
||||
Reference in new issue
Block a user