From 4598bb1bdd5db485fa69a40aa20189a3f5b81c33 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Mon, 5 Aug 2024 17:49:04 +0530 Subject: [PATCH] fix(#2605): fix editor view height (#2758) * fix(#2605): fix editor view height * chore: disabled prettier on github actions --- .github/workflows/tests.yml | 12 ------------ package-lock.json | 2 +- .../src/components/CodeEditor/StyledWrapper.js | 1 + .../bruno-app/src/components/CodeEditor/index.js | 2 +- .../src/components/Documentation/StyledWrapper.js | 8 -------- .../bruno-app/src/components/Documentation/index.js | 4 ++-- .../src/components/MarkDown/StyledWrapper.js | 1 - .../components/RequestPane/HttpRequestPane/index.js | 2 +- .../RequestPane/QueryEditor/StyledWrapper.js | 1 + .../RequestPane/RequestBody/StyledWrapper.js | 4 ---- .../src/components/RequestPane/Script/index.js | 8 ++++---- .../src/components/RequestPane/Vars/index.js | 4 ++-- .../src/components/RequestTabPanel/index.js | 5 ++--- .../src/components/RequestTabs/StyledWrapper.js | 2 ++ packages/bruno-app/src/styles/globals.css | 6 ++++++ 15 files changed, 23 insertions(+), 39 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6eb759301..1abee37cf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,15 +71,3 @@ jobs: with: files: packages/bruno-tests/collection/junit.xml comment_mode: always - prettier: - name: Prettier - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - name: Install dependencies - run: npm ci --legacy-peer-deps - - name: Run Prettier - run: npm run test:prettier:web diff --git a/package-lock.json b/package-lock.json index 6792725f9..e021bf38f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19668,7 +19668,7 @@ }, "packages/bruno-electron": { "name": "bruno", - "version": "v1.21.0", + "version": "v1.23.1", "dependencies": { "@aws-sdk/credential-providers": "3.525.0", "@usebruno/common": "0.1.0", diff --git a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js index 3623d406d..232f964ae 100644 --- a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js +++ b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js @@ -6,6 +6,7 @@ const StyledWrapper = styled.div` border: solid 1px ${(props) => props.theme.codemirror.border}; font-family: ${(props) => (props.font ? props.font : 'default')}; line-break: anywhere; + flex: 1 1 0; } .CodeMirror-overlayscroll-horizontal div, diff --git a/packages/bruno-app/src/components/CodeEditor/index.js b/packages/bruno-app/src/components/CodeEditor/index.js index ddc38aff8..c67b22668 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.js +++ b/packages/bruno-app/src/components/CodeEditor/index.js @@ -289,7 +289,7 @@ export default class CodeEditor extends React.Component { } return ( { diff --git a/packages/bruno-app/src/components/Documentation/StyledWrapper.js b/packages/bruno-app/src/components/Documentation/StyledWrapper.js index f0ffee808..f159d94dc 100644 --- a/packages/bruno-app/src/components/Documentation/StyledWrapper.js +++ b/packages/bruno-app/src/components/Documentation/StyledWrapper.js @@ -1,14 +1,6 @@ import styled from 'styled-components'; const StyledWrapper = styled.div` - div.CodeMirror { - /* todo: find a better way */ - height: calc(100vh - 240px); - - .CodeMirror-scroll { - padding-bottom: 0px; - } - } .editing-mode { cursor: pointer; color: ${(props) => props.theme.colors.text.yellow}; diff --git a/packages/bruno-app/src/components/Documentation/index.js b/packages/bruno-app/src/components/Documentation/index.js index d4b790965..5a391db8a 100644 --- a/packages/bruno-app/src/components/Documentation/index.js +++ b/packages/bruno-app/src/components/Documentation/index.js @@ -37,8 +37,8 @@ const Documentation = ({ item, collection }) => { } return ( - -
+ +
{isEditing ? 'Preview' : 'Edit'}
diff --git a/packages/bruno-app/src/components/MarkDown/StyledWrapper.js b/packages/bruno-app/src/components/MarkDown/StyledWrapper.js index 65cb9c23b..f834fdaba 100644 --- a/packages/bruno-app/src/components/MarkDown/StyledWrapper.js +++ b/packages/bruno-app/src/components/MarkDown/StyledWrapper.js @@ -2,7 +2,6 @@ import styled from 'styled-components'; const StyledMarkdownBodyWrapper = styled.div` background: transparent; - height: inherit; .markdown-body { background: transparent; overflow-y: auto; diff --git a/packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js b/packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js index df90082c6..c7d66aadb 100644 --- a/packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js +++ b/packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js @@ -137,7 +137,7 @@ const HttpRequestPane = ({ item, collection, leftPaneWidth }) => { ) : null}
diff --git a/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js b/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js index 06f9e4b78..3832f60c0 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js +++ b/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js @@ -4,6 +4,7 @@ const StyledWrapper = styled.div` div.CodeMirror { background: ${(props) => props.theme.codemirror.bg}; border: solid 1px ${(props) => props.theme.codemirror.border}; + flex: 1 1 0; } textarea.cm-editor { diff --git a/packages/bruno-app/src/components/RequestPane/RequestBody/StyledWrapper.js b/packages/bruno-app/src/components/RequestPane/RequestBody/StyledWrapper.js index 83ebd8140..42da81d61 100644 --- a/packages/bruno-app/src/components/RequestPane/RequestBody/StyledWrapper.js +++ b/packages/bruno-app/src/components/RequestPane/RequestBody/StyledWrapper.js @@ -1,10 +1,6 @@ import styled from 'styled-components'; const Wrapper = styled.div` - div.CodeMirror { - /* todo: find a better way */ - height: calc(100vh - 220px); - } `; export default Wrapper; diff --git a/packages/bruno-app/src/components/RequestPane/Script/index.js b/packages/bruno-app/src/components/RequestPane/Script/index.js index 935b52ede..acd674ee0 100644 --- a/packages/bruno-app/src/components/RequestPane/Script/index.js +++ b/packages/bruno-app/src/components/RequestPane/Script/index.js @@ -40,8 +40,8 @@ const Script = ({ item, collection }) => { return ( -
-
Pre Request
+
+
Pre Request
{ onSave={onSave} />
-
-
Post Response
+
+
Post Response
{ return ( -
+
Pre Request
-
+
Post Response
diff --git a/packages/bruno-app/src/components/RequestTabPanel/index.js b/packages/bruno-app/src/components/RequestTabPanel/index.js index 2fd253f4b..ecec4bc9d 100644 --- a/packages/bruno-app/src/components/RequestTabPanel/index.js +++ b/packages/bruno-app/src/components/RequestTabPanel/index.js @@ -158,10 +158,9 @@ const RequestTabPanel = () => {
{item.type === 'graphql-request' ? ( diff --git a/packages/bruno-app/src/components/RequestTabs/StyledWrapper.js b/packages/bruno-app/src/components/RequestTabs/StyledWrapper.js index ec76ec5b5..26399d975 100644 --- a/packages/bruno-app/src/components/RequestTabs/StyledWrapper.js +++ b/packages/bruno-app/src/components/RequestTabs/StyledWrapper.js @@ -14,6 +14,8 @@ const Wrapper = styled.div` display: none; } + scrollbar-width: none; + li { display: inline-flex; max-width: 150px; diff --git a/packages/bruno-app/src/styles/globals.css b/packages/bruno-app/src/styles/globals.css index 29e9196ea..79c2a962c 100644 --- a/packages/bruno-app/src/styles/globals.css +++ b/packages/bruno-app/src/styles/globals.css @@ -58,6 +58,12 @@ body::-webkit-scrollbar-thumb, border-radius: 5rem; } +* { + /* This ensures that scrollbars are only visible when the user starts to scroll, + providing a cleaner and more minimalistic appearance. */ + scrollbar-width: thin; +} + /* * todo: this will be supported in the future to be changed via applying a theme * making all the checkboxes and radios bigger