diff --git a/src/lib/components/chat/Messages/UserMessage.svelte b/src/lib/components/chat/Messages/UserMessage.svelte index a1993648..d9705c46 100644 --- a/src/lib/components/chat/Messages/UserMessage.svelte +++ b/src/lib/components/chat/Messages/UserMessage.svelte @@ -4,7 +4,7 @@ import { tick } from 'svelte'; import Name from './Name.svelte'; import ProfileImage from './ProfileImage.svelte'; - import { modelfiles } from '$lib/stores'; + import { modelfiles, settings, user as userStore } from '$lib/stores'; export let user; export let message; @@ -58,11 +58,19 @@ {#if $modelfiles.map((modelfile) => modelfile.tagName).includes(message.user)} {$modelfiles.find((modelfile) => modelfile.tagName === message.user)?.title} {:else} - You {message?.user ?? ''} + {#if $settings.showUsername} + {$userStore.name} + {:else} + You {message?.user ?? ''} + {/if} + {/if} + {:else} + {#if $settings.showUsername} + {$userStore.name} + {:else} + You + {/if} {/if} - {:else} - You - {/if} {#if message.timestamp} diff --git a/src/lib/components/chat/Settings/Interface.svelte b/src/lib/components/chat/Settings/Interface.svelte index 4c142a38..a30e5eac 100644 --- a/src/lib/components/chat/Settings/Interface.svelte +++ b/src/lib/components/chat/Settings/Interface.svelte @@ -16,6 +16,13 @@ // Interface let promptSuggestions = []; + let showUsername = false; + + const toggleShowUsername = async () => { + showUsername = !showUsername; + saveSettings({ showUsername: showUsername }); + }; + const toggleSpeechAutoSend = async () => { speechAutoSend = !speechAutoSend; @@ -64,7 +71,7 @@ titleAutoGenerate = settings.titleAutoGenerate ?? true; speechAutoSend = settings.speechAutoSend ?? false; responseAutoCopy = settings.responseAutoCopy ?? false; - + showUsername = settings.showUsername ?? false; titleAutoGenerateModel = settings.titleAutoGenerateModel ?? ''; }); @@ -139,6 +146,25 @@ + + + Display the username instead of "You" in the Chat + + { + toggleShowUsername(); + }} + type="button" + > + {#if showUsername === true} + On + {:else} + Off + {/if} + + +