From 927aa9dc3d81a4933c6b770e59fa6608970e1c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Wed, 30 Jul 2025 14:39:55 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20inline=20=E3=81=AA=20SearchMar?= =?UTF-8?q?ker=20=E3=81=AE=E3=83=91=E3=82=B9=E3=81=8C=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=81=8F=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#16301)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * replace URL path for inlined SearchMarkers The search index looks like: ```ts [ { id: 'foo', label: 'security', path: '/settings/security', inlining: ['2fa'], }, { id: '2fa', label: 'two-factor auth', path: '/settings/2fa', // guessed wrong by the index generation }, { id: 'aaaa', parentId: '2fa', label: 'totp', }, … ] ``` This file post-processes that index and re-parents the inlined sections. Problem was, it left the (wrong) `path` untouched. Replacing the `path` makes the search work fine. * Update Changelog --------- Co-authored-by: dakkar --- CHANGELOG.md | 3 ++- packages/frontend/src/utility/settings-search-index.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f6ca2a862..161a336a8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ - ### Client -- +- Fix: 一部の設定検索結果が存在しないパスになる問題を修正 + (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1171) ### Server - diff --git a/packages/frontend/src/utility/settings-search-index.ts b/packages/frontend/src/utility/settings-search-index.ts index 7ed97ed34f..8506e4fe2f 100644 --- a/packages/frontend/src/utility/settings-search-index.ts +++ b/packages/frontend/src/utility/settings-search-index.ts @@ -24,6 +24,7 @@ for (const item of generated) { const inline = rootMods.get(id); if (inline) { inline.parentId = item.id; + inline.path = item.path; } else { console.log('[Settings Search Index] Failed to inline', id); }