Expand Settings search with module-level registry

Search field at the top of Settings now finds Sidebar Links,
  Spoolman, Spool/Color Catalog, all four Failure Detection
  sections, Email auth (Advanced + SMTP test), 2FA (TOTP, Email
  OTP, Linked Accounts), SSO/OIDC, LDAP Server Config, and the
  four Backup sub-cards (GitHub, History, Local, Scheduled).

  Replaces the hardcoded searchIndex array in SettingsPage.tsx
  with a module-level registry (frontend/src/lib/settingsSearch.ts).
  Each settings card calls registerSettingsSearch(...) at module
  scope, so adding a new card means adding one colocated line
  instead of editing a distant central array. Anchor ids were
  added to the corresponding Card elements in the affected
  components so scrollIntoView lands on the right section.
This commit is contained in:
maziggy
2026-04-13 16:13:04 +02:00
parent 487d11fa94
commit 180db8e8ad
16 changed files with 601 additions and 9273 deletions
@@ -286,7 +286,7 @@ export function TwoFactorSettings() {
return (
<div className="space-y-6">
{/* ── TOTP ─────────────────────────────────────────────────────────── */}
<Card>
<Card id="card-2fa-totp">
<CardHeader>
<div className="flex items-center gap-3">
<div className={`w-10 h-10 rounded-full flex items-center justify-center ${status?.totp_enabled ? 'bg-green-500/20' : 'bg-gray-500/20'}`}>
@@ -391,7 +391,7 @@ export function TwoFactorSettings() {
</Card>
{/* ── Email OTP ─────────────────────────────────────────────────────── */}
<Card>
<Card id="card-2fa-emailotp">
<CardHeader>
<div className="flex items-center gap-3">
<div className={`w-10 h-10 rounded-full flex items-center justify-center ${status?.email_otp_enabled ? 'bg-green-500/20' : 'bg-gray-500/20'}`}>
@@ -513,7 +513,7 @@ export function TwoFactorSettings() {
{/* ── Linked SSO accounts ───────────────────────────────────────────── */}
{oidcLinks && oidcLinks.length > 0 && (
<Card>
<Card id="card-2fa-linked">
<CardHeader>
<h3 className="text-white font-semibold">{t('settings.twoFa.linkedAccounts')}</h3>
<p className="text-bambu-gray text-sm">{t('settings.twoFa.linkedAccountsDesc')}</p>