diff --git a/quantui/app_builders.py b/quantui/app_builders.py index 6f436b2d..0b8dd639 100644 --- a/quantui/app_builders.py +++ b/quantui/app_builders.py @@ -3196,8 +3196,11 @@ def _plot_export_row(prefix: str) -> widgets.HBox: # a result can be drawn (VW.7); density, spin, ESP and the gallery # could only fail, so they are removed and the panel says so (viewer # audit VA.2). The orbital controls stay: show_orbital_diagram only - # reveals them when the result has saved cubes. - app._iso_surface_dd.options = [("Molecular orbital", "orbital")] + # reveals them when the result has saved cubes. The surface kind is + # pinned by hiding its dropdown (value stays "orbital"); its options + # are left intact so the dispatch code and its tests see one widget + # shape with or without PySCF. + app._iso_surface_dd.value = "orbital" app._iso_surface_dd.layout.display = "none" iso_body.children = ( widgets.HTML( diff --git a/tests/test_viewer_audit.py b/tests/test_viewer_audit.py index d588d630..a2a3166b 100644 --- a/tests/test_viewer_audit.py +++ b/tests/test_viewer_audit.py @@ -198,7 +198,9 @@ def _walk(w): assert any("no PySCF" in str(getattr(w, "value", "")) for w in widgets) assert app._iso_generate_btn in widgets # VW.7 path stays reachable assert app._orb_gallery_btn not in widgets - assert [v for _, v in app._iso_surface_dd.options] == ["orbital"] + # Only orbitals can be drawn: the surface-kind dropdown is hidden at "orbital". + assert app._iso_surface_dd.layout.display == "none" + assert app._iso_surface_dd.value == "orbital" def test_orbital_controls_shown_without_pyscf_only_with_saved_cubes(