From 27ae4d0d82dea4fb5ef0f0aba6304070e783ccee Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 15 Feb 2024 00:34:55 -0800 Subject: [PATCH 1/3] feat: fullscreen mode --- src/lib/components/chat/Messages.svelte | 6 ++++- .../components/chat/Settings/Interface.svelte | 27 +++++++++++++++++++ src/lib/components/layout/Navbar.svelte | 9 +++++-- src/routes/(app)/+page.svelte | 6 ++++- src/routes/(app)/c/[id]/+page.svelte | 6 ++++- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 7125dc62..d4ca35a3 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -220,7 +220,11 @@ {#key chatId} {#each messages as message, messageIdx}
-
+
{#if message.role === 'user'} { + fullScreenMode = !fullScreenMode; + saveSettings({ fullScreenMode: fullScreenMode }); + }; + const toggleShowUsername = async () => { showUsername = !showUsername; saveSettings({ showUsername: showUsername }); @@ -64,6 +70,7 @@ titleAutoGenerate = settings.titleAutoGenerate ?? true; responseAutoCopy = settings.responseAutoCopy ?? false; showUsername = settings.showUsername ?? false; + fullScreenMode = settings.fullScreenMode ?? false; titleAutoGenerateModel = settings.titleAutoGenerateModel ?? ''; }); @@ -119,6 +126,26 @@
+
+
+
Full Screen Mode
+ + +
+
+
diff --git a/src/lib/components/layout/Navbar.svelte b/src/lib/components/layout/Navbar.svelte index 3b63cb88..adc11b3f 100644 --- a/src/lib/components/layout/Navbar.svelte +++ b/src/lib/components/layout/Navbar.svelte @@ -4,7 +4,7 @@ const { saveAs } = fileSaver; import { getChatById } from '$lib/apis/chats'; - import { chatId, modelfiles } from '$lib/stores'; + import { chatId, modelfiles, settings } from '$lib/stores'; import ShareChatModal from '../chat/ShareChatModal.svelte'; import TagInput from '../common/Tags/TagInput.svelte'; import Tags from '../common/Tags.svelte'; @@ -71,7 +71,12 @@ id="nav" class=" fixed py-2.5 top-0 flex flex-row justify-center bg-white/95 dark:bg-gray-900/90 dark:text-gray-200 backdrop-blur-xl w-screen z-30" > -
+