Skip to content

Commit

Permalink
Improve run dialog message
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmundGoodman committed Mar 11, 2024
1 parent 3bbff96 commit b94a093
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/hpc_multibench/tui/interactive_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def compose(self) -> ComposeResult:
yield Label(
(
"[bold]Waiting for queued jobs to complete.[/bold]\n\n"
"You can continue, but may need to reload the test plan "
"You can continue, but will need to reload the test plan "
"once they are complete to see any new results."
),
id="run-dialog-message",
Expand All @@ -116,6 +116,7 @@ def on_mount(self) -> None:

def make_progress(self) -> None:
"""Automatically advance the progress bar."""
progress_bar = self.query_one("#run-dialog-progress", ProgressBar)
if not self.jobs_spawned:
self.jobs_spawned = True
# Wait till everything is rendered to kick off blocking calls...
Expand All @@ -129,7 +130,7 @@ def make_progress(self) -> None:
if bench.bench_model.enabled
]
)
self.query_one(ProgressBar).update(total=total_jobs)
progress_bar.update(total=total_jobs)

# Update the progress based on jobs completed
queued_jobs = set(get_queued_job_ids())
Expand All @@ -140,7 +141,15 @@ def make_progress(self) -> None:
if bench.bench_model.enabled
]
)
self.query_one(ProgressBar).progress = completed_jobs
progress_bar.progress = completed_jobs

# Reload the test plan when all the jobs are completed
if progress_bar.progress == progress_bar.total:
self.query_one("#run-dialog-message", Label).update(
"[bold]All queued jobs have completed!\n\n[/bold]"
"Press 'Continue' to dismiss this dialog, then 'R' on the "
"keyboard to reload the test plan and view the new results."
)

def on_button_pressed(self, event: Button.Pressed) -> None:
"""Dismiss the modal dialog when the continue button is pressed."""
Expand Down

0 comments on commit b94a093

Please sign in to comment.