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
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