From 49ef015c7c03ca9a40151cc94b64174ec0f8abce Mon Sep 17 00:00:00 2001 From: cjkfyi <165058376+cjkfyi@users.noreply.github.com> Date: Thu, 4 Apr 2024 02:31:20 -0700 Subject: [PATCH] Start to fmt response Signed-off-by: cjkfyi <165058376+cjkfyi@users.noreply.github.com> --- extension/package.json | 2 +- extension/src/styles/webview.css | 3 ++- extension/src/webview.js | 11 ++--------- package.json | 2 +- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/extension/package.json b/extension/package.json index 53b8259..4436425 100755 --- a/extension/package.json +++ b/extension/package.json @@ -2,7 +2,7 @@ "name": "gemify", "displayName": "Gemify", "description": "Yet another coding assistant 🌬️", - "version": "0.5.2", + "version": "0.6.1", "engines": { "vscode": "^1.86.2" }, diff --git a/extension/src/styles/webview.css b/extension/src/styles/webview.css index cd7ae66..a191c85 100755 --- a/extension/src/styles/webview.css +++ b/extension/src/styles/webview.css @@ -88,6 +88,7 @@ main { #convoArea { display: flex; flex-direction: column; + white-space: pre-line; overflow-y: auto; } @@ -142,6 +143,6 @@ main { } .bot { - background-color: red; + background-color: #2e2e2e; align-self: flex-start; } diff --git a/extension/src/webview.js b/extension/src/webview.js index 83dcf97..5a794a3 100755 --- a/extension/src/webview.js +++ b/extension/src/webview.js @@ -53,8 +53,6 @@ window.addEventListener('message', e => { function streamGeminiRes() { - // console.log(resChunkQueue) - if (resChunkQueue.length === 0) { resInProg = false; return; @@ -78,13 +76,8 @@ function streamGeminiRes() { }; let messageContent; - try { - const parsedChunk = JSON.parse(chunk); - messageContent = parsedChunk.message; - } catch (error) { - messageContent = chunk; - }; - + messageContent = chunk; + let currentIndex = 0; const animationInterval = 10; diff --git a/package.json b/package.json index 9e4a380..0ebc473 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gemify", "description": "Yet another coding assistant 🌬️", - "version": "0.5.2", + "version": "0.6.1", "author": "@cjkfyi", "license": "MIT", "scripts": {