audit/2026-09-08: ツール検索・お気に入り・最近使ったツール・モバイルヘッダー・calculate イベント拡張 - #4
Merged
Merged
Conversation
…eader, richer calculate event
Why:
- 223 tools with no way to find one except scrolling category lists. Adds a
shared matcher (title/slug prefix > substring > keyword > category words >
description, top 10) used by the /tools page search and a new header search
(desktop: inline input + dropdown; mobile: icon that expands a bar).
`/` focuses search (page search wins over header via a priority registry),
Enter opens the first hit, Esc closes. GA4 `tool_search` is debounced.
- The client only receives common messages, so localized titles for the header
search come from a new static per-locale route `/{locale}/search-index.json`
(fetched lazily on first focus; middleware skips dotted paths).
- Favorites (`toolify_favorites_v1`, migrates legacy `toolify:favorites`) and
recently used (`toolify_recent_v1`, max 8) live in localStorage only and are
read via useSyncExternalStore with an empty server snapshot, so SSR/hydration
never differ. Both show as shelves on home and /tools when non-empty.
- Mobile header (<sm) is now Logo + search icon + hamburger; nav links and the
language switcher move into the sheet. Desktop layout unchanged.
- `calculate` now carries tool_category, locale, input_count (filled inputs)
and has_result (any non-empty aria-live/output/result element) computed in
ToolInteractionTracker only; no per-tool files touched.
- New i18n keys (nav.menu/closeMenu, tool.recent/search*/categoryKeywords)
added to all 17 locales; audit:i18n passes.
Claude-Session: https://claude.ai/code/session_01AcLxcZtf35XLpenzFXTpUC
appdevelopsk
added a commit
that referenced
this pull request
Sep 18, 2026
index 対象ページの関連リンクが noindex ページへ向いていた問題 (#3) と、 どこからも関連リンクを貰えない index 対象ページ (#4) をまとめて是正する。 #3 権威漏れ: getRelated に indexableOnly を追加し、index 対象ページでは index 対象だけを 関連に出す。実測で 378 本中 112 本 (29.6%) が noindex 先に向いていた。 既定は false のままとし、noindex ツールのページは従来どおり全ツールから 関連を出す (利用者向けの導線であり、クロール上の損が無いため)。 #4 孤児: fill をレジストリ登録順で埋めていたため、カテゴリ内の先頭付近ばかりが 関連に出て末尾のツールが孤児になっていた (#3 適用後も15件)。 明示 related の被リンク数 (index 対象ページからの分のみ) が少ない順に 埋めるよう変更する。同数なら slug 順で固定しビルド間で揺れないようにした。 ※被リンク数の集計で getRelated を呼ぶと相互再帰になるため明示 related のみ数える。 実測 (ビルド出力の HTML で検証): 関連リンク総数 378 → 374 noindex 先 112 → 0 関連が3件未満のページ 7 → 0 被related 0 のページ 21 → 0 (被リンク分布 min=1 / median=6 / max=14) noindex ページ160件は平均5.98件で従来どおり (関連0件は無し) 一覧の表示件数は 223 件のまま変更していない (ken 判断)。 Claude-Session: https://claude.ai/code/session_01ENHPNZ5ngcdrTHJ2H6oAFd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
ログイン不要・localStorage のみで完結する UX 改善をまとめて追加します(サーバ状態なし)。223 個のツールファイルは一切変更していません。
変更内容
/toolsページ検索と、ヘッダー検索(デスクトップ: インライン入力+ドロップダウン/モバイル: アイコン→検索バー展開)を共通マッチャーlib/search/matcher.tsで実装。/で検索にフォーカス(ページ検索がヘッダー検索より優先)、Enter で先頭の結果を開く、Esc で閉じる。tool_search{query_length, results_count} をデバウンス送信。/{locale}/search-index.json(force-static、全ロケール生成)を追加し、初回フォーカス時に遅延取得します。toolify_favorites_v1(slug 配列)。旧キーtoolify:favoritesからの移行あり。/toolsの先頭に「お気に入り」セクション(空なら非表示)。GA4favorite_toggle{tool_slug, state}。toolify_recent_v1へ MRU で push(最大 8、重複排除)。ホーム・/toolsに「最近使ったツール」行。useSyncExternalStore+ 空のサーバスナップショットでハイドレーション差分なし。calculateイベント拡張ToolInteractionTrackerのみでtool_category/locale/input_count/has_resultを付与。nav.menu,nav.closeMenu,tool.recent,tool.search*,tool.categoryKeywords.*を 17 ロケールすべてに追加。検証
npx tsc --noEmit: OKnpm run audit:i18n: ✓ i18n consistency OKnpx vitest run src/lib/search: 6 passed(新規matcher.test.ts)next lint: リポジトリに ESLint 設定がなく対話プロンプトになるため未実行未実施・注意点
https://claude.ai/code/session_01AcLxcZtf35XLpenzFXTpUC