feat(render): incidental-DDL confirmations show structure only, no relationships (#28)
Per ADR-0050 (closing issue #28): the confirmation echo after an incidental structural edit — create table, add/drop/rename/change column, add/drop index — now renders the structure only (header + column box + indexes + constraints) and no longer appends the References:/Referenced by: relationship block. Rationale: a confirmation reports the change just made, not the table's relationships, which the user didn't touch. Relationship info is still one `show table <T>` away, and the relationship-subject surfaces (show table, add/drop relationship) keep their ADR-0044 diagrams unchanged. Scope is all incidental DDL (user-confirmed). Mechanism: drop the relationship-block call from render_structure (all its callers are incidental DDL); the handle_dsl_success diagram-vs-structure routing is unchanged. The orphaned relationship_prose_lines + cols_disp helpers are deleted (the prose format survives in ADR-0016 §5 + git history for a future OOS-7 always-prose setting). ADR-0050 supersedes ADR-0044 §1's incidental-DDL prose clause and the relationship-block half of ADR-0016 §5 (both annotated). Tests: prose- presence unit test + snapshot removed; new unit test locks structure- only with inbound+outbound relationships present; the misnamed add- column integration test inverted + renamed. 2458 pass / 0 fail / 0 skip, clippy clean.
This commit is contained in:
@@ -494,7 +494,12 @@ fn add_relationship_flow_shows_parent_side_with_inbound_section() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn add_relationship_flow_shows_inbound_section_on_parent() {
|
||||
fn add_column_confirmation_omits_relationship_prose() {
|
||||
// ADR-0050 (issue #28): an incidental-DDL confirmation echo (here
|
||||
// `add column`) renders the structure only — never the
|
||||
// `References:` / `Referenced by:` relationship block — even when
|
||||
// the table carries relationships the user did not touch. The
|
||||
// relationships remain one `show table` away.
|
||||
let mut app = App::new();
|
||||
let customers = TableDescription {
|
||||
name: "Customers".to_string(),
|
||||
@@ -535,8 +540,17 @@ fn add_relationship_flow_shows_inbound_section_on_parent() {
|
||||
echo: None,
|
||||
});
|
||||
let rendered = rendered_text(&mut app, &Theme::dark(), 80, 24);
|
||||
assert!(rendered.contains("Referenced by:"), "{rendered}");
|
||||
assert!(rendered.contains("Orders.CustId → Id"), "{rendered}");
|
||||
// The structure box still renders (table name + the column box from
|
||||
// the returned description).
|
||||
assert!(rendered.contains("Customers"), "structure header:\n{rendered}");
|
||||
assert!(rendered.contains("Constraints"), "structure box:\n{rendered}");
|
||||
// The relationship block is gone — neither prose heading nor line.
|
||||
assert!(!rendered.contains("Referenced by:"), "no prose heading:\n{rendered}");
|
||||
assert!(!rendered.contains("References:"), "no prose heading:\n{rendered}");
|
||||
assert!(
|
||||
!rendered.contains("Orders.CustId → Id"),
|
||||
"no prose line:\n{rendered}",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user