Skip to content

Commit

Permalink
Shuffle results panel top-level tabs and update default selection
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Jan 12, 2025
1 parent 5d9ad7e commit 709dcd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/aiidalab_qe/app/result/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def _render(self):

self.panels = {
"Summary": self.summary_panel,
"Results": self.results_panel,
"Status": self.status_panel,
"Results": self.results_panel,
}

self.toggle_controls = ipw.ToggleButtons(
Expand Down Expand Up @@ -118,7 +118,11 @@ def _post_render(self):
self._update_kill_button_layout()
self._update_clean_scratch_button_layout()

self.toggle_controls.value = "Summary"
self.toggle_controls.value = (
"Results"
if (process := self._model.fetch_process_node()) and process.is_finished_ok
else "Status"
)

self.process_monitor = ProcessMonitor(
timeout=0.5,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def test_result_step(app_to_submit, generate_qeapp_workchain):
step = app.results_step
app.results_model.process_uuid = generate_qeapp_workchain().node.uuid
assert step.state == step.State.ACTIVE
step.render()
assert step.toggle_controls.value == "Status"


def test_kill_and_clean_buttons(app_to_submit, generate_qeapp_workchain):
Expand Down

0 comments on commit 709dcd0

Please sign in to comment.