LAMPSUI / frontend /src /components /HelpModal.tsx
Ilya
smal ui changes
9e92584
Raw History Blame Contribute Delete
4.5 kB
import { useEffect, useState } from "react";
import { Modal, Stack, Text, List, Code, Divider, Anchor, Group, Badge } from "@mantine/core";
import { getVersion, BuildVersion } from "../api";
interface Props {
opened: boolean;
onClose: () => void;
}
export function HelpModal({ opened, onClose }: Props) {
const [version, setVersion] = useState<BuildVersion | null>(null);
useEffect(() => {
if (!opened) return;
getVersion()
.then(setVersion)
.catch(() => setVersion(null));
}, [opened]);
return (
<Modal
opened={opened}
onClose={onClose}
title="LAMPSUI — quick start"
size="lg"
centered
>
<Stack gap="md">
<Text size="sm">
A web UI for SDPD multiphase + thixotropy simulations on top of
patched LAMMPS 21Nov2023. The tabs in the main panel are your
workflow.
</Text>
<Divider label="Workflow at a glance" labelPosition="left" />
<List size="sm" type="ordered" spacing="xs">
<List.Item>
Pick an example from the dropdown in the top toolbar (start with{" "}
<Code>test_100</Code> for a fast smoke test).
</List.Item>
<List.Item>
Edit parameters in the left panel. Use the bookmark icon to save
sets of parameters as <b>presets</b> you can reapply.
</List.Item>
<List.Item>
Hit <b>Run</b> in the toolbar. The bottom console streams the log;
rendered PNG frames appear in the <b>Frames</b> tab; thermo (Temp/
Press) plots live in the <b>Thermo</b> tab.
</List.Item>
<List.Item>
Past runs accumulate in the right-hand <b>Recent runs</b> panel.
Click any to load its frames + log; rename or delete from the row.
</List.Item>
<List.Item>
For sweeps, switch to the <b>Optimize</b> tab — set up an
objective, search space, hit Start. Pareto front + analysis report
appear once trials complete.
</List.Item>
<List.Item>
For natural-language setup, the <b>Agent</b> tab talks to DeepSeek
(or any OpenAI-compatible LLM you point it at) and has tools to
run, watch, and optimise on your behalf.
</List.Item>
</List>
<Divider label="Where to read more" labelPosition="left" />
<Text size="sm">
Open the <b>Docs</b> tab for the full reference. It includes:
</Text>
<List size="sm" spacing={2}>
<List.Item>
<b>Introduction to SDPD</b> — what's being simulated and what the
multi-phase + thixotropy patches add
</List.Item>
<List.Item>
<b>Parameter reference</b> — every editable variable, typical
ranges, what to vary
</List.Item>
<List.Item>
<b>Example cases</b> — what each of the 17 numerical cases studies,
plus rough cost estimates
</List.Item>
<List.Item>
<b>Optimization guide</b> — picking metric/reduction, sampler
choice (TPE / NSGA-II / NSGA-III), search-space tips
</List.Item>
<List.Item>
<b>Agent prompt examples</b> — sample prompts that work well
</List.Item>
<List.Item>
<b>Troubleshooting</b> — common errors and fixes
</List.Item>
</List>
<Text size="xs" c="dimmed">
Source / issues:{" "}
<Anchor
href="https://github.com/BCAM-CFD/SDPD-mf_thixo"
target="_blank"
>
BCAM-CFD/SDPD-mf_thixo
</Anchor>
{" · "}
<Anchor href="https://www.lammps.org/" target="_blank">
lammps.org
</Anchor>
</Text>
{version && (
<Group gap={6}>
<Badge size="xs" variant="light" color="gray">
build
</Badge>
<Text size="xs" c="dimmed" ff="monospace">
{version.build_time}
{version.git_commit ? ` · ${version.git_commit.slice(0, 7)}` : ""}
</Text>
<Text size="xs" c="dimmed">
— if this looks older than your last push, HF served a cached
layer; do <b>Factory rebuild</b> in Space settings.
</Text>
</Group>
)}
</Stack>
</Modal>
);
}