Skip to content

move result to top; fix bottom handle; use width=700 for code pods #54

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

Merged
merged 1 commit into from
Nov 15, 2022
Merged
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
37 changes: 17 additions & 20 deletions ui/src/components/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,6 @@ function ResultBlock({ pod, id }) {
const wsRun = useStore(store, (state) => state.wsRun);
return (
<Box>
{pod.stdout && (
<Box overflow="scroll" border="1px">
{/* TODO separate stdout and stderr */}
<Box bgcolor="lightgray">Stdout</Box>
<Box whiteSpace="pre-wrap" fontSize="sm">
<Ansi>{pod.stdout}</Ansi>
</Box>
</Box>
)}
{pod.running && <CircularProgress />}
{pod.result && (
<Box
sx={{ display: "flex", flexDirection: "column" }}
Expand Down Expand Up @@ -231,6 +221,16 @@ function ResultBlock({ pod, id }) {
)}
</Box>
)}
{pod.stdout && (
<Box overflow="scroll" border="1px">
{/* TODO separate stdout and stderr */}
<Box bgcolor="lightgray">Stdout</Box>
<Box whiteSpace="pre-wrap" fontSize="sm">
<Ansi>{pod.stdout}</Ansi>
</Box>
</Box>
)}
{pod.running && <CircularProgress />}
{pod.error && (
<Box overflow="scroll" border="1px">
<Box bgcolor="lightgray">Error</Box>
Expand Down Expand Up @@ -400,7 +400,11 @@ const CodeNode = memo<Props>(({ data, id, isConnectable }) => {
}}
onLayout={onLayout}
/>
{(pod.stdout || pod.stderr || pod.result || pod.error) && (
{(pod.running ||
pod.stdout ||
pod.stderr ||
pod.result ||
pod.error) && (
<Box
className="nowheel"
sx={{
Expand All @@ -420,13 +424,6 @@ const CodeNode = memo<Props>(({ data, id, isConnectable }) => {
</Box>
)}
</Box>

<Handle
type="source"
position={Position.Bottom}
isConnectable={isConnectable}
/>

{false && (
<Moveable
target={target}
Expand Down Expand Up @@ -514,7 +511,7 @@ export function Canvas() {
pods[id].type === "CODE"
? undefined
: level2color[level] || level2color["default"],
width: pods[id].width,
width: 700,
height: pods[id].height,
},
});
Expand Down Expand Up @@ -595,7 +592,7 @@ export function Canvas() {
};
} else {
style = {
width: 300,
width: 700,
height: 300,
};
}
Expand Down