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

Visual tweaks for run panel #197

Merged
merged 1 commit into from
Aug 5, 2024
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
17 changes: 14 additions & 3 deletions gui/src/app/RunPanel/CompiledRunPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,18 @@ type CompiledRunPanelProps = {
errorMessage: string;
};

const loadingDiv = <div>Loading compiled Stan model...</div>;
const completedDiv = <div>done sampling</div>;
const loadingDiv = (
<div>
<hr />
Loading compiled Stan model...
</div>
);
const completedDiv = (
<div>
<hr />
done sampling
</div>
);

const CompiledRunPanel: FunctionComponent<CompiledRunPanelProps> = ({
handleRun,
Expand All @@ -40,6 +50,7 @@ const CompiledRunPanel: FunctionComponent<CompiledRunPanelProps> = ({
>
cancel
</Button>
<hr />
<div>
Sampling
<SamplingProgressComponent
Expand All @@ -52,6 +63,7 @@ const CompiledRunPanel: FunctionComponent<CompiledRunPanelProps> = ({

const failedDiv = (
<div>
<hr />
Sampling failed!
<pre className="SamplerError">{errorMessage}</pre>
<span className="details">(see browser console for more details)</span>
Expand All @@ -69,7 +81,6 @@ const CompiledRunPanel: FunctionComponent<CompiledRunPanelProps> = ({
run sampling
</Button>
&nbsp;
<hr />
{runStatus === "loading" ? (
loadingDiv
) : runStatus === "completed" ? (
Expand Down
10 changes: 7 additions & 3 deletions gui/src/app/RunPanel/RunPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import StanSampler from "@SpStanSampler/StanSampler";
import { StanRun } from "@SpStanSampler/useStanSampler";
import CompiledRunPanel from "./CompiledRunPanel";
import CircularProgress from "@mui/material/CircularProgress";

type RunPanelProps = {
sampler?: StanSampler;
Expand Down Expand Up @@ -40,8 +41,7 @@ const RunPanel: FunctionComponent<RunPanelProps> = ({
sampler.cancel();
}, [sampler]);

const { compile, compileMessage, compileStatus, validSyntax } =
useContext(CompileContext);
const { compile, compileStatus, validSyntax } = useContext(CompileContext);

const { data: projectData } = useContext(ProjectContext);

Expand All @@ -61,7 +61,11 @@ const RunPanel: FunctionComponent<RunPanelProps> = ({
</div>
);

const compilingDiv = <div>{compileMessage}</div>;
const compilingDiv = (
<div>
<CircularProgress />
</div>
);

return (
<div className="RunPanel">
Expand Down