fix(ui): scope spatial tools to scene
This commit is contained in:
@@ -788,3 +788,31 @@ def test_layout_save_is_atomic_and_revision_checked(tmp_path: Path) -> None:
|
||||
)
|
||||
assert second.revision == 2
|
||||
assert store.get_layout("observation.spatial").layout["visible_source_ids"] == []
|
||||
|
||||
|
||||
def test_layout_startup_migration_removes_transient_tool_window_state(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
repository = tmp_path / "repo"
|
||||
data_dir = tmp_path / "data"
|
||||
initial = SessionStore(repository, data_dir=data_dir)
|
||||
initial.save_layout(
|
||||
"observation.spatial",
|
||||
schema_version=1,
|
||||
expected_revision=0,
|
||||
name="Пространственная сцена",
|
||||
layout={
|
||||
"tool_windows": {
|
||||
"sources_open": True,
|
||||
"display_open": True,
|
||||
"layers_open": True,
|
||||
"order": ["sources", "display", "layers"],
|
||||
},
|
||||
"visible_source_ids": [],
|
||||
},
|
||||
)
|
||||
|
||||
migrated = SessionStore(repository, data_dir=data_dir).get_layout("observation.spatial")
|
||||
|
||||
assert migrated.schema_version == 2
|
||||
assert "tool_windows" not in migrated.layout
|
||||
|
||||
Reference in New Issue
Block a user