Skip to content

Feat: Add Advanced Formula-Based Search to Friend Feed#1745

Open
rnmmr wants to merge 1 commit into
vrcx-team:masterfrom
rnmmr:feature-formula-search
Open

Feat: Add Advanced Formula-Based Search to Friend Feed#1745
rnmmr wants to merge 1 commit into
vrcx-team:masterfrom
rnmmr:feature-formula-search

Conversation

@rnmmr

@rnmmr rnmmr commented Apr 30, 2026

Copy link
Copy Markdown

Explain in detail what your suggested feature would be used for.

This pull request adds support for advanced formula-based search to the Friend Feed, enabling users to execute powerful and flexible queries using a formula syntax (e.g., =name=Alice & type=GPS). The change is adapted from rnmmr@986d547 and includes:

  • Integration of a new search formula parser and evaluator (src/shared/utils/feedSearchFormula.js) with comprehensive unit tests
  • Minimal UI additions: Limited to a help dialog and search icon in the Feed view
  • Full i18n support for help documentation and error handling
  • Improved error reporting and feedback for search input
  • Enhanced backend feed search algorithm with date/time extraction and field-specific logic
  • User search support: Added usr_xxx prefix to search all feed records for a specific user
  • Search Depth control: Users can adjust search depth directly from the Feed filter popover
  • Performance optimizations: Implemented efficient query merging and keyword extraction; designed to handle large datasets (1000-4000 friends, 8GB+ databases) per VRCX performance baseline
  • Safety features: Added input validation, robust error handling, and graceful recovery
  • Time-based filtering: Support for year/month/day/hour/minute/second granularity time range queries
  • Non-disruptive opt-in: Formula search activates only with = prefix; native keyword search remains fully functional

Describe how it would look if it requires a UI.

  • Minimal UI changes: The core functionality is implemented in backend utilities
  • Adds a search help icon and dialog to the Feed page explaining formula syntax
  • Search bar accepts formula (starting with =) and provides error feedback
  • Help documentation localized in English and Chinese with usage examples
  • No changes to existing layouts or styling - only adds documentation elements
  • Backward compatible: Native keyword search works exactly as before

Explain why people would want to use it.

  • Broadly applicable: Enables precise filtering for users with large friend lists (1000-4000+ friends) who need advanced auditing capabilities
  • Powerful queries: Search friend feed history with complex combinations (names, events, dates, types, etc.)
  • No disruption: Users can continue using simple keyword search; formula search is completely optional
  • Lower learning curve: Multi-language help with practical examples makes it accessible to new users
  • Maintenance friendly: Well-tested with 65+ unit tests, minimal UI footprint reduces future maintenance burden

Usage Examples:

  • =name=Alice & type=GPS - Search GPS updates for Alice
  • =time>2024/04 & type!=Offline - Search non-offline events in April
  • =name=[Alice,Bob,Charlie] - Search records for multiple users
  • =world="Test World" & time=2024/04/01~2024/04/30 - Search records in specific world and date range
  • =type!=GPS - Exclude GPS type records
image image

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.

1 participant