diff --git a/apps/web/src/dialogs/settings/index.tsx b/apps/web/src/dialogs/settings/index.tsx index 3a7d75f09..04e3fc596 100644 --- a/apps/web/src/dialogs/settings/index.tsx +++ b/apps/web/src/dialogs/settings/index.tsx @@ -185,112 +185,115 @@ export default function SettingsDialog(props: SettingsDialogProps) { - - + { + const query = e.target.value.toLowerCase().trim(); + if (!query) + return setActiveSettings( + 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); + + if (isTitleMatch) { + groups.push(group); + continue; } + + const settings = group.settings.filter( + (setting) => + setting.description?.toLowerCase().includes(query) || + setting.keywords?.some((keyword) => + keyword.toLowerCase().includes(query) + ) || + setting.title.toLowerCase().includes(query) + ); + if (!settings.length) continue; + groups.push({ ...group, settings }); + } + setActiveSettings(groups); }} - data-test-id="settings-navigation-menu" - > - { - const query = e.target.value.toLowerCase().trim(); - if (!query) - return setActiveSettings( - 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); - - if (isTitleMatch) { - groups.push(group); - continue; - } - - const settings = group.settings.filter( - (setting) => - setting.description?.toLowerCase().includes(query) || - setting.keywords?.some((keyword) => - keyword.toLowerCase().includes(query) - ) || - setting.title.toLowerCase().includes(query) - ); - if (!settings.length) continue; - groups.push({ ...group, settings }); - } - setActiveSettings(groups); - }} - /> - {sectionGroups.map((group) => ( - - - {group.title} - - {group.sections.map( - (section) => - (!section.isHidden || !section.isHidden()) && ( - { - setActiveSettings( - SettingsGroups.filter( - (g) => g.section === section.key - ) - ); - setRoute(section.key); - }} - /> - ) - )} - - ))} - + /> + {sectionGroups.map((group) => ( + + + {group.title} + + {group.sections.map( + (section) => + (!section.isHidden || !section.isHidden()) && ( + { + setActiveSettings( + SettingsGroups.filter( + (g) => g.section === section.key + ) + ); + setRoute(section.key); + }} + /> + ) + )} + + ))} - - {activeSettings.map((group) => ( - - ))} - + {activeSettings.map((group) => ( + + ))} @@ -307,7 +310,14 @@ function SettingsGroupComponent(props: { item: SettingsGroup }) { if (item.isHidden && item.isHidden()) return null; return ( - + {typeof item.header === "string" ? (