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

Resizable editor #39

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist
node_modules
.vscode-test/
*.vsix
postCode.code-workspace
2 changes: 1 addition & 1 deletion webview/components/RequestOptionsWindow/styles.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.request-options-window-wrapper {
flex: 1;
padding: 5px 20px 10px 20px;
overflow: scroll;
overflow: auto;
}
6 changes: 4 additions & 2 deletions webview/pages/Postcode/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
.request-options-wrapper {
display: flex;
flex-direction: column;
min-height: 50%;
height: inherit;
resize: vertical;
overflow: auto;
}

.response-wrapper {
display: flex;
flex-direction: column;
height: 50%;
height: inherit;
}
1 change: 1 addition & 0 deletions webview/shared/Editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Editor = (props) => {
minimap: { enabled: false },
scrollBeyondLastLine: false,
theme: "vs-dark",
automaticLayout: true,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shifting to the GraphQL Tab (under Body) causes the editor to keep expanding horizontally. Have a hunch that this is being caused by automaticLayout. Could you fix this?

Copy link
Author

@AhmadHddad AhmadHddad Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

automaticLayout is set to true in order to make the editor expand when resizing, if set to false, when resizing it wouldn't take the new layout, the property does allow for this behaviour to happen, but I need it for resizing and I am looking into it.

Copy link
Author

@AhmadHddad AhmadHddad Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohinivsenthil A simple solution is to pass automaticLayout as a prop instead of statically setting it, so I think that's a good solution.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohinivsenthil could you checkout this PR?

value,
language,
readOnly,
Expand Down