From 5fc581a18011b73b6e43f61417ba8613e7378734 Mon Sep 17 00:00:00 2001
From: "google-labs-jules[bot]"
<161369871+google-labs-jules[bot]@users.noreply.github.com>
Date: Sat, 31 May 2025 09:43:18 +0000
Subject: [PATCH] feat: Implement chat interface font customization
This commit introduces new UI settings to control the font color, family, and size of the text within the chat interface.
Key changes:
- Added new state variables and actions to `ui/src/stores/useUi.js` for:
- Chat font color (`chatFontColor`)
- Chat font family (`chatFontFamily`)
- Chat font size (`chatFontSize`)
- These settings are persisted in local storage.
- Added controls for these font properties to the "Chat Interface Colors" section in `ui/src/views/SettingsView.vue`.
- Includes a color picker for font color.
- Includes a text input for font family.
- Includes a number input for font size (px).
- Modified `ui/src/components/chat/CanvasChat.vue` to use these new font settings via CSS custom properties.
- The `chatStyleVariables` computed property now includes variables for font settings.
- Chat messages (agent and user) and the chat input textarea now apply these font styles.
I've confirmed that the font settings are applied correctly to messages and the input area, persist across sessions, and integrate well with existing theme and color customizations.
---
ui/src/components/chat/CanvasChat.vue | 21 ++++++++++++++++++---
ui/src/stores/useUi.js | 21 +++++++++++++++++++++
ui/src/views/SettingsView.vue | 23 +++++++++++++++++++++++
3 files changed, 62 insertions(+), 3 deletions(-)
diff --git a/ui/src/components/chat/CanvasChat.vue b/ui/src/components/chat/CanvasChat.vue
index 086fea9..baa8ed0 100644
--- a/ui/src/components/chat/CanvasChat.vue
+++ b/ui/src/components/chat/CanvasChat.vue
@@ -14,6 +14,9 @@ const chatStyleVariables = computed(() => ({
'--chat-input-box-color': ui.chatInputBoxColor,
'--chat-accent-color': ui.chatAccentColor,
'--chat-background-color': ui.chatBackgroundColor,
+ '--chat-font-color': ui.chatFontColor,
+ '--chat-font-family': ui.chatFontFamily || 'inherit', // Fallback to inherit if empty
+ '--chat-font-size': ui.chatFontSize ? `${ui.chatFontSize}px` : 'inherit', // Fallback to inherit
}))
function scrollBottom () {
@@ -58,8 +61,13 @@ watch(() => chat.items.length, scrollBottom)