diff --git a/src/aiidalab_qe/app/result/components/viewer/structure/structure.py b/src/aiidalab_qe/app/result/components/viewer/structure/structure.py index 7ef5bbefd..d25c18cf5 100644 --- a/src/aiidalab_qe/app/result/components/viewer/structure/structure.py +++ b/src/aiidalab_qe/app/result/components/viewer/structure/structure.py @@ -9,5 +9,5 @@ class StructureResults(ResultsPanel[StructureResultsModel]): identifier = "structure" def _render(self): - widget = StructureDataViewer(structure=self._model.outputs.structure) - self.children = [widget] + self.widget = StructureDataViewer(structure=self._model.outputs.structure) + self.children = [self.widget] diff --git a/src/aiidalab_qe/common/panel.py b/src/aiidalab_qe/common/panel.py index c595b5b03..574eaad61 100644 --- a/src/aiidalab_qe/common/panel.py +++ b/src/aiidalab_qe/common/panel.py @@ -650,7 +650,10 @@ def _on_load_results_click(self, _): def _load_results(self): self.children = [self.loading_message] self._render() - self.rendered = True + # HACK if this is the structure results panel, we want to + # always rerender to refresh the NGL viewer, which does not + # handle resize correctly. + self.rendered = self._model.identifier != "structure" self._post_render() self.has_controls = False diff --git a/tests/test_plugins_bands.py b/tests/test_plugins_bands.py index 10d9bf902..a6067bab4 100644 --- a/tests/test_plugins_bands.py +++ b/tests/test_plugins_bands.py @@ -8,7 +8,7 @@ def test_result(generate_qeapp_workchain): model = BandsResultsModel() model.process_uuid = workchain.node.uuid result = BandsResultsPanel(model=model) - result.render() + result._render() widget = result.children[0] model = widget._model diff --git a/tests/test_plugins_pdos.py b/tests/test_plugins_pdos.py index f2e0c79da..8bad6bd03 100644 --- a/tests/test_plugins_pdos.py +++ b/tests/test_plugins_pdos.py @@ -8,7 +8,7 @@ def test_result(generate_qeapp_workchain): model = PdosResultsModel() model.process_uuid = workchain.node.uuid result = PdosResultsPanel(model=model) - result.render() + result._render() widget = result.children[0] model = widget._model