Skip to content

Commit 1d691c2

Browse files
authored
UI polish for modeling panel (#2917)
* Don't push content down with unsaved tag * Adjust spacing between components
1 parent 20c6392 commit 1d691c2

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

extensions/ql-vscode/src/view/method-modeling/MethodModeling.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ import { VSCodeTag } from "@vscode/webview-ui-toolkit/react";
1010
import { ReviewInEditorButton } from "./ReviewInEditorButton";
1111

1212
const Container = styled.div`
13-
padding: 0.3rem;
13+
padding-top: 0.5rem;
1414
margin-bottom: 1rem;
1515
width: 100%;
1616
`;
1717

1818
const Title = styled.div`
19-
padding-bottom: 0.3rem;
20-
font-size: 0.7rem;
19+
padding-bottom: 0.5rem;
20+
font-size: 0.9rem;
2121
text-transform: uppercase;
2222
display: flex;
2323
justify-content: space-between;
24+
align-items: center;
2425
`;
2526

2627
const DependencyContainer = styled.div`
@@ -34,8 +35,23 @@ const DependencyContainer = styled.div`
3435
padding: 0.5rem;
3536
word-wrap: break-word;
3637
word-break: break-all;
38+
margin-bottom: 0.8rem;
39+
`;
40+
41+
const StyledMethodModelingInputs = styled(MethodModelingInputs)`
42+
padding-bottom: 0.5rem;
3743
`;
3844

45+
const StyledVSCodeTag = styled(VSCodeTag)<{ visible: boolean }>`
46+
visibility: ${(props) => (props.visible ? "visible" : "hidden")};
47+
`;
48+
49+
const UnsavedTag = ({ modelingStatus }: { modelingStatus: ModelingStatus }) => (
50+
<StyledVSCodeTag visible={modelingStatus === "unsaved"}>
51+
Unsaved
52+
</StyledVSCodeTag>
53+
);
54+
3955
export type MethodModelingProps = {
4056
modelingStatus: ModelingStatus;
4157
method: Method;
@@ -54,13 +70,13 @@ export const MethodModeling = ({
5470
<Title>
5571
{method.packageName}
5672
{method.libraryVersion && <>@{method.libraryVersion}</>}
57-
{modelingStatus === "unsaved" ? <VSCodeTag>Unsaved</VSCodeTag> : null}
73+
<UnsavedTag modelingStatus={modelingStatus} />
5874
</Title>
5975
<DependencyContainer>
6076
<ModelingStatusIndicator status={modelingStatus} />
6177
<MethodName {...method} />
6278
</DependencyContainer>
63-
<MethodModelingInputs
79+
<StyledMethodModelingInputs
6480
method={method}
6581
modeledMethod={modeledMethod}
6682
onChange={onChange}

extensions/ql-vscode/src/view/method-modeling/MethodModelingInputs.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ const Container = styled.div`
1111
padding-top: 0.5rem;
1212
`;
1313

14-
const Input = styled.label``;
14+
const Input = styled.label`
15+
display: block;
16+
padding-bottom: 0.3rem;
17+
`;
1518

1619
const Name = styled.span`
1720
display: block;
18-
padding-bottom: 0.3rem;
21+
padding-bottom: 0.5rem;
1922
`;
2023

2124
export type MethodModelingInputsProps = {

extensions/ql-vscode/src/view/method-modeling/ReviewInEditorButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import TextButton from "../common/TextButton";
66
import { Method } from "../../model-editor/method";
77

88
const Button = styled(TextButton)`
9-
margin-top: 0.5rem;
9+
margin-top: 0.7rem;
1010
`;
1111

1212
type Props = {

0 commit comments

Comments
 (0)