From 7486fdb54c7330e880e6bf45565ff6fd7d671156 Mon Sep 17 00:00:00 2001 From: Leo310 Date: Fri, 5 Apr 2024 12:11:27 +0200 Subject: [PATCH] style(onboarding): imroved ux --- src/components/Onboarding/OllamaApp.svelte | 10 +++++++-- src/components/Onboarding/OllamaDaemon.svelte | 3 ++- src/components/Onboarding/OllamaSetup.svelte | 14 +++++++++---- src/components/Onboarding/Onboarding.svelte | 21 ++++++++++++------- src/components/Onboarding/OpenAI.svelte | 11 +++++++++- .../Onboarding/PullOllamaModel.svelte | 1 - src/lang/en.json | 20 +++++++++--------- 7 files changed, 53 insertions(+), 27 deletions(-) diff --git a/src/components/Onboarding/OllamaApp.svelte b/src/components/Onboarding/OllamaApp.svelte index 4d44dae..226b7d1 100644 --- a/src/components/Onboarding/OllamaApp.svelte +++ b/src/components/Onboarding/OllamaApp.svelte @@ -4,8 +4,14 @@ import { isOllamaRunning } from '../../controller/Ollama'; import OllamaSetup from './OllamaSetup.svelte'; import { t } from 'svelte-i18n'; + import { afterUpdate } from 'svelte'; export let osType: string; + export let scrollToBottom = () => {}; + + afterUpdate(() => { + scrollToBottom(); + }); let isRunning: boolean = false; let isOllamaTested: boolean = false; @@ -52,11 +58,11 @@
  • {$t('onboarding.ollama.app.restart')}
  • - {:else} + {:else if osType === 'Windows_NT'}
  • {$t('onboarding.ollama.app.quit')}
  • {$t('onboarding.ollama.app.start_origins')}
  • {/if} - + {/if} diff --git a/src/components/Onboarding/OllamaDaemon.svelte b/src/components/Onboarding/OllamaDaemon.svelte index b3038cd..7ad91e8 100644 --- a/src/components/Onboarding/OllamaDaemon.svelte +++ b/src/components/Onboarding/OllamaDaemon.svelte @@ -8,6 +8,7 @@ import { t } from 'svelte-i18n'; export let osType: string; + export let scrollToBottom = () => {}; onMount(() => { $data.isIncognitoMode = true; @@ -34,5 +35,5 @@
  • {$t('onboarding.ollama.deamon.start')}
  • - + diff --git a/src/components/Onboarding/OllamaSetup.svelte b/src/components/Onboarding/OllamaSetup.svelte index df9d49c..2afc454 100644 --- a/src/components/Onboarding/OllamaSetup.svelte +++ b/src/components/Onboarding/OllamaSetup.svelte @@ -1,6 +1,6 @@ -
    +
    @@ -29,15 +34,15 @@ {#if osType === 'Darwin'} {/if} - {#if selected === 'Ollama App' || osType === 'Windows_NT'} - + {#if selected === 'Ollama App'} + {:else} - + {/if} {:else}

    {$t('onboarding.openai_mode_note')}

    - + {/if}
    diff --git a/src/components/Onboarding/OpenAI.svelte b/src/components/Onboarding/OpenAI.svelte index 7ea1bd9..ed800b2 100644 --- a/src/components/Onboarding/OpenAI.svelte +++ b/src/components/Onboarding/OpenAI.svelte @@ -6,6 +6,13 @@ import { plugin, data } from '../../store'; import InitButtonComponent from './InitButton.svelte'; import { t } from 'svelte-i18n'; + import { afterUpdate } from 'svelte'; + + export let scrollToBottom = () => {}; + + afterUpdate(() => { + scrollToBottom(); + }); let openAIApiKey: string = $data.openAIGenModel.openAIApiKey; let isValid: boolean = false; @@ -62,5 +69,7 @@ {#if isValid} - +
    + +
    {/if} diff --git a/src/components/Onboarding/PullOllamaModel.svelte b/src/components/Onboarding/PullOllamaModel.svelte index 2e657e4..eaf23ab 100644 --- a/src/components/Onboarding/PullOllamaModel.svelte +++ b/src/components/Onboarding/PullOllamaModel.svelte @@ -18,7 +18,6 @@ let progress: number = 0; let status: string = ''; let isPullingError = false; - console.log('pullModel', pullModel); async function pullOllamaModelStream() { isPullingModel = true; diff --git a/src/lang/en.json b/src/lang/en.json index cb8238a..4964847 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -73,18 +73,18 @@ "input_placeholder": "Chat with your Smart Second Brain..." }, "onboarding": { - "welcome_msg": "Welcome to your Smart Second Brain! Your personal AI assistant that helps you to find information in your notes.", + "welcome_msg": "Welcome to your Smart Second Brain! Your personal AI assistant that helps you to find and process information in your notes.", "setup": "Setup", "test": "Test", - "privacy_mode_note": "Your assistant is running in privacy mode. That means it is not connected to the internet and is running fully locally by leveraging Ollama.", - "openai_mode_note": "Your assistant is using third party services to run. That means you will have to share all your personal information with these services and your Smart Second Brain needs to be connected to the internet to leverage OpenAIs large language models like ChatGPT.", + "privacy_mode_note": "Your assistant will run in privacy mode. That means it is not connected to the internet and is running fully locally by leveraging Ollama.", + "openai_mode_note": "Your assistant will use third-party services to run. That means you will have to share all your personal information with these services and your Smart Second Brain needs to be connected to the internet to leverage OpenAIs large language models like ChatGPT.", "init": "Start your Smart Second Brain", "init_label": "Click to Start", "ollama": { "deamon": { - "install": "Install Ollama", + "install": "Install Ollama in the terminal:", "set_baseurl": "Set the Ollama Base URL", - "start": "Start the Ollama with origins" + "start": "Start Ollama by running this command in the terminal" }, "app": { "download": "Download the App", @@ -92,16 +92,16 @@ "extract": "Extract the .zip and start Ollama", "run": "Run the setup.exe", "test_label": "Test if Ollama is running", - "set_origins": "Set Ollama origins to enable streaming responses", + "set_origins": "In the terminal set Ollama origins to enable streaming responses:", "restart": "Restart the Ollama service ", - "restart_label": "Click menu bar icon and then quit", + "restart_label": "Click Ollamas menu bar icon and then quit", "quit": "Quit the Ollama service ", - "quit_label": "Click menu bar icon and then quit", - "start_origins": "Start the Ollama service with origins" + "quit_label": "Click Ollamas menu bar icon and then quit", + "start_origins": "Start Ollama by running this command in the powershell" }, "test_origins": "Test if the origins are set correctly", "install_model": "Install an Ollama Embedding Model.", - "recommended_models": "Recommended:", + "recommended": "Recommended: ", "set_model": "Set your Embedding Model:" }, "openai": {