Correct excluded-projection fixture and separate routing guide steps
This commit is contained in:
@@ -977,30 +977,55 @@ fn layout_batch_uses_staged_visibility_and_one_final_validation_history_boundary
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn layout_outside_projection_routes_keep_overrides_and_normal_translation() {
|
||||
fn layout_outside_projection_routes_keep_overrides_and_inactive_owner_positions() {
|
||||
let mut f = fixture();
|
||||
f.project.diagrams.get_mut(&f.diagram).unwrap().projection = ProjectionKind::Decomposition;
|
||||
// Decomposition admits ordinary relations, including FunctionalExchange.
|
||||
// Capabilities explicitly excludes those edges and their Function owners;
|
||||
// retain their authored placements while arranging a real visible node.
|
||||
let capability = f
|
||||
.project
|
||||
.add_element(
|
||||
Kind::SystemCapability,
|
||||
Layer::Sa,
|
||||
"Visible capability",
|
||||
None,
|
||||
)
|
||||
.unwrap();
|
||||
let capability_node = f
|
||||
.project
|
||||
.place(f.diagram, capability, Position { x: 100., y: 100. });
|
||||
f.project.diagrams.get_mut(&f.diagram).unwrap().projection = ProjectionKind::Capabilities;
|
||||
let base = execute_batch(&f.project, &[Command::Layout(f.diagram)]).unwrap();
|
||||
f.project = base.clone();
|
||||
shift_all(&mut f.project, f.diagram, 40., 60.);
|
||||
f.project.diagrams.get_mut(&f.diagram).unwrap().routes = vec![route(f.edge), route(f.external)];
|
||||
validate_candidate(&f.project).unwrap();
|
||||
let projected = projection::project_view(&f.project, f.diagram);
|
||||
assert_eq!(projected.nodes.len(), 1);
|
||||
assert_eq!(projected.nodes[0].id, capability_node);
|
||||
assert!(
|
||||
projection::project_view(&f.project, f.diagram)
|
||||
projected
|
||||
.edges
|
||||
.iter()
|
||||
.all(|edge| edge.id != f.edge && edge.id != f.external)
|
||||
);
|
||||
let mut expected = f.project.clone();
|
||||
expected.diagrams.get_mut(&f.diagram).unwrap().nodes.insert(
|
||||
capability_node,
|
||||
base.diagrams[&f.diagram].nodes[&capability_node].clone(),
|
||||
);
|
||||
let after = execute_batch(&f.project, &[Command::Layout(f.diagram)]).unwrap();
|
||||
assert_eq!(
|
||||
after.diagrams[&f.diagram].nodes,
|
||||
base.diagrams[&f.diagram].nodes
|
||||
assert_ne!(
|
||||
after.diagrams[&f.diagram].nodes[&capability_node].position,
|
||||
f.project.diagrams[&f.diagram].nodes[&capability_node].position
|
||||
);
|
||||
assert_eq!(
|
||||
after.diagrams[&f.diagram].routes,
|
||||
vec![
|
||||
translated_expected(route(f.edge), -40., -60.),
|
||||
translated_expected(route(f.external), -40., -60.)
|
||||
]
|
||||
vec![route(f.edge), route(f.external)]
|
||||
);
|
||||
assert_eq!(
|
||||
after, expected,
|
||||
"Owners excluded by the projection receive no Layout delta; their pins stay fixed"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ fn article(topic: Topic) -> Article {
|
||||
"Use the diagram selector or + View to work with a focused diagram. View properties edits its name, perspective, projection and Saved view visibility. Apply changes commits the view settings.",
|
||||
"Choose Containment for semantic children, Architecture · allocated work for responsibilities, Functional dataflow for work and exchanges, or Missions & capabilities for outcomes. All relationships explores one layer; OA ↔ SA traceability can show placed elements from both layers and their correspondence lines alongside ordinary relationships.",
|
||||
"Select an element and edit Semantic parent to change ownership. Use the Allocation palette tool to connect a performer to existing unallocated leaf work in Containment. The relationship can appear as a line there; Architecture · allocated work shows responsibility through nesting instead. Saved visibility filters can hide a line without removing the relationship.",
|
||||
"Scroll to zoom and use Fit to frame the current view. In allocated-work views, dragging work changes its assignment and placement together. Choose Arrange next drag or press Alt+A to move work without changing responsibility for that one drag; Escape cancels the armed action. Auto-layout (Arrange elements) arranges the whole view and replaces saved bends and label positions on visible connections whose endpoints are not promoted by folding. Attachment preferences and port anchors stay saved. Undo restores the previous arrangement. Export SVG produces a shareable view.",
|
||||
"Scroll to zoom and use Fit to frame the current view. In allocated-work views, dragging work changes its assignment and placement together. Choose Arrange next drag or press Alt+A to move work without changing responsibility for that one drag; Escape cancels the armed action. Auto-layout arranges the view; see Route connections around the model for its bend and label reset rules. Export SVG produces a shareable view.",
|
||||
"Select a diagram node to access Placement, Fold / unfold and Hide. With the canvas focused, Delete hides its placement; Shift+Delete asks to remove the model element. Other views retain a hidden element. Undo restores either change.",
|
||||
],
|
||||
),
|
||||
@@ -357,7 +357,9 @@ fn article(topic: Topic) -> Article {
|
||||
&[
|
||||
"Select an architecture connection and drag a segment to add a bend. Right-click a line for Add bend here; right-click a circle for Remove bend. With the canvas focused, Insert adds a bend and Delete removes the selected bend. Drag the label independently. Escape cancels a gesture; Undo reverses one completed drag. Shift+F10 opens the selected diagram item's context menu; use arrow keys and Enter to choose an action.",
|
||||
"Automatic orthogonal routing avoids cards and container headers where space permits. Amber connections need attention: move an obstructing element or a bend. In Select / move, drag a port to any border of its owner. Manual positions are per diagram; right-click Reset automatic position restores connection-aware placement. Ports remain attached to their actual owners. Manual routes are saved separately for each diagram and appear in source, API and SVG export.",
|
||||
"Select a connection and drag a square endpoint handle along its element boundary to move its attachment in this view without changing what it connects. If handles overlap, right-click the selected connection or use its Actions menu and choose Move source attachment or Move target attachment, then drag the handle. Connections to semantic ports retain their port attachment; move the port instead. Reset source attachment or Reset target attachment restores that end's automatic placement while preserving the other end, pins and label. Reset routing clears all these route overrides, including both attachments, in this view. Auto-layout replaces saved bends and label positions on visible connections with their actual endpoints shown; it retains attachment preferences and port anchors. Hidden or folded routes keep their overrides, though saved pins can move with their endpoint owners during arrangement. Undo restores the prior arrangement. During ordinary movement, moving one endpoint keeps pins fixed; moving a container carrying both endpoints translates their pins. When folding promotes an endpoint, expand it again to resume and edit its saved route.",
|
||||
"Select a connection and drag a square endpoint handle along its element boundary to move its attachment in this view without changing what it connects. If handles overlap, right-click the selected connection or use its Actions menu and choose Move source attachment or Move target attachment, then drag the handle. Connections to semantic ports retain their port attachment; move the port instead. Reset source attachment or Reset target attachment restores that end's automatic placement while preserving the other end, pins and label. Reset routing clears all these route overrides, including both attachments, in this view.",
|
||||
"Auto-layout (Arrange elements) replaces saved bends and label positions on visible connections with their actual endpoints shown; attachment preferences and port anchors stay saved. Hidden or folded routes keep their overrides, though pins can move with their endpoint owners during arrangement. Undo restores the prior arrangement.",
|
||||
"During ordinary movement, moving one endpoint keeps pins fixed; moving a container carrying both endpoints translates their pins. When folding promotes an endpoint, expand it again to resume and edit its saved route.",
|
||||
],
|
||||
),
|
||||
explain(
|
||||
|
||||
Reference in New Issue
Block a user