From 257974325eb400ea9000f640015921a2ad3e6861 Mon Sep 17 00:00:00 2001 From: Nivedin <53208152+nivedin@users.noreply.github.com> Date: Fri, 21 Jun 2024 23:27:22 +0530 Subject: [PATCH 1/4] fix: large content scroll bug in codemirror editor (#4138) --- .../src/components/lenses/renderers/JSONLensRenderer.vue | 3 ++- .../src/components/lenses/renderers/RawLensRenderer.vue | 4 ++-- packages/hoppscotch-common/src/composables/codemirror.ts | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/hoppscotch-common/src/components/lenses/renderers/JSONLensRenderer.vue b/packages/hoppscotch-common/src/components/lenses/renderers/JSONLensRenderer.vue index 512932346..f9ae2f42a 100644 --- a/packages/hoppscotch-common/src/components/lenses/renderers/JSONLensRenderer.vue +++ b/packages/hoppscotch-common/src/components/lenses/renderers/JSONLensRenderer.vue @@ -119,10 +119,11 @@ /> -
+
-
-
+
+
diff --git a/packages/hoppscotch-common/src/composables/codemirror.ts b/packages/hoppscotch-common/src/composables/codemirror.ts index b09a644d2..a2a4d25e2 100644 --- a/packages/hoppscotch-common/src/composables/codemirror.ts +++ b/packages/hoppscotch-common/src/composables/codemirror.ts @@ -330,7 +330,10 @@ export function useCodemirror( ), EditorView.domEventHandlers({ - scroll(event) { + scroll(event, view) { + // HACK: This is a workaround to fix the issue in CodeMirror where the content doesn't load when the editor is not in view. + view.requestMeasure() + if (event.target && options.contextMenuEnabled) { // Debounce to make the performance better debouncedTextSelection(30)() From d45f15e9cb55db04204fa12a4a438b6a8a0e7f1a Mon Sep 17 00:00:00 2001 From: Anwarul Islam Date: Mon, 24 Jun 2024 12:16:50 +0600 Subject: [PATCH 2/4] fix: prevent unwanted variable wrapping during Insomnia import (#4076) feat: conditionally check path variable --- .../src/helpers/import-export/import/insomnia.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts b/packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts index a69dbb9c3..a3781ad53 100644 --- a/packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts +++ b/packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts @@ -48,8 +48,13 @@ const parseInsomniaDoc = (content: string) => const replacePathVarTemplating = (expression: string) => expression.replaceAll(/:([^/]+)/g, "<<$1>>") -const replaceVarTemplating = (expression: string) => - pipe(expression, replacePathVarTemplating, replaceInsomniaTemplating) +const replaceVarTemplating = (expression: string, pathVar = false) => { + return pipe( + expression, + pathVar ? replacePathVarTemplating : (x) => x, + replaceInsomniaTemplating + ) +} const getFoldersIn = ( folder: InsomniaFolderResource | null, @@ -208,7 +213,7 @@ const getHoppRequest = (req: InsomniaRequestResource): HoppRESTRequest => makeRESTRequest({ name: req.name ?? "Untitled Request", method: req.method?.toUpperCase() ?? "GET", - endpoint: replaceVarTemplating(req.url ?? ""), + endpoint: replaceVarTemplating(req.url ?? "", true), auth: getHoppReqAuth(req), body: getHoppReqBody(req), headers: getHoppReqHeaders(req), From fac90ac3425d13287d967cd4b9ce71d75783960f Mon Sep 17 00:00:00 2001 From: Nivedin <53208152+nivedin@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:15:04 +0530 Subject: [PATCH 3/4] fix: styling issue on selection in codemirror (#4122) --- .../hoppscotch-common/src/helpers/editor/themes/baseTheme.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/hoppscotch-common/src/helpers/editor/themes/baseTheme.ts b/packages/hoppscotch-common/src/helpers/editor/themes/baseTheme.ts index 9c074d8fb..a50b40597 100644 --- a/packages/hoppscotch-common/src/helpers/editor/themes/baseTheme.ts +++ b/packages/hoppscotch-common/src/helpers/editor/themes/baseTheme.ts @@ -59,6 +59,7 @@ export const baseTheme = EditorView.theme({ backgroundColor: "var(--accent-dark-color)", color: "var(--accent-contrast-color)", borderRadius: "2px", + opacity: "0.4", }, ".cm-panels": { backgroundColor: "var(--primary-light-color)", From 6e63c723b7218f3d8db91f01401bbc116fa46dee Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Mon, 24 Jun 2024 16:04:39 +0530 Subject: [PATCH 4/4] chore: bump cli to 0.8.1 due to new hopp-data schema change --- packages/hoppscotch-cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hoppscotch-cli/package.json b/packages/hoppscotch-cli/package.json index e69b9b14c..15891d507 100644 --- a/packages/hoppscotch-cli/package.json +++ b/packages/hoppscotch-cli/package.json @@ -1,6 +1,6 @@ { "name": "@hoppscotch/cli", - "version": "0.8.0", + "version": "0.8.1", "description": "A CLI to run Hoppscotch test scripts in CI environments.", "homepage": "https://hoppscotch.io", "type": "module",