From 48b4dfb26f85dcfeb8cc2bf117d1d937b56761ac Mon Sep 17 00:00:00 2001 From: Ka Hung Lee Date: Wed, 7 Oct 2026 19:59:35 -0700 Subject: [PATCH 1/6] Fix stale and HTML-escaped chat start description; Ignore Enter during IME composition --- frontend/src/contexts/HousingContext.tsx | 5 +- .../Chat/components/InitializationForm.tsx | 1 + .../src/pages/Chat/components/InputField.tsx | 8 ++- .../components/InitializationForm.test.tsx | 52 +++++++++++++++++++ .../src/tests/components/InputField.test.tsx | 30 +++++++++++ 5 files changed, 91 insertions(+), 5 deletions(-) diff --git a/frontend/src/contexts/HousingContext.tsx b/frontend/src/contexts/HousingContext.tsx index b5bbbcd0..dc6915e2 100644 --- a/frontend/src/contexts/HousingContext.tsx +++ b/frontend/src/contexts/HousingContext.tsx @@ -1,5 +1,4 @@ import { createContext, useCallback, useMemo, useState } from "react"; -import DOMPurify, { SANITIZE_USER_SETTINGS } from "../shared/utils/dompurify"; import type { Location } from "../types/models"; import type { JurisdictionKey } from "../shared/constants/jurisdictions"; @@ -39,9 +38,7 @@ export default function HousingContextProvider({ children }: Props) { const handleIssueDescription = useCallback( (event: React.ChangeEvent) => { - setIssueDescription( - DOMPurify.sanitize(event.target.value, SANITIZE_USER_SETTINGS), - ); + setIssueDescription(event.target.value); }, [], ); diff --git a/frontend/src/pages/Chat/components/InitializationForm.tsx b/frontend/src/pages/Chat/components/InitializationForm.tsx index 68fbbaf2..123231c5 100644 --- a/frontend/src/pages/Chat/components/InitializationForm.tsx +++ b/frontend/src/pages/Chat/components/InitializationForm.tsx @@ -84,6 +84,7 @@ export default function InitializationForm({ addMessage, setMessages }: Props) {