From 2d20ee9d246a145f5bca3061ad499185e7ffd651 Mon Sep 17 00:00:00 2001 From: 17ColinMiPerry <17colinmiperry@gmail.com> Date: Thu, 8 May 2025 21:31:10 -0700 Subject: [PATCH 1/3] Implemented spellcheck toggle in Settings --- .../Actions/EditMessage/index.jsx | 12 ++++ .../ChatContainer/PromptInput/index.jsx | 11 ++++ frontend/src/locales/ar/common.js | 4 ++ frontend/src/locales/da/common.js | 4 ++ frontend/src/locales/de/common.js | 4 ++ frontend/src/locales/en/common.js | 4 ++ frontend/src/locales/es/common.js | 4 ++ frontend/src/locales/fa/common.js | 4 ++ frontend/src/locales/fr/common.js | 4 ++ frontend/src/locales/he/common.js | 4 ++ frontend/src/locales/it/common.js | 4 ++ frontend/src/locales/ja/common.js | 4 ++ frontend/src/locales/ko/common.js | 4 ++ frontend/src/locales/nl/common.js | 4 ++ frontend/src/locales/pt_BR/common.js | 4 ++ frontend/src/locales/ru/common.js | 4 ++ frontend/src/locales/tr/common.js | 4 ++ frontend/src/locales/vn/common.js | 4 ++ frontend/src/locales/zh/common.js | 4 ++ frontend/src/locales/zh_TW/common.js | 4 ++ frontend/src/models/appearance.js | 1 + .../GeneralSettings/Settings/Chat/index.jsx | 2 + .../Settings/components/SpellCheck/index.jsx | 56 +++++++++++++++++++ 23 files changed, 154 insertions(+) create mode 100644 frontend/src/pages/GeneralSettings/Settings/components/SpellCheck/index.jsx diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/Actions/EditMessage/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/Actions/EditMessage/index.jsx index 3c1fd16a180..ba23854b365 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/Actions/EditMessage/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/Actions/EditMessage/index.jsx @@ -1,5 +1,6 @@ import { Pencil } from "@phosphor-icons/react"; import { useState, useEffect, useRef } from "react"; +import Appearance from "@/models/appearance"; const EDIT_EVENT = "toggle-message-edit"; @@ -70,6 +71,16 @@ export function EditMessageForm({ saveChanges, }) { const formRef = useRef(null); + const [enableSpellCheck, setEnableSpellCheck] = useState(false); + + useEffect(() => { + function fetchSettings() { + const settings = Appearance.getSettings(); + setEnableSpellCheck(settings.enableSpellCheck ?? true); + } + fetchSettings(); + }, []); + function handleSaveMessage(e) { e.preventDefault(); const form = new FormData(e.target); @@ -98,6 +109,7 @@ export function EditMessageForm({