Skip to content

BF-011-BF-014: Improve tool discovery search, filters, favorites, and recents - #209

Merged
baixiangcpp merged 2 commits into
mainfrom
codex/bf-p1-search-filters-favorites
Jun 24, 2026
Merged

BF-011-BF-014: Improve tool discovery search, filters, favorites, and recents#209
baixiangcpp merged 2 commits into
mainfrom
codex/bf-p1-search-filters-favorites

Conversation

@baixiangcpp

Copy link
Copy Markdown
Owner

Summary:

  • Added a shared weighted tool-search metadata layer with aliases, task synonyms, category terms, popularity boosts, and localized aliases for zh-CN, zh-TW, ja, ko, de, and fr.
  • Wired Command Palette and All Tools to the same scoring path, including privacy-safe query-length/count analytics only.
  • Reworked All Tools filters into a mobile drawer with active counts, removable chips, clear/reset controls, tags, empty-state suggestions, and no persisted free-text query state.
  • Added local-only Favorites and Recent Tools surfaces on All Tools and tool pages, with timestamped storage records limited to tool IDs.
  • Updated Trust Center / Privacy Policy copy across supported locales to document favorites, recents, timestamps, and forbidden payload persistence.

Issues:

Implementation details:

  • Search: src/core/search/tool-search-metadata.ts centralizes weighted metadata and localized aliases; scoreToolSearch applies popularity, favorite, and recent bonuses without making those metadata markers searchable.
  • Routing/metadata: No new routes or indexable filtered pages were added. All Tools continues using safe URL params for category/filter state, and free-text search is not written to the URL.
  • Storage: src/core/storage/tool-discovery-state.ts migrates legacy arrays to { toolKey, updatedAt } records and keeps read helpers returning key lists for existing UI code.
  • UI: All Tools gets a 390px-friendly filter drawer and hydrated personalized favorites/recent panels; tool pages get a favorite button near the trust header.
  • Tests: Added real generated-index search ranking regressions, localized query regressions, storage-shape assertions, All Tools drawer/favorite tests, and a guard against payload-shaped favorite/recent persistence.
  • Content: Updated Privacy Policy and Trust Center storage wording in en, zh-CN, zh-TW, ja, ko, de, and fr.

Privacy review:

  • No tool payloads are stored by default.
  • Favorites and recents store only tool IDs plus timestamps in localStorage.
  • No tool input, output, files, logs, tokens, secrets, full URLs, or search query text are persisted.
  • No new external request runs automatically.
  • Analytics remains disabled by default and search telemetry passes only language, query-length bucket, result count, and source page.
  • localStorage/sessionStorage/IndexedDB/cache usage was reviewed; this PR only changes the approved localStorage discovery state shape.

SEO review:

  • Clean /[lang]/all-tools remains indexable.
  • Filter states remain parameterized and noindex/canonical behavior from BF-002 is unchanged.
  • Free-text search is intentionally not serialized into URLs.
  • Sitemap behavior is unchanged; no parameter pages or new routes were added.
  • Hreflang/canonical behavior was covered by the build post-checks.

Accessibility review:

  • Mobile filter drawer uses role="dialog", aria-modal, explicit close controls, and reachable clear/done actions.
  • Favorite controls use aria-label and aria-pressed.
  • Existing visible focus ring classes were preserved on interactive controls.
  • Dynamic personalized sections hydrate after client storage sync and remain keyboard reachable.

Tests:

  • Targeted checks run:
    • npm run test -- tests/unit/command-search.test.ts tests/unit/tool-discovery-state.test.ts tests/component/all-tools-discovery.test.tsx tests/component/route-page-chrome.test.tsx
    • npm run test -- tests/unit/command-search.test.ts tests/unit/tool-discovery-state.test.ts tests/component/all-tools-discovery.test.tsx tests/component/route-page-chrome.test.tsx tests/guards/sensitive-storage-audit.test.ts tests/guards/command-palette-search-guard.test.ts tests/guards/all-tools-route-guard.test.ts
    • npm run test -- tests/unit/command-search.test.ts tests/component/all-tools-discovery.test.tsx tests/guards/command-palette-search-guard.test.ts tests/guards/sensitive-storage-audit.test.ts
    • npm run test -- tests/component/all-tools-discovery.test.tsx tests/unit/tool-discovery-state.test.ts
    • npm run test -- tests/unit/command-search.test.ts tests/component/all-tools-discovery.test.tsx tests/guards/sensitive-storage-audit.test.ts
    • npm run check:i18n
    • npm run check:types -- --pretty false
    • npm run lint -- src/core/search/command-search.ts src/core/search/tool-search-metadata.ts src/core/storage/tool-discovery-state.ts src/features/tool-discovery/all-tools-discovery.tsx src/components/layout/command-palette.tsx src/components/layout/route-page-chrome.tsx src/components/layout/tool-favorite-control.tsx tests/unit/command-search.test.ts tests/unit/tool-discovery-state.test.ts tests/component/all-tools-discovery.test.tsx tests/component/route-page-chrome.test.tsx tests/guards/sensitive-storage-audit.test.ts
    • npm run lint -- src/components/layout/command-palette.tsx src/core/search/command-search.ts src/core/search/tool-search-metadata.ts tests/unit/command-search.test.ts tests/guards/command-palette-search-guard.test.ts
    • npm run lint -- 'src/app/[lang]/all-tools/page.tsx' src/features/tool-discovery/all-tools-discovery.tsx src/core/search/command-search.ts src/core/search/tool-search-metadata.ts tests/unit/command-search.test.ts tests/component/all-tools-discovery.test.tsx
    • npm run lint -- src/features/tool-discovery/all-tools-discovery.tsx tests/component/all-tools-discovery.test.tsx
    • git diff --check
  • Batch-level checks run:
    • npm run build passed after moving personalized All Tools controls out of static HTML and keeping the route within the performance budget.
    • Earlier npm run build attempts failed on /en/all-tools HTML budget; those failures were used to reduce static page weight before the final passing build.
  • Full checks run:
    • npm run test passed: 228 files, 1154 tests.
    • npm run lint passed.
    • npm run build passed.
  • Full CI:
    • Remote PR checks will run once on this PR; no extra CI-triggering pushes planned unless a failure requires it.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploying byteflow with  Cloudflare Pages  Cloudflare Pages

Latest commit: 650ef8f
Status: ✅  Deploy successful!
Preview URL: https://bd0d9f29.byteflow-c58.pages.dev
Branch Preview URL: https://codex-bf-p1-search-filters-f.byteflow-c58.pages.dev

View logs

@baixiangcpp
baixiangcpp merged commit 5244c4a into main Jun 24, 2026
2 checks passed
@baixiangcpp
baixiangcpp deleted the codex/bf-p1-search-filters-favorites branch June 24, 2026 05:26
This was referenced Jun 24, 2026
This was referenced Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment