Skip to content

Conversation

@aadamgough
Copy link
Contributor

@aadamgough aadamgough commented Jun 27, 2025

Description

The search bar in the knowledge base for the chunks wasn't working, now it is so users can search chunks.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Searched a chunk, removed the search query, refreshed the page, clicked through the pages and confirmed that all of this was working.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel
Copy link

vercel bot commented Jun 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2025 5:51pm
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2025 5:51pm

@delve-auditor
Copy link

delve-auditor bot commented Jun 27, 2025

No security or compliance issues detected. Reviewed everything up to 1c051d1.

Security Overview
  • 🔎 Scanned files: 5 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► document.tsx
    Add client-side instant search with fuzzy matching
► search-highlight.tsx
    Add text highlighting component for search results
► use-knowledge.ts
    Implement fuzzy search functionality
► package.json
    Add fuse.js dependency

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@aadamgough aadamgough marked this pull request as ready for review June 27, 2025 00:42
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Implements robust search functionality in the knowledge base chunk viewer with improved state management and user experience.

  • Added debounced search with loading states in apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx
  • Implemented URL-based state persistence for search queries and pagination
  • Added page position restoration after search clear
  • Enhanced error handling for document processing status
  • Improved loading state management during search operations

1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 deleted the branch staging June 28, 2025 04:45
@waleedlatif1 waleedlatif1 deleted the fix/search-chunk branch June 28, 2025 04:46
@waleedlatif1 waleedlatif1 restored the fix/search-chunk branch June 28, 2025 04:49
@waleedlatif1 waleedlatif1 reopened this Jun 28, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Fixed search functionality implementation in knowledge base chunk viewer with enhanced state management and error handling.

  • Fixed issue with search state clearing by properly handling URL state reset in apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx
  • Added proper dependency management in useEffect hooks to prevent stale closures
  • Implemented consistent error state handling during search operations

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

Copy link
Collaborator

@waleedlatif1 waleedlatif1 left a comment

Choose a reason for hiding this comment

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

we have to consider moving the searching for chunks server-side, since loading in 100+ chunks all at once and filtering on the client-side might cause bad performance and errors. just have to weigh the options but this is not a good implementation

@emir-karabeg emir-karabeg force-pushed the staging branch 2 times, most recently from dd2ccdd to 805b245 Compare June 30, 2025 04:53
@emir-karabeg
Copy link
Collaborator

Can you remove the commits not related to this PR and rebase?

aadamgough pushed a commit that referenced this pull request Jun 30, 2025
@vercel vercel bot temporarily deployed to Preview – docs June 30, 2025 06:43 Inactive
aadamgough pushed a commit that referenced this pull request Jun 30, 2025
@vercel vercel bot temporarily deployed to Preview – docs June 30, 2025 06:49 Inactive
@aadamgough aadamgough closed this Jul 9, 2025
@aadamgough aadamgough reopened this Jul 9, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Comprehensive refactoring to simplify block output structures and improve knowledge base search functionality across the codebase.

  • Flattened response objects across all block types, removing nested 'response' wrappers for simpler data access
  • Added realtime server with Socket.IO for collaborative features, including proper CORS and authentication handling
  • Enhanced error handling in function execution with detailed line numbers and context
  • Improved token refresh mechanism and OAuth provider configurations for better reliability
  • Added auto-pan setting with proper database migration and UI controls

254 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 4a26b06 into staging Jul 9, 2025
6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/search-chunk branch July 9, 2025 17:52
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
* fix: chunk search bar fix

* fix: fixed reload and refresh

* fix: fixed structure

* fix: need to fix persisting in knowledge search

* fix: adding page as query param

* fix: bun run lint (simstudioai#557)

* added instantaneous client-side search, added fuzzy search & text highlighting

---------

Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
Co-authored-by: Waleed Latif <walif6@gmail.com>
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.

4 participants