diff --git a/apps/web/src/dialogs/settings/index.tsx b/apps/web/src/dialogs/settings/index.tsx index 4285a174dc..ef55f5c9e2 100644 --- a/apps/web/src/dialogs/settings/index.tsx +++ b/apps/web/src/dialogs/settings/index.tsx @@ -244,98 +244,102 @@ function SettingsSideBar(props: SettingsSideBarProps) { }} data-test-id="settings-navigation-menu" > - - + { - const query = e.target.value.toLowerCase().trim(); - if (!query) - return onNavigate( - SettingsGroups.filter((g) => g.section === route) - ); - - const groups: SettingsGroup[] = []; - for (const group of SettingsGroups) { - const isTitleMatch = - typeof group.header === "string" && - group.header.toLowerCase().includes(query); - const isSectionMatch = group.section.includes(query); - - if (isTitleMatch || isSectionMatch) { - groups.push(group); - continue; - } + > + { + const query = e.target.value.toLowerCase().trim(); + if (!query) + return onNavigate( + SettingsGroups.filter((g) => g.section === route) + ); - const settings = group.settings.filter((setting) => { - const description = - typeof setting.description === "function" - ? setting.description() - : setting.description; - - return [ - description || "", - setting.keywords?.join(" ") || "", - setting.title - ] - .join(" ") - ?.toLowerCase() - .includes(query); - }); - if (!settings.length) continue; - groups.push({ ...group, settings }); - } - onNavigate(groups); - }} - /> - {sectionGroups.map((group) => ( - - - {group.title} - - {group.sections.map( - (section) => - (!section.isHidden || !section.isHidden()) && ( - { - onNavigate( - SettingsGroups.filter((g) => g.section === section.key) - ); - setRoute(section.key); - }} - /> - ) - )} - - ))} - + const groups: SettingsGroup[] = []; + for (const group of SettingsGroups) { + const isTitleMatch = + typeof group.header === "string" && + group.header.toLowerCase().includes(query); + const isSectionMatch = group.section.includes(query); + + if (isTitleMatch || isSectionMatch) { + groups.push(group); + continue; + } + + const settings = group.settings.filter((setting) => { + const description = + typeof setting.description === "function" + ? setting.description() + : setting.description; + + return [ + description || "", + setting.keywords?.join(" ") || "", + setting.title + ] + .join(" ") + ?.toLowerCase() + .includes(query); + }); + if (!settings.length) continue; + groups.push({ ...group, settings }); + } + onNavigate(groups); + }} + /> + {sectionGroups.map((group) => ( + + + {group.title} + + {group.sections.map( + (section) => + (!section.isHidden || !section.isHidden()) && ( + { + onNavigate( + SettingsGroups.filter( + (g) => g.section === section.key + ) + ); + setRoute(section.key); + }} + /> + ) + )} + + ))} + + ); }