Skip to content

Conversation

@julianbenegas
Copy link
Member

  • Create /api/search/posts endpoint with Typesense highlighting
  • Add usePostSearch hook for client-side instant search
  • Update Composer to support onQueryChange callback
  • Create PostSearchResults component with highlighted snippets
  • Integrate search in NewPostComposer
  • Add categoryId to comments index for filtered search
  • Pass categoryId to NewPostComposer on category pages

- Create /api/search/posts endpoint with Typesense highlighting
- Add usePostSearch hook for client-side instant search
- Update Composer to support onQueryChange callback
- Create PostSearchResults component with highlighted snippets
- Integrate search in NewPostComposer
- Add categoryId to comments index for filtered search
- Pass categoryId to NewPostComposer on category pages
@vercel
Copy link
Contributor

vercel bot commented Jan 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
forums Ready Ready Preview, Comment Jan 6, 2026 2:36am

- Add postTitle and postNumber to comments index for title search
- Search both postTitle and text fields in Typesense
- Create RepoPostsWithSearch to replace ActivePosts when searching
- Add comment ID anchor for direct hash navigation from search
- Simplify search API by using indexed data (no DB joins needed)
- Add repos collection to Typesense with name, postCount, lastActive
- Add indexRepo, indexAllRepos, searchRepos functions
- Add reindexAll function that rebuilds all collections
- Update admin "Reindex All" button to show repos/posts/comments counts
- Update repo search API to use Typesense
- Update index page SearchResult type for new field names
- Remove turbopuffer.ts and turbopuffer-index.ts
{results.map((result) => {
const href = result.isRootComment
? `/${owner}/${repo}/${result.postNumber}`
: `/${owner}/${repo}/${result.postNumber}#${result.commentId}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: `/${owner}/${repo}/${result.postNumber}#${result.commentId}`
: `/${owner}/${repo}/${result.postNumber}#comment-${result.commentId}`

The anchor link for non-root comments uses an incorrect format (# instead of #comment- ), which will prevent navigation to the correct comment.

View Details

Analysis

Incorrect anchor link format prevents navigation to non-root comments in search results

What fails: PostSearchResults component constructs anchor links with format # for non-root comments, but the comment-thread component creates anchor IDs with format comment- . This mismatch prevents clicking search results from navigating to the correct comment.

How to reproduce:

  1. Search for text that appears in a non-root comment
  2. Click the search result link
  3. The page navigates to the post but the URL anchor does not match any element ID

Result: Browser cannot find the element with ID matching the href anchor, so navigation fails (no scroll to comment, no highlighting)

Expected: Anchor link should use format #comment- to match the anchor ID created in comment-thread.tsx line 78

Fix: Updated post-search-results.tsx line 38 to use correct format #comment- , matching the pattern already correctly used in repo-posts-with-search.tsx line 143

@julianbenegas
Copy link
Member Author

interesting... but... i wonder if this is desirable... or if we actually want semantic search using turbopuffer and to search "related questions", vs instant search...

@julianbenegas julianbenegas deleted the claude/instant-search-posts-sdEut branch January 10, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants