[PR #257] [MERGED] fix: make /search host-aware in SSR #300

Closed
opened 2026-02-15 17:16:44 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/257
Author: @steipete
Created: 2/13/2026
Status: Merged
Merged: 2/13/2026
Merged by: @steipete

Base: mainHead: fix/search-route-mode-aware-v2


📝 Commits (3)

  • c706507 fix: make /search mode-aware
  • 124c6c2 fix: make /search host-aware in SSR
  • 5d2529c chore: fix lint and route tree for /search route

📊 Changes

4 files changed (+141 additions, -4 deletions)

View changed files

📝 convex/statsMaintenance.ts (+4 -4)
src/__tests__/search-route.test.ts (+78 -0)
📝 src/routeTree.gen.ts (+21 -0)
src/routes/search.tsx (+38 -0)

📄 Description

Supersedes #36.

Changes:

  • add /search route redirect that detects mode by request/browser hostname (not SSR env fallback)
  • redirect to /skills in skills mode with full search shape
  • redirect to / in souls mode preserving query/search semantics
  • add route tests for skills + souls hosts

Validation:

  • bun run test src/tests/search-route.test.ts
  • bun run test
  • bun run build
  • bun run lint (biome schema/version mismatch info in this environment)

Greptile Overview

Greptile Summary

This PR adds a dedicated /search route that immediately redirects based on detected site mode from the request/browser hostname (using detectSiteMode).

  • In skills mode, /search redirects to /skills while forwarding the expected search params (q, highlighted) and keeping the full search shape used by the skills index.
  • In souls mode, /search redirects to / and preserves the existing “query vs. search-mode” semantics by setting search: true only when there is no query.
  • Adds a focused route-level test covering both hostnames and query/no-query behavior.

This fits the codebase’s existing pattern of “redirect-only” routes (e.g. /admin) and centralizes host-based mode selection via src/lib/site.ts.

Confidence Score: 5/5

  • This PR looks safe to merge with minimal risk.
  • Changes are isolated to a new redirect-only route and a small targeted test. Redirect search shapes align with existing route validateSearch behavior for /skills, and the home route does not validate search params. No functional regressions were found within the repository context.
  • No files require special attention

Last reviewed commit: 5d2529c


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/257 **Author:** [@steipete](https://github.com/steipete) **Created:** 2/13/2026 **Status:** ✅ Merged **Merged:** 2/13/2026 **Merged by:** [@steipete](https://github.com/steipete) **Base:** `main` ← **Head:** `fix/search-route-mode-aware-v2` --- ### 📝 Commits (3) - [`c706507`](https://github.com/openclaw/clawhub/commit/c70650743508b2bb7cd9ff75eff327ac5b23d39b) fix: make /search mode-aware - [`124c6c2`](https://github.com/openclaw/clawhub/commit/124c6c2600a00537953b2caf1b200e1d6a60b165) fix: make /search host-aware in SSR - [`5d2529c`](https://github.com/openclaw/clawhub/commit/5d2529c3380b34adb2cb2aaccfcd55c7176ee023) chore: fix lint and route tree for /search route ### 📊 Changes **4 files changed** (+141 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `convex/statsMaintenance.ts` (+4 -4) ➕ `src/__tests__/search-route.test.ts` (+78 -0) 📝 `src/routeTree.gen.ts` (+21 -0) ➕ `src/routes/search.tsx` (+38 -0) </details> ### 📄 Description Supersedes #36. Changes: - add /search route redirect that detects mode by request/browser hostname (not SSR env fallback) - redirect to /skills in skills mode with full search shape - redirect to / in souls mode preserving query/search semantics - add route tests for skills + souls hosts Validation: - bun run test src/__tests__/search-route.test.ts - bun run test - bun run build - bun run lint (biome schema/version mismatch info in this environment) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a dedicated `/search` route that immediately redirects based on detected site mode from the request/browser hostname (using `detectSiteMode`). - In **skills** mode, `/search` redirects to `/skills` while forwarding the expected search params (`q`, `highlighted`) and keeping the full search shape used by the skills index. - In **souls** mode, `/search` redirects to `/` and preserves the existing “query vs. search-mode” semantics by setting `search: true` only when there is no query. - Adds a focused route-level test covering both hostnames and query/no-query behavior. This fits the codebase’s existing pattern of “redirect-only” routes (e.g. `/admin`) and centralizes host-based mode selection via `src/lib/site.ts`. <h3>Confidence Score: 5/5</h3> - This PR looks safe to merge with minimal risk. - Changes are isolated to a new redirect-only route and a small targeted test. Redirect search shapes align with existing route `validateSearch` behavior for `/skills`, and the home route does not validate search params. No functional regressions were found within the repository context. - No files require special attention <sub>Last reviewed commit: 5d2529c</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:44 -05:00
yindo closed this issue 2026-02-15 17:16:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#300