forked from 1b-agent/opencadstudio-upstream
refactor(ribbon): single dock predicate, drop dead layer_names mirror
The edge-stack closure duplicated dock_panel_visible arm-for-arm; it now delegates (tab is provably the active tab at that site). Ribbon.layer_names was written but never read outside one test; deleted, test reads via layer_infos. Faces and combo-refresh sub-items investigated and dropped (already unified upstream; no live stale path). Tests: dock visibility parity pins incl. Start-tab. Full suite: 2046 passed / 0 failed / 25 ignored, zero warnings.
This commit is contained in:
1 parent
6fa11887c7
commit
8dca7fbaed
4 files changed
+57
-19
No files matched your search
@@ -11233,6 +11233,57 @@ mod anno_scale_toggle_tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod dock_visibility_tests {
|
||||
// #57: one visibility predicate for edge rendering and drag math. Pins
|
||||
// the full 8-panel table so a newly added panel cannot silently diverge
|
||||
// (behavior-preserving dedup: passes before and after by construction).
|
||||
use crate::app::OpenCADStudio;
|
||||
use crate::ui::dock::PanelId;
|
||||
|
||||
const ALL: [PanelId; 8] = [
|
||||
PanelId::Properties,
|
||||
PanelId::BlockPalette,
|
||||
PanelId::ExternalReferences,
|
||||
PanelId::Browser,
|
||||
PanelId::NodeGraph,
|
||||
PanelId::PointCloudManager,
|
||||
PanelId::Count,
|
||||
PanelId::SheetSetManager,
|
||||
];
|
||||
|
||||
#[test]
|
||||
fn dock_panel_visible_covers_every_panel() {
|
||||
let mut app = OpenCADStudio::new_for_test();
|
||||
app.automation_op(r#"{"op":"new"}"#);
|
||||
app.show_properties = true;
|
||||
app.show_block_palette = true;
|
||||
app.show_external_references = true;
|
||||
app.show_browser = true;
|
||||
app.show_node_graph = true;
|
||||
app.pc_manager.show = true;
|
||||
app.count_palette.show = true;
|
||||
app.sheet_set.show = true;
|
||||
for id in ALL {
|
||||
assert!(app.dock_panel_visible(id), "{id:?} must be visible");
|
||||
}
|
||||
app.clean_screen = true;
|
||||
for id in ALL {
|
||||
assert!(!app.dock_panel_visible(id), "{id:?} must hide on clean screen");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dock_panel_hidden_on_start_tab() {
|
||||
// Fresh app, no drawing opened: the welcome tab shows no panels.
|
||||
let app = OpenCADStudio::new_for_test();
|
||||
assert!(app.tabs[app.active_tab].is_start);
|
||||
for id in ALL {
|
||||
assert!(!app.dock_panel_visible(id), "{id:?} must hide on Start");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod free_text_entry_tests {
|
||||
//! The free-form text prompts (table cell content, TEXT / MTEXT bodies)
|
||||
|
||||
Reference in new issue
Block a user