Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shuffle results panel top-level tabs and update default selection #1076

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a process has multiple properties and one fails, would this prevent the visualization of the results for the properties that completed successfully?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why it would. This is just defining the default selected tab. All three tabs are still there.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because if one fail, process.is_finished_ok will be false , right ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default in this case is Status and the app will direct the user there. But the other panels are still accessible.

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
Loading