documentation of code relating to displaying pronouns in the room timeline

This commit is contained in:
Rye committed 2026-03-17 16:29:55 +01:00
1 parent e321d5f953
commit 919daf0f5d
1 file changed
+11
+11
View File
@@ -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,