From 919daf0f5dc949f016eb3e9dd6e57eca81d36d63 Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 17 Mar 2026 16:29:55 +0100 Subject: [PATCH] documentation of code relating to displaying pronouns in the room timeline --- src/app/features/room/message/Message.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index 9dd200ed..b3b29926 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -280,6 +280,10 @@ function useMobileDoubleTap(callback: () => void, delay = 300) { ); } +/** + * Component to render pronouns in the chat timeline. + * It also filters them. + */ const Pronouns = as< 'span', { @@ -295,6 +299,13 @@ const Pronouns = as< .map((lang) => lang.trim().toLowerCase()) .filter(Boolean); + /** + * filter the pronouns based on the user's language settings. + * If filtering is enabled, only show pronouns that match the selected languages. + * If filtering is disabled, show all pronouns but still apply the language filter to determine which pronouns to show if there are multiple sets of pronouns for different languages. + * If there are multiple sets of pronouns and filtering is enabled, only show the ones that match the selected languages. + * If there are no pronouns that match the selected languages, show all pronouns. + */ const visiblePronouns = filterPronounsByLanguage( pronouns, languageFilterEnabled,